summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-28 10:00:46 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-29 12:31:31 -0800
commit7046bb4f82e8c63a12d85ac8e22e83b346747e9c (patch)
tree09c5fd9dbc088b22df83974dbae7f1b76dc1151a /tests
parent18fe7b8e9ab0e6e3cba1b50c73e22b6b100696ff (diff)
downloadsubsurface-7046bb4f82e8c63a12d85ac8e22e83b346747e9c.tar.gz
tests: fix TestQPrefEquipment
When we actually change the value, the argument to the changed signal should be true, not false. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testqPrefEquipment.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/testqPrefEquipment.cpp b/tests/testqPrefEquipment.cpp
index 29d1baccb..2d165943e 100644
--- a/tests/testqPrefEquipment.cpp
+++ b/tests/testqPrefEquipment.cpp
@@ -93,12 +93,18 @@ void TestQPrefEquipment::test_oldPreferences()
void TestQPrefEquipment::test_signals()
{
+ qPrefEquipment::set_default_cylinder("signal test");
QSignalSpy spy1(qPrefEquipment::instance(), &qPrefEquipment::default_cylinderChanged);
QSignalSpy spy2(qPrefEquipment::instance(), &qPrefEquipment::display_unused_tanksChanged);
- qPrefEquipment::set_default_cylinder("new base21");
+ // set default cylinder to same value it already had
+ qPrefEquipment::set_default_cylinder("signal test");
+ QCOMPARE(spy1.count(), 0);
+
+ // change default cylinder to different value
+ qPrefEquipment::set_default_cylinder("different value");
QCOMPARE(spy1.count(), 1);
- QVERIFY(spy1.takeFirst().at(0).toBool() == false);
+ QVERIFY(spy1.takeFirst().at(0).toBool() == true);
prefs.display_unused_tanks = true;
qPrefEquipment::set_display_unused_tanks(false);