summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2024-03-08 11:38:50 +0100
committerDominik Holland <dominik.holland@qt.io>2024-03-16 14:11:19 +0100
commitb7c9c6576df023ce49888de00cd8aa4a0073c0c5 (patch)
tree4928afa7f1f8fa29e44e4e51d8226ef97f7c2523
parentf39279aaab5605d01afbd01d67cef337e9302bf4 (diff)
Fix tests to compile for WebAssembly
Fixes: QTBUG-115221 Pick-to: 6.6 6.7 Change-Id: If4998130d6dc4b083ffd55416f934c88d7f0b138 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r--tests/auto/core/ifcodegen/backends/test/CMakeLists.txt1
-rw-r--r--tests/auto/core/ifcodegen/backends/test/tst_backends.cpp10
-rw-r--r--tests/auto/core/ifcodegen/backends/test/tst_backends.h2
-rw-r--r--tests/auto/core/ifcodegen/flat-cmake-hierarchy-test/CMakeLists.txt1
-rw-r--r--tests/auto/core/ifcodegen/include-test/test/CMakeLists.txt1
-rw-r--r--tests/auto/core/ifcodegen/org-example-echo-noanno/test/CMakeLists.txt1
-rw-r--r--tests/auto/core/ifcodegen/org-example-echo-noprivate/test/CMakeLists.txt1
-rw-r--r--tests/auto/core/ifcodegen/org-example-echo/test/CMakeLists.txt1
-rw-r--r--tests/auto/core/qifabstractfeature/CMakeLists.txt1
-rw-r--r--tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp36
-rw-r--r--tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp24
-rw-r--r--tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp38
-rw-r--r--tests/auto/core/qifsimulationengine/FunctionTest.qml2
-rw-r--r--tests/auto/core/qifsimulationengine/tst_qifsimulationengine.cpp69
14 files changed, 105 insertions, 83 deletions
diff --git a/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt b/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt
index 14bbf422..0c6218e5 100644
--- a/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt
+++ b/tests/auto/core/ifcodegen/backends/test/CMakeLists.txt
@@ -12,6 +12,7 @@ qt_internal_add_test(tst_backends
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/../
TESTDATA simulation.qml minimal_simulation_data.json server.conf
+ NO_BATCH
)
add_custom_target(tst_backends_extra_files
diff --git a/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp b/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp
index 486680be..2222910b 100644
--- a/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp
+++ b/tests/auto/core/ifcodegen/backends/test/tst_backends.cpp
@@ -28,10 +28,13 @@ static QString exeSuffix;
BackendsTest::BackendsTest()
: QObject()
+#if QT_CONFIG(process)
, m_serverProcess(new QProcess(this))
+#endif
, m_localServer(new QLocalServer(this))
, m_localSocket(nullptr)
{
+#if QT_CONFIG(process)
m_serverProcess->setProcessChannelMode(QProcess::MergedChannels);
connect(m_serverProcess, &QProcess::readyRead, this, [this]() {
while (m_serverProcess->canReadLine()) {
@@ -39,6 +42,7 @@ BackendsTest::BackendsTest()
qInfo().noquote() << "server output:" << QString::fromLocal8Bit(line);
}
});
+#endif
QString simulationFile = QFINDTESTDATA("simulation.qml");
QString simulationDataFile = QFINDTESTDATA("minimal_simulation_data.json");
@@ -62,12 +66,14 @@ void BackendsTest::sendCmd(const QByteArray &input)
void BackendsTest::startServer(QStringList arguments)
{
+#if QT_CONFIG(process)
if (!m_serverExecutable.isEmpty()) {
qInfo() << "Starting Server Process";
QVERIFY2(QFile::exists(m_serverExecutable), qPrintable(u"Executable doesn't exist: %1"_s.arg(m_serverExecutable)));
m_serverProcess->start(m_serverExecutable, arguments);
QVERIFY2(m_serverProcess->waitForStarted(), qPrintable(u"Process error: %1"_s.arg(m_serverProcess->error())));
}
+#endif
QVERIFY(m_localServer->waitForNewConnection(5000));
while (m_localServer->hasPendingConnections())
m_localSocket = m_localServer->nextPendingConnection();
@@ -125,6 +131,7 @@ void BackendsTest::init()
void BackendsTest::cleanup()
{
+#if QT_CONFIG(process)
if (m_serverProcess->state() == QProcess::Running) {
qInfo() << "Stopping Server Process";
@@ -136,6 +143,7 @@ void BackendsTest::cleanup()
QVERIFY(m_serverProcess->waitForFinished());
}
}
+#endif
delete m_localSocket;
m_localSocket = nullptr;
@@ -353,8 +361,10 @@ void BackendsTest::testReconnect()
QVERIFY(disconnectSpy.isValid());
QVERIFY(zonedDisconnectSpy.isValid());
+#if QT_CONFIG(process)
m_serverProcess->kill();
m_serverProcess->waitForFinished();
+#endif
WAIT_AND_COMPARE(disconnectSpy, 1);
QCOMPARE(client.error(), QIfAbstractFeature::Unknown);
diff --git a/tests/auto/core/ifcodegen/backends/test/tst_backends.h b/tests/auto/core/ifcodegen/backends/test/tst_backends.h
index 4411001e..a2d745f4 100644
--- a/tests/auto/core/ifcodegen/backends/test/tst_backends.h
+++ b/tests/auto/core/ifcodegen/backends/test/tst_backends.h
@@ -43,7 +43,9 @@ private slots:
void testRemoteObjectsConfig();
private:
+#if QT_CONFIG(process)
QProcess *m_serverProcess;
+#endif
QLocalServer *m_localServer;
QLocalSocket *m_localSocket;
bool m_isSimulation;
diff --git a/tests/auto/core/ifcodegen/flat-cmake-hierarchy-test/CMakeLists.txt b/tests/auto/core/ifcodegen/flat-cmake-hierarchy-test/CMakeLists.txt
index 64fbe818..9bbfefda 100644
--- a/tests/auto/core/ifcodegen/flat-cmake-hierarchy-test/CMakeLists.txt
+++ b/tests/auto/core/ifcodegen/flat-cmake-hierarchy-test/CMakeLists.txt
@@ -41,6 +41,7 @@ qt_internal_add_test(tst_flat-cmake-hierarchy
${CMAKE_CURRENT_BINARY_DIR}/cmake_dummy.cpp
LIBRARIES
echo_flat_frontend
+ NO_BATCH
)
# Interface Framework Generator:
diff --git a/tests/auto/core/ifcodegen/include-test/test/CMakeLists.txt b/tests/auto/core/ifcodegen/include-test/test/CMakeLists.txt
index 8019eeab..26b57dac 100644
--- a/tests/auto/core/ifcodegen/include-test/test/CMakeLists.txt
+++ b/tests/auto/core/ifcodegen/include-test/test/CMakeLists.txt
@@ -13,6 +13,7 @@ qt_internal_add_test(tst_qface_include
LIBRARIES
include_test_common
include_test_frontend
+ NO_BATCH
)
set_target_properties(tst_qface_include PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../)
diff --git a/tests/auto/core/ifcodegen/org-example-echo-noanno/test/CMakeLists.txt b/tests/auto/core/ifcodegen/org-example-echo-noanno/test/CMakeLists.txt
index 4d2d6771..3c16d12e 100644
--- a/tests/auto/core/ifcodegen/org-example-echo-noanno/test/CMakeLists.txt
+++ b/tests/auto/core/ifcodegen/org-example-echo-noanno/test/CMakeLists.txt
@@ -12,6 +12,7 @@ qt_internal_add_test(tst_org-example-echo-noanno
${CMAKE_CURRENT_BINARY_DIR}/cmake_dummy.cpp
LIBRARIES
echo_noanno_frontend
+ NO_BATCH
)
set_target_properties(tst_org-example-echo-noanno PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../)
diff --git a/tests/auto/core/ifcodegen/org-example-echo-noprivate/test/CMakeLists.txt b/tests/auto/core/ifcodegen/org-example-echo-noprivate/test/CMakeLists.txt
index 40e0df63..f703a677 100644
--- a/tests/auto/core/ifcodegen/org-example-echo-noprivate/test/CMakeLists.txt
+++ b/tests/auto/core/ifcodegen/org-example-echo-noprivate/test/CMakeLists.txt
@@ -12,6 +12,7 @@ qt_internal_add_test(tst_org-example-echo-noprivate
${CMAKE_CURRENT_BINARY_DIR}/cmake_dummy.cpp
LIBRARIES
echo_noprivate_frontend
+ NO_BATCH
)
set_target_properties(tst_org-example-echo-noprivate PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../)
diff --git a/tests/auto/core/ifcodegen/org-example-echo/test/CMakeLists.txt b/tests/auto/core/ifcodegen/org-example-echo/test/CMakeLists.txt
index 15beba55..dbaa0d3c 100644
--- a/tests/auto/core/ifcodegen/org-example-echo/test/CMakeLists.txt
+++ b/tests/auto/core/ifcodegen/org-example-echo/test/CMakeLists.txt
@@ -12,6 +12,7 @@ qt_internal_add_test(tst_org-example-echo
${CMAKE_CURRENT_BINARY_DIR}/cmake_dummy.cpp
LIBRARIES
echo_frontend
+ NO_BATCH
)
set_target_properties(tst_org-example-echo PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../)
diff --git a/tests/auto/core/qifabstractfeature/CMakeLists.txt b/tests/auto/core/qifabstractfeature/CMakeLists.txt
index aa9a8a06..75b02531 100644
--- a/tests/auto/core/qifabstractfeature/CMakeLists.txt
+++ b/tests/auto/core/qifabstractfeature/CMakeLists.txt
@@ -18,4 +18,5 @@ qt_internal_add_test(tst_qifabstractfeature
Qt::InterfaceFrameworkPrivate
Qt::Qml
TESTDATA ${test_data}
+ NO_BATCH
)
diff --git a/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp b/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp
index 80c63541..fcfefe95 100644
--- a/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp
+++ b/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp
@@ -13,12 +13,12 @@
#include <qifabstractfeaturelistmodel.h>
#include <qifservicemanager.h>
-class TestFeature : public QIfAbstractFeature
+class ConfigTestFeature : public QIfAbstractFeature
{
Q_OBJECT
public:
- TestFeature(QObject *parent = nullptr)
+ ConfigTestFeature(QObject *parent = nullptr)
: QIfAbstractFeature("testFeature", parent)
{}
@@ -32,12 +32,12 @@ public:
}
};
-class TestFeatureListModel : public QIfAbstractFeatureListModel
+class ConfigTestFeatureListModel : public QIfAbstractFeatureListModel
{
Q_OBJECT
public:
- TestFeatureListModel(QObject *parent = nullptr)
+ ConfigTestFeatureListModel(QObject *parent = nullptr)
: QIfAbstractFeatureListModel("testFeature", parent)
{}
@@ -64,13 +64,13 @@ public:
}
};
-class TestBackend : public QObject, public QIfServiceInterface
+class ConfigTestBackend : public QObject, public QIfServiceInterface
{
Q_OBJECT
Q_INTERFACES(QIfServiceInterface)
public:
- TestBackend(QObject *parent = nullptr)
+ ConfigTestBackend(QObject *parent = nullptr)
: QObject(parent)
{}
@@ -167,7 +167,7 @@ void tst_QIfConfiguration::invalidConfiguration()
QVERIFY(!configuration.setSimulationDataFile("foo"));
QTest::ignoreMessage(QtWarningMsg, "Configuration Object is not usable until the name has been configured");
QVERIFY(!configuration.setPreferredBackends({"backend"}));
- TestBackend backend;
+ ConfigTestBackend backend;
QIfProxyServiceObject serviceObject(&backend);
QTest::ignoreMessage(QtWarningMsg, "Configuration Object is not usable until the name has been configured");
QVERIFY(!configuration.setServiceObject(&serviceObject));
@@ -365,7 +365,7 @@ void tst_QIfConfiguration::discoveryMode()
void tst_QIfConfiguration::serviceObject()
{
// call static setter
- TestBackend backend;
+ ConfigTestBackend backend;
QIfProxyServiceObject serviceObject(&backend);
QVERIFY(QIfConfiguration::setServiceObject("staticGroup", &serviceObject));
QVERIFY(QIfConfiguration::exists("staticGroup"));
@@ -387,7 +387,7 @@ void tst_QIfConfiguration::serviceObject()
// Test the change signal
QSignalSpy spy(&config, &QIfConfiguration::serviceObjectChanged);
QVERIFY(spy.isValid());
- TestBackend backend2;
+ ConfigTestBackend backend2;
QIfProxyServiceObject serviceObject2(&backend2);
QVERIFY(config.setServiceObject(&serviceObject2));
QCOMPARE(config.serviceObject(), &serviceObject2);
@@ -518,7 +518,7 @@ template <class T> void tst_QIfConfiguration::testFeatureHelper()
QCOMPARE(testFeature->discoveryMode(), QIfAbstractFeature::LoadOnlyProductionBackends);
QCOMPARE(discoverySpy.count(), 1);
- TestBackend backend;
+ ConfigTestBackend backend;
QIfProxyServiceObject serviceObject(&backend);
QSignalSpy serviceObjectSpy(testFeature, &T::serviceObjectChanged);
QVERIFY(QIfConfiguration::setServiceObject("config1", &serviceObject));
@@ -547,17 +547,17 @@ template <class T> void tst_QIfConfiguration::testFeatureHelper()
void tst_QIfConfiguration::testFeature()
{
- testFeatureHelper<TestFeature>();
+ testFeatureHelper<ConfigTestFeature>();
cleanup();
- testFeatureHelper<TestFeatureListModel>();
+ testFeatureHelper<ConfigTestFeatureListModel>();
}
void tst_QIfConfiguration::testServiceObjects()
{
- auto backend = new TestBackend;
+ auto backend = new ConfigTestBackend;
QIfServiceManager::instance()->registerService(backend, QStringList({"testFeature"}));
- std::unique_ptr<TestFeature> testFeature(new TestFeature);
+ std::unique_ptr<ConfigTestFeature> testFeature(new ConfigTestFeature);
testFeature->startAutoDiscovery();
QVERIFY(testFeature->serviceObject());
@@ -571,9 +571,9 @@ void tst_QIfConfiguration::testServiceObjects()
QIfServiceManager::instance()->unloadAllBackends();
- auto backend2 = new TestBackend;
+ auto backend2 = new ConfigTestBackend;
QIfServiceManager::instance()->registerService(backend2, QStringList({"testFeature"}));
- auto testFeature2 = new TestFeature;
+ auto testFeature2 = new ConfigTestFeature;
testFeature2->startAutoDiscovery();
QVERIFY(testFeature2->serviceObject());
@@ -623,9 +623,9 @@ void tst_QIfConfiguration::duplicateConfigurationQML()
void tst_QIfConfiguration::updateValuesQML()
{
- TestBackend backend1;
+ ConfigTestBackend backend1;
QIfProxyServiceObject serviceObject1(&backend1);
- TestBackend backend2;
+ ConfigTestBackend backend2;
QIfProxyServiceObject serviceObject2(&backend2);
QQmlApplicationEngine engine;
diff --git a/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp b/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp
index c9668684..2dd21d9e 100644
--- a/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp
+++ b/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp
@@ -50,7 +50,7 @@ bool operator>(const QVariant &left, const QVariant &right)
QT_END_NAMESPACE
-class TestBackend : public QIfFilterAndBrowseModelInterface
+class FilterTestBackend : public QIfFilterAndBrowseModelInterface
{
Q_OBJECT
@@ -351,7 +351,7 @@ public:
explicit TestServiceObject(QObject *parent = nullptr) :
QIfServiceObject(parent)
{
- m_backend = new TestBackend;
+ m_backend = new FilterTestBackend;
m_backend->setParent(this);
m_interfaces << QIfFilterAndBrowseModel_iid;
}
@@ -365,23 +365,16 @@ public:
return 0;
}
- TestBackend *testBackend() const
+ FilterTestBackend *testBackend() const
{
return m_backend;
}
private:
QStringList m_interfaces;
- TestBackend *m_backend;
+ FilterTestBackend *m_backend;
};
-void verifyQml(QQmlEngine *engine, const QByteArray &qml)
-{
- QQmlComponent component(engine);
- component.setData(qml, QUrl());
- QScopedPointer<QObject> obj(component.create());
- QVERIFY2(obj, qPrintable(component.errorString()));
-}
class tst_QIfFilterAndBrowseModel : public QObject
{
@@ -389,6 +382,7 @@ class tst_QIfFilterAndBrowseModel : public QObject
public:
tst_QIfFilterAndBrowseModel();
+ void verifyQml(QQmlEngine *engine, const QByteArray &qml);
private Q_SLOTS:
void cleanup();
@@ -423,6 +417,14 @@ tst_QIfFilterAndBrowseModel::tst_QIfFilterAndBrowseModel()\
{
}
+void tst_QIfFilterAndBrowseModel::verifyQml(QQmlEngine *engine, const QByteArray &qml)
+{
+ QQmlComponent component(engine);
+ component.setData(qml, QUrl());
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY2(obj, qPrintable(component.errorString()));
+}
+
void tst_QIfFilterAndBrowseModel::cleanup()
{
manager->unloadAllBackends();
diff --git a/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp b/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp
index 4c02ec4a..55f25980 100644
--- a/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp
+++ b/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp
@@ -19,12 +19,12 @@
//TODO Add test with multiple model instances, requesting different data at the same time
//TODO Test the signal without a valid identifier
-class TestGadget
+class PagingTestGadget
{
Q_GADGET
};
-class TestBackend : public QIfPagingModelInterface
+class PagingTestBackend : public QIfPagingModelInterface
{
Q_OBJECT
@@ -61,7 +61,7 @@ public:
{
m_list.append(QVariant());
m_list.append(QVariant("string"));
- m_list.append(QVariant::fromValue(TestGadget()));
+ m_list.append(QVariant::fromValue(PagingTestGadget()));
}
void initialize() override
@@ -132,15 +132,15 @@ private:
QtInterfaceFrameworkModule::ModelCapabilities m_caps;
};
-class TestServiceObject : public QIfServiceObject
+class PagingTestServiceObject : public QIfServiceObject
{
Q_OBJECT
public:
- explicit TestServiceObject(QObject *parent = nullptr) :
+ explicit PagingTestServiceObject(QObject *parent = nullptr) :
QIfServiceObject(parent)
{
- m_backend = new TestBackend;
+ m_backend = new PagingTestBackend;
m_backend->setParent(this);
m_interfaces << QIfPagingModel_iid;
}
@@ -154,14 +154,14 @@ public:
return 0;
}
- TestBackend *testBackend() const
+ PagingTestBackend *testBackend() const
{
return m_backend;
}
private:
QStringList m_interfaces;
- TestBackend *m_backend;
+ PagingTestBackend *m_backend;
};
void verifyQml(QQmlEngine *engine, const QByteArray &qml)
@@ -212,7 +212,7 @@ void tst_QIfPagingModel::cleanup()
void tst_QIfPagingModel::testClearServiceObject()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
service->testBackend()->setCapabilities(QtInterfaceFrameworkModule::SupportsGetSize);
@@ -252,7 +252,7 @@ void tst_QIfPagingModel::testClearServiceObject()
void tst_QIfPagingModel::testRegisterInstance()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
@@ -283,7 +283,7 @@ void tst_QIfPagingModel::testRegisterInstance()
void tst_QIfPagingModel::testBasic_qml()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
@@ -297,7 +297,7 @@ void tst_QIfPagingModel::testBasic_qml()
void tst_QIfPagingModel::testBrokenData()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeBrokenData();
@@ -316,7 +316,7 @@ void tst_QIfPagingModel::testBrokenData()
void tst_QIfPagingModel::testGetAt()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
@@ -344,7 +344,7 @@ void tst_QIfPagingModel::testFetchMore()
QFETCH(int, chunkSize);
QFETCH(int, fetchMoreThreshold);
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
@@ -403,7 +403,7 @@ void tst_QIfPagingModel::testFetchMore()
void tst_QIfPagingModel::testDataChangedMode()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->setCapabilities(QtInterfaceFrameworkModule::SupportsGetSize);
service->testBackend()->initializeSimpleData();
@@ -443,7 +443,7 @@ void tst_QIfPagingModel::testDataChangedMode()
void tst_QIfPagingModel::testReload()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->setCapabilities(QtInterfaceFrameworkModule::SupportsGetSize);
service->testBackend()->initializeSimpleData();
@@ -469,7 +469,7 @@ void tst_QIfPagingModel::testReload()
void tst_QIfPagingModel::testDataChangedMode_jump()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->setCapabilities(QtInterfaceFrameworkModule::SupportsGetSize);
service->testBackend()->initializeSimpleData();
@@ -503,7 +503,7 @@ void tst_QIfPagingModel::testDataChangedMode_jump()
void tst_QIfPagingModel::testEditing()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
@@ -546,7 +546,7 @@ void tst_QIfPagingModel::testEditing()
void tst_QIfPagingModel::testMissingCapabilities()
{
- TestServiceObject *service = new TestServiceObject();
+ PagingTestServiceObject *service = new PagingTestServiceObject();
manager->registerService(service, service->interfaces());
service->testBackend()->initializeSimpleData();
diff --git a/tests/auto/core/qifsimulationengine/FunctionTest.qml b/tests/auto/core/qifsimulationengine/FunctionTest.qml
index 218472bd..c8b8bdcd 100644
--- a/tests/auto/core/qifsimulationengine/FunctionTest.qml
+++ b/tests/auto/core/qifsimulationengine/FunctionTest.qml
@@ -1,7 +1,7 @@
import QtQuick;
import TestAPI;
-SimpleAPI {
+SimpleTestAPI {
function simpleFunction() {
simpleFunctionCalled();
}
diff --git a/tests/auto/core/qifsimulationengine/tst_qifsimulationengine.cpp b/tests/auto/core/qifsimulationengine/tst_qifsimulationengine.cpp
index ab78c1c5..aaaa2804 100644
--- a/tests/auto/core/qifsimulationengine/tst_qifsimulationengine.cpp
+++ b/tests/auto/core/qifsimulationengine/tst_qifsimulationengine.cpp
@@ -111,7 +111,7 @@ private:
bool m_complexPropertyInDerived = false;
};
-class SimpleAPI: public QObject
+class SimpleTestAPI: public QObject
{
Q_OBJECT
Q_PROPERTY(int testProperty READ testProperty WRITE setTestProperty NOTIFY testPropertyChanged)
@@ -122,7 +122,7 @@ public:
public slots:
void setTestProperty(int testProperty)
{
- QIF_SIMULATION_TRY_CALL(SimpleAPI, "setTestProperty", void, testProperty)
+ QIF_SIMULATION_TRY_CALL(SimpleTestAPI, "setTestProperty", void, testProperty)
m_callCounter++;
if (m_testProperty == testProperty)
@@ -134,7 +134,7 @@ public slots:
void simpleFunction()
{
- QIF_SIMULATION_TRY_CALL(SimpleAPI, "simpleFunction", void)
+ QIF_SIMULATION_TRY_CALL(SimpleTestAPI, "simpleFunction", void)
m_callCounter++;
emit simpleFunctionCalled();
@@ -142,7 +142,7 @@ public slots:
void functionWithArguments(int intArgument, const QString &stringArgument)
{
- QIF_SIMULATION_TRY_CALL(SimpleAPI, "functionWithArguments", void, intArgument, stringArgument)
+ QIF_SIMULATION_TRY_CALL(SimpleTestAPI, "functionWithArguments", void, intArgument, stringArgument)
m_callCounter++;
emit functionWithArgumentsCalled(intArgument, stringArgument);
@@ -150,7 +150,7 @@ public slots:
int functionWithReturnValue(int intArgument)
{
- QIF_SIMULATION_TRY_CALL(SimpleAPI, "functionWithReturnValue", int, intArgument)
+ QIF_SIMULATION_TRY_CALL(SimpleTestAPI, "functionWithReturnValue", int, intArgument)
m_callCounter++;
emit functionWithReturnValueCalled(intArgument);
@@ -182,14 +182,6 @@ public:
int m_testProperty = -1;
};
-void verifyQml(QQmlEngine *engine, const QByteArray &qml)
-{
- QQmlComponent component(engine);
- component.setData(qml, QUrl());
- QScopedPointer<QObject> obj(component.create());
- QVERIFY2(obj, qPrintable(component.errorString()));
-}
-
QVariant callTestFunction(QObject* object, const QByteArray &function, QVariantList &expectedValues, const QVariant &returnValue, const QVariant &value1, const QVariant &value2)
{
//call the testfunction
@@ -219,6 +211,7 @@ class tst_QIfSimulationEngine : public QObject
Q_OBJECT
QVariant parseJson(const QString &json, QString &error) const;
+ void verifyQml(QQmlEngine *engine, const QByteArray &qml);
private Q_SLOTS:
void testUsageInCorrectEngine();
@@ -265,6 +258,14 @@ QVariant tst_QIfSimulationEngine::parseJson(const QString &json, QString& error)
return data;
}
+void tst_QIfSimulationEngine::verifyQml(QQmlEngine *engine, const QByteArray &qml)
+{
+ QQmlComponent component(engine);
+ component.setData(qml, QUrl());
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY2(obj, qPrintable(component.errorString()));
+}
+
void tst_QIfSimulationEngine::testUsageInCorrectEngine()
{
QIfSimulationEngine engine;
@@ -648,13 +649,13 @@ void tst_QIfSimulationEngine::testSignals()
{
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
QByteArray qml ("import QtQuick; \n\
import TestAPI; \n\
Item { \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
onTestPropertyChanged: { \n\
somethingHappened('test') \n\
otherSignal('test') \n\
@@ -703,12 +704,12 @@ void tst_QIfSimulationEngine::testFunctionCalls()
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
QByteArray qml ("import QtQuick; \n\
import TestAPI; \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
}");
QQmlComponent component(&engine);
@@ -756,12 +757,12 @@ void tst_QIfSimulationEngine::testFunctionOverride()
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
QByteArray qml ("import QtQuick; \n\
import TestAPI; \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
function simpleFunction() { \n\
simpleFunctionCalled(); \n\
} \n\
@@ -801,8 +802,8 @@ void tst_QIfSimulationEngine::testFunctionWithInheritance()
{
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
engine.loadSimulation(QUrl("qrc:/FunctionTestMain.qml"));
@@ -852,12 +853,12 @@ void tst_QIfSimulationEngine::testCallingBaseFunction()
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
QByteArray qml ("import QtQuick; \n\
import TestAPI; \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
function simpleFunction() { \n\
simpleFunctionCalled(); \n\
Base.simpleFunction(); \n\
@@ -901,12 +902,12 @@ void tst_QIfSimulationEngine::testRecursionPrevention()
{
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
QByteArray qml ("import QtQuick; \n\
import TestAPI; \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
function setTestProperty(value) { \n\
testProperty = value \n\
} \n\
@@ -938,15 +939,15 @@ void tst_QIfSimulationEngine::testMultipleInstances()
{
QIfSimulationEngine engine;
- SimpleAPI testObject;
- engine.registerSimulationInstance<SimpleAPI>(&testObject, "TestAPI", 1, 0, "SimpleAPI");
+ SimpleTestAPI testObject;
+ engine.registerSimulationInstance<SimpleTestAPI>(&testObject, "TestAPI", 1, 0, "SimpleTestAPI");
QByteArray qml ("import QtQuick; \n\
import TestAPI; \n\
Item { \n\
signal firstInstanceCalled(); \n\
signal secondInstanceCalled(); \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
function simpleFunction() { \n\
simpleFunctionCalled(); \n\
firstInstanceCalled(); \n\
@@ -957,7 +958,7 @@ void tst_QIfSimulationEngine::testMultipleInstances()
return intArgument; \n\
} \n\
} \n\
- SimpleAPI { \n\
+ SimpleTestAPI { \n\
function functionWithArguments(intArgument, stringArgument) { \n\
functionWithArgumentsCalled(intArgument, stringArgument); \n\
secondInstanceCalled(); \n\