1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 06:36:55 +02:00

Test no commandFactory is available before it was registered

This commit is contained in:
Dominik Schmidt
2013-07-06 01:18:41 +02:00
parent 4059af26d0
commit 76f73450c6

View File

@@ -50,7 +50,14 @@ private slots:
QVERIFY( lpCmd ); QVERIFY( lpCmd );
// try to handle a third party database command // try to handle a third party database command
// test no command factory is available until now
QVERIFY( !db->commandFactory<TestDatabaseCommand>() );
// register it
db->registerCommand<TestDatabaseCommand>(); db->registerCommand<TestDatabaseCommand>();
// make sure it's available now
command = db->commandFactory<TestDatabaseCommand>()->newInstance(); command = db->commandFactory<TestDatabaseCommand>()->newInstance();
TestDatabaseCommand* tCmd = qobject_cast< TestDatabaseCommand* >( command ); TestDatabaseCommand* tCmd = qobject_cast< TestDatabaseCommand* >( command );
QVERIFY( tCmd ); QVERIFY( tCmd );