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:
@@ -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 );
|
||||||
|
Reference in New Issue
Block a user