aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-12-27 10:50:43 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-27 11:04:14 -0800
commit2db4cbcc437f51f5dac82cc4de46f383b92e6f11 (patch)
treeeee83b2daf5af4d4a9478d3b47b1866d140a47c8 /src/test
parent7aa700424cbda387536373d8dfec88aee43f950e (diff)
parent2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1 (diff)
Merge #9349: Make CScript (and prevector) c++11 movable.
2ddfcfd Make CScript (and prevector) c++11 movable. (Pieter Wuille)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/prevector_tests.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/test/prevector_tests.cpp b/src/test/prevector_tests.cpp
index 1e5de2021c..1352ea722a 100644
--- a/src/test/prevector_tests.cpp
+++ b/src/test/prevector_tests.cpp
@@ -169,6 +169,19 @@ public:
pre_vector.swap(pre_vector_alt);
test();
}
+
+ void move() {
+ real_vector = std::move(real_vector_alt);
+ real_vector_alt.clear();
+ pre_vector = std::move(pre_vector_alt);
+ pre_vector_alt.clear();
+ }
+
+ void copy() {
+ real_vector = real_vector_alt;
+ pre_vector = pre_vector_alt;
+ }
+
~prevector_tester() {
BOOST_CHECK_MESSAGE(passed, "insecure_rand_Rz: "
<< rand_cache.Rz
@@ -240,9 +253,15 @@ BOOST_AUTO_TEST_CASE(PrevectorTestInt)
if (((r >> 21) % 512) == 12) {
test.assign(insecure_rand() % 32, insecure_rand());
}
- if (((r >> 15) % 64) == 3) {
+ if (((r >> 15) % 8) == 3) {
test.swap();
}
+ if (((r >> 15) % 16) == 8) {
+ test.copy();
+ }
+ if (((r >> 15) % 32) == 18) {
+ test.move();
+ }
}
}
}