aboutsummaryrefslogtreecommitdiff
path: root/src/test/streams_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/streams_tests.cpp')
-rw-r--r--src/test/streams_tests.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp
index 5d057108b1..8ca668ba01 100644
--- a/src/test/streams_tests.cpp
+++ b/src/test/streams_tests.cpp
@@ -6,11 +6,8 @@
#include <support/allocators/zeroafterfree.h>
#include <test/test_bitcoin.h>
-#include <boost/assign/std/vector.hpp> // for 'operator+=()'
#include <boost/test/unit_test.hpp>
-using namespace boost::assign; // bring 'operator+=()' into scope
-
BOOST_FIXTURE_TEST_SUITE(streams_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(streams_vector_writer)
@@ -79,45 +76,51 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
CDataStream ds(in, 0, 0);
// Degenerate case
-
- key += '\x00','\x00';
+
+ key.push_back('\x00');
+ key.push_back('\x00');
ds.Xor(key);
BOOST_CHECK_EQUAL(
- std::string(expected_xor.begin(), expected_xor.end()),
+ std::string(expected_xor.begin(), expected_xor.end()),
std::string(ds.begin(), ds.end()));
- in += '\x0f','\xf0';
- expected_xor += '\xf0','\x0f';
-
+ in.push_back('\x0f');
+ in.push_back('\xf0');
+ expected_xor.push_back('\xf0');
+ expected_xor.push_back('\x0f');
+
// Single character key
ds.clear();
ds.insert(ds.begin(), in.begin(), in.end());
key.clear();
- key += '\xff';
+ key.push_back('\xff');
ds.Xor(key);
BOOST_CHECK_EQUAL(
- std::string(expected_xor.begin(), expected_xor.end()),
- std::string(ds.begin(), ds.end()));
-
+ std::string(expected_xor.begin(), expected_xor.end()),
+ std::string(ds.begin(), ds.end()));
+
// Multi character key
in.clear();
expected_xor.clear();
- in += '\xf0','\x0f';
- expected_xor += '\x0f','\x00';
-
+ in.push_back('\xf0');
+ in.push_back('\x0f');
+ expected_xor.push_back('\x0f');
+ expected_xor.push_back('\x00');
+
ds.clear();
ds.insert(ds.begin(), in.begin(), in.end());
key.clear();
- key += '\xff','\x0f';
+ key.push_back('\xff');
+ key.push_back('\x0f');
ds.Xor(key);
BOOST_CHECK_EQUAL(
- std::string(expected_xor.begin(), expected_xor.end()),
- std::string(ds.begin(), ds.end()));
-}
+ std::string(expected_xor.begin(), expected_xor.end()),
+ std::string(ds.begin(), ds.end()));
+}
BOOST_AUTO_TEST_SUITE_END()