summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2013-11-07 15:37:30 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-18 15:00:55 +0100
commit380cfc951baa3c0405bd32cdefdd3300619d2c32 (patch)
tree2936e747e20af59daa8d4c06f104e7c369156bc6 /tests/auto
parent7619a5e070e1fe2e2af2ec60dfea1a7ef87f5894 (diff)
downloadqtenginio-380cfc951baa3c0405bd32cdefdd3300619d2c32.tar.gz
Add tests for EnginioModel::enginioChanged signal.
Change-Id: I438edd9bba4c8405fff4cde5b496b274c1497f0a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/enginiomodel/tst_enginiomodel.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/enginiomodel/tst_enginiomodel.cpp b/tests/auto/enginiomodel/tst_enginiomodel.cpp
index 1822d1e..cfb96ad 100644
--- a/tests/auto/enginiomodel/tst_enginiomodel.cpp
+++ b/tests/auto/enginiomodel/tst_enginiomodel.cpp
@@ -231,6 +231,22 @@ void tst_EnginioModel::enginio_property()
QTRY_COMPARE(spyAboutToReset.count(), 1);
QTRY_COMPARE(spyReset.count(), 1);
}
+ {
+ // check if assigning the same enginio is not emitting the changed signal
+ EnginioClient client;
+ EnginioModel model;
+
+ QSignalSpy clientSpy(&model, SIGNAL(enginioChanged(EnginioClient*)));
+ QCOMPARE(model.enginio(), (EnginioClient *)0);
+
+ model.setEnginio(&client);
+ QCOMPARE(clientSpy.count(), 1);
+ QCOMPARE(clientSpy[0][0].value<EnginioClient*>(), &client);
+ QCOMPARE(model.enginio(), &client);
+
+ model.setEnginio(&client);
+ QCOMPARE(clientSpy.count(), 1);
+ }
}
void tst_EnginioModel::query_property()