Commit 0ac8f830 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

unittest: Check for number of indexes after migration tests

parent 4f88159a
Pipeline #4795 passed with stage
in 5 minutes and 27 seconds
......@@ -116,6 +116,17 @@ public:
ASSERT_EQ( nbTriggers, expected );
}
void CheckNbIndexes( uint32_t expected )
{
medialibrary::sqlite::Statement stmt{ ml->getDbConn()->handle(),
"SELECT COUNT(*) FROM sqlite_master WHERE type='index'" };
stmt.execute();
auto row = stmt.row();
uint32_t nbIndexes;
row >> nbIndexes;
ASSERT_EQ( nbIndexes, expected );
}
virtual void TearDown() override
{
medialibrary::sqlite::Connection::Handle conn;
......@@ -240,4 +251,5 @@ TEST_F( DbModel, Upgrade14to15 )
auto res = ml->initialize( "test.db", "/tmp", cbMock.get() );
ASSERT_EQ( InitializeResult::Success, res );
CheckNbTriggers( 35 );
CheckNbIndexes( 37 );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment