mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
18fe7b8e9a
commit
7046bb4f82
1 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue