Commit 0ed3434 1 parent a39e6c1 commit 0ed3434 Copy full SHA for 0ed3434
File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 2
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
+ #include < init.h>
5
6
#include < qt/bitcoin.h>
6
7
#include < qt/test/optiontests.h>
7
8
#include < test/util/setup_common.h>
@@ -29,3 +30,32 @@ void OptionTests::optionTests()
29
30
});
30
31
gArgs .WriteSettingsFile ();
31
32
}
33
+
34
+ void OptionTests::parametersInteraction ()
35
+ {
36
+ gArgs .LockSettings ([&](util::Settings& s) {
37
+ s.forced_settings .erase (" listen" );
38
+ s.forced_settings .erase (" listenonion" );
39
+ });
40
+ QVERIFY (!gArgs .IsArgSet (" -listen" ));
41
+ QVERIFY (!gArgs .IsArgSet (" -listenonion" ));
42
+
43
+ QSettings settings;
44
+ settings.setValue (" fListen" , false );
45
+
46
+ OptionsModel{};
47
+
48
+ const bool expected{false };
49
+
50
+ QVERIFY (gArgs .IsArgSet (" -listen" ));
51
+ QCOMPARE (gArgs .GetBoolArg (" -listen" , !expected), expected);
52
+
53
+ QVERIFY (gArgs .IsArgSet (" -listenonion" ));
54
+ QCOMPARE (gArgs .GetBoolArg (" -listenonion" , !expected), expected);
55
+
56
+ QVERIFY (AppInitParameterInteraction (gArgs ));
57
+
58
+ // cleanup
59
+ settings.remove (" fListen" );
60
+ QVERIFY (!settings.contains (" fListen" ));
61
+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class OptionTests : public QObject
17
17
18
18
private Q_SLOTS:
19
19
void optionTests ();
20
+ void parametersInteraction ();
20
21
21
22
private:
22
23
interfaces::Node& m_node;
You can’t perform that action at this time.
0 commit comments