1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 08:34:34 +02:00

Test a commandFactory is not available before the command was registered

This commit is contained in:
Dominik Schmidt
2013-07-06 01:18:41 +02:00
parent a006a32523
commit 3100cae9d4

View File

@@ -50,7 +50,14 @@ private slots:
QVERIFY( lpCmd );
// 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>();
// make sure it's available now
command = db->commandFactory<TestDatabaseCommand>()->newInstance();
TestDatabaseCommand* tCmd = qobject_cast< TestDatabaseCommand* >( command );
QVERIFY( tCmd );