aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2018-08-28 11:57:38 +0200
committerWladimir J. van der Laan <[email protected]>2018-08-28 11:58:19 +0200
commit5f71eac6345c716b4e0b7506fd77ca0d119341d2 (patch)
tree142a976f1ff1e11805aa70a3857ffa53c20cbdad /src/test
parentBugfix: NSIS: Exclude Makefile* from docs (diff)
parentUse assert when running from multithreaded code as BOOST_CHECK_* are not thre... (diff)
downloaddiscoin-5f71eac6345c716b4e0b7506fd77ca0d119341d2.tar.xz
discoin-5f71eac6345c716b4e0b7506fd77ca0d119341d2.zip
Merge #14084: [0.17] qa: Backports
cf3d7f94c2efd15a9cb910ccee31505934d55641 Use assert when running from multithreaded code as BOOST_CHECK_* are not thread safe (Jesse Cohen) fab0fbefcf51f38aa858423017b545df6d098311 qa: Stop txindex thread before calling destructor (MarcoFalke) b5ec6d4bf8a8ca18ca520e2f484e3ddd2d1138a3 Docs: Fix help message typo optiona -> optional (Ben Woosley) Pull request description: Fixes to make the unit tests and bench pass with the thread sanitizer (beside the issue with fChecked https://github.com/bitcoin/bitcoin/issues/14058#issuecomment-416042917). For testing: `./configure --with-sanitizers=undefined,thread && make -j 16 && ./src/test/test_bitcoin` Tree-SHA512: 5cb85ecc278b719dba03240265e93424ed1a28671834da7590adab88c2d43c6e6cbf3269bbe2fd79e5ed3a85ec77a268e05301e7a7421cf6a97d413dddac6327
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scheduler_tests.cpp4
-rw-r--r--src/test/txindex_tests.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp
index 001d8eb64..2af0ab22d 100644
--- a/src/test/scheduler_tests.cpp
+++ b/src/test/scheduler_tests.cpp
@@ -138,11 +138,11 @@ BOOST_AUTO_TEST_CASE(singlethreadedscheduler_ordered)
// the callbacks should run in exactly the order in which they were enqueued
for (int i = 0; i < 100; ++i) {
queue1.AddToProcessQueue([i, &counter1]() {
- BOOST_CHECK_EQUAL(i, counter1++);
+ assert(i == counter1++);
});
queue2.AddToProcessQueue([i, &counter2]() {
- BOOST_CHECK_EQUAL(i, counter2++);
+ assert(i == counter2++);
});
}
diff --git a/src/test/txindex_tests.cpp b/src/test/txindex_tests.cpp
index be7ee2428..2a160b998 100644
--- a/src/test/txindex_tests.cpp
+++ b/src/test/txindex_tests.cpp
@@ -61,6 +61,8 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
BOOST_ERROR("Read incorrect tx");
}
}
+
+ txindex.Stop(); // Stop thread before calling destructor
}
BOOST_AUTO_TEST_SUITE_END()