upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/selftest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/selftest.cpp')
-rw-r--r--src/selftest.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/selftest.cpp b/src/selftest.cpp
index feb4076..14bf45a 100644
--- a/src/selftest.cpp
+++ b/src/selftest.cpp
@@ -1298,6 +1298,19 @@ static int RunWalletSQLiteMigrationSelfTest()
1298 "load check: ok"), 1298 "load check: ok"),
1299 "SQLite wallet export passes the loader compatibility check") ? 0 : 1; 1299 "SQLite wallet export passes the loader compatibility check") ? 0 : 1;
1300 1300
1301 string strRuntimeOut = tmp + "/sqlite-runtime.txt";
1302 vector<string> vRuntimeArgs;
1303 vRuntimeArgs.push_back("-datadir=" + strWalletDir);
1304 vRuntimeArgs.push_back("-nomanagedtor");
1305 vRuntimeArgs.push_back("-nogui");
1306 vRuntimeArgs.push_back("-walletsqlite=" + strSQLite);
1307 int nRuntimeRet =
1308 RunBitflashChild(strExe, vRuntimeArgs, NULL, &strRuntimeOut);
1309 nFail += Check(nRuntimeRet == 0 &&
1310 FileContainsText(strRuntimeOut,
1311 "SQLite wallet loaded: read-only staging backend"),
1312 "SQLite wallet export loads through the runtime startup path") ? 0 : 1;
1313
1301 string strRestoredDir = tmp + "/restored-wallet"; 1314 string strRestoredDir = tmp + "/restored-wallet";
1302 nFail += Check(MakeDirLocal(strRestoredDir), 1315 nFail += Check(MakeDirLocal(strRestoredDir),
1303 "restored wallet directory can be created") ? 0 : 1; 1316 "restored wallet directory can be created") ? 0 : 1;
@@ -1372,6 +1385,22 @@ static int RunWalletSQLiteMigrationSelfTest()
1372 "load check: failed"), 1385 "load check: failed"),
1373 "SQLite wallet load check rejects future wallet formats") ? 0 : 1; 1386 "SQLite wallet load check rejects future wallet formats") ? 0 : 1;
1374 1387
1388 string strFutureRuntimeOut = tmp + "/sqlite-runtime-future.txt";
1389 vector<string> vFutureRuntimeArgs;
1390 vFutureRuntimeArgs.push_back("-datadir=" + strWalletDir);
1391 vFutureRuntimeArgs.push_back("-nomanagedtor");
1392 vFutureRuntimeArgs.push_back("-nogui");
1393 vFutureRuntimeArgs.push_back("-walletsqlite=" + strFutureSQLite);
1394 int nFutureRuntimeRet =
1395 RunBitflashChild(strExe, vFutureRuntimeArgs, NULL,
1396 &strFutureRuntimeOut);
1397 nFail += Check(nFutureRuntimeRet == 1 &&
1398 FileContainsText(strFutureRuntimeOut,
1399 "Cannot open SQLite wallet export") &&
1400 FileContainsText(strFutureRuntimeOut,
1401 "newer version of Bitflash"),
1402 "SQLite runtime startup rejects future wallet formats") ? 0 : 1;
1403
1375 string strOverwriteOut = tmp + "/sqlite-export-overwrite.txt"; 1404 string strOverwriteOut = tmp + "/sqlite-export-overwrite.txt";
1376 int nOverwriteRet = 1405 int nOverwriteRet =
1377 RunBitflashChild(strExe, vExportArgs, NULL, &strOverwriteOut); 1406 RunBitflashChild(strExe, vExportArgs, NULL, &strOverwriteOut);