akonadi
20 #ifndef QTEST_AKONADI_H 21 #define QTEST_AKONADI_H 23 #include <qtest_kde.h> 25 #include <akonadi/agentinstance.h> 26 #include <akonadi/agentmanager.h> 43 #define QTEST_AKONADIMAIN(TestObject, flags) \ 44 int main(int argc, char *argv[]) \ 46 setenv( "LC_ALL", "C", 1); \ 47 unsetenv( "KDE_COLOR_DEBUG" ); \ 48 KAboutData aboutData( QByteArray( "qttest" ), QByteArray(), ki18n( "KDE Test Program" ), QByteArray( "version" ) ); \ 49 KDEMainFlags mainFlags = flags; \ 50 KComponentData cData(&aboutData); \ 51 QApplication app( argc, argv, (mainFlags & GUI) != 0 ); \ 52 app.setApplicationName( QLatin1String( "qttest" ) ); \ 53 qRegisterMetaType<KUrl>(); \ 54 qRegisterMetaType<KUrl::List>(); \ 57 return QTest::qExec( &tc, argc, argv ); \ 60 namespace AkonadiTest {
64 void checkTestIsIsolated() {
65 Q_ASSERT_X(!qgetenv(
"TESTRUNNER_DB_ENVIRONMENT").isEmpty(),
66 "AkonadiTest::checkTestIsIsolated",
67 "This test must be run using ctest, in order to use the testrunner environment. Aborting, to avoid messing up your real akonadi");
73 void setAllResourcesOffline() {
87 #define AKVERIFYEXEC( job ) \ 88 QVERIFY2( job->exec(), job->errorString().toUtf8().constData() ) 91 #if QT_VERSION < 0x050000 94 #define QTRY_VERIFY(__expr) \ 96 const int __step = 50; \ 97 const int __timeout = 5000; \ 98 if ( !( __expr ) ) { \ 101 for ( int __i = 0; __i < __timeout && !( __expr ); __i += __step ) { \ 102 QTest::qWait( __step ); \ 108 #define QTRY_COMPARE(__expr, __expected) \ 110 const int __step = 50; \ 111 const int __timeout = 5000; \ 112 if ( ( __expr ) != ( __expected ) ) { \ 115 for ( int __i = 0; __i < __timeout && ( ( __expr ) != ( __expected ) ); __i += __step ) { \ 116 QTest::qWait( __step ); \ 118 QCOMPARE( __expr, __expected ); \ void setIsOnline(bool online)
Sets online status of the agent instance.
static AgentManager * self()
Returns the global instance of the agent manager.
A representation of an agent instance.
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Apr 5 2019 15:20:41 by
doxygen 1.8.15 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.