From 7046bb4f82e8c63a12d85ac8e22e83b346747e9c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 28 Dec 2019 10:00:46 -0800 Subject: 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 --- tests/testqPrefEquipment.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3-70-g09d2