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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

src/qt/test/test_main.cpp CHANGED
@@ -7,6 +7,7 @@
7
  #include <interfaces/init.h>
8
  #include <interfaces/node.h>
9
  #include <qt/bitcoin.h>
 
10
  #include <qt/guiconstants.h>
11
  #include <qt/test/apptests.h>
12
  #include <qt/test/optiontests.h>
@@ -24,6 +25,7 @@
24
  #include <QDebug>
25
  #include <QObject>
26
  #include <QSettings>
 
27
  #include <QTest>
28
 
29
  #include <functional>
@@ -78,6 +80,13 @@ int main(int argc, char* argv[])
78
  BitcoinApplication app;
79
  app.createNode(*init);
80
 
 
 
 
 
 
 
 
81
  AppTests app_tests(app);
82
  num_test_failures += QTest::qExec(&app_tests);
83
 
 
7
  #include <interfaces/init.h>
8
  #include <interfaces/node.h>
9
  #include <qt/bitcoin.h>
10
+ #include <qt/bitcoinunits.h>
11
  #include <qt/guiconstants.h>
12
  #include <qt/test/apptests.h>
13
  #include <qt/test/optiontests.h>
 
25
  #include <QDebug>
26
  #include <QObject>
27
  #include <QSettings>
28
+ #include <QString>
29
  #include <QTest>
30
 
31
  #include <functional>
 
80
  BitcoinApplication app;
81
  app.createNode(*init);
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
+
90
  AppTests app_tests(app);
91
  num_test_failures += QTest::qExec(&app_tests);
92