Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 9: [PATCH 09/17] fix(roots): restore audited portability and runtime behavior

src/qt/test/test_main.cpp

Before: src/qt/test/test_main.cpp · After: src/qt/test/test_main.cpp

File metadata
index a8015fb582f072fcaa1b9d0ca02cd6b93deea52f..8298d2c1f23cfc1f024a25b2ca048781e3ffc9d9 100644

Download original patch · Release notes

Diff rows 1–27 of 27. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/qt/test/test_main.cpp CHANGED
@@ -7,6 +7,7 @@
7
7
  #include <interfaces/init.h>
8
8
  #include <interfaces/node.h>
9
9
  #include <qt/bitcoin.h>
10
+ #include <qt/bitcoinunits.h>
10
11
  #include <qt/guiconstants.h>
11
12
  #include <qt/test/apptests.h>
12
13
  #include <qt/test/optiontests.h>
@@ -24,6 +25,7 @@
24
25
  #include <QDebug>
25
26
  #include <QObject>
26
27
  #include <QSettings>
28
+ #include <QString>
27
29
  #include <QTest>
28
30
 
29
31
  #include <functional>
@@ -78,6 +80,13 @@ int main(int argc, char* argv[])
78
80
  BitcoinApplication app;
79
81
  app.createNode(*init);
80
82
 
83
+ if (argc == 5 && QString::fromLocal8Bit(argv[1]) == "--test-display-unit-settings") {
84
+ bool valid{false};
85
+ const auto unit = static_cast<BitcoinUnit>(QString::fromLocal8Bit(argv[4]).toInt(&valid));
86
+ if (!valid || !BitcoinUnits::availableUnits().contains(unit)) return 2;
87
+ return RunDisplayUnitSettingsTest(app.node(), QString::fromLocal8Bit(argv[2]), QString::fromLocal8Bit(argv[3]), unit);
88
+ }
89
+
81
90
  AppTests app_tests(app);
82
91
  num_test_failures += QTest::qExec(&app_tests);
83
92