Skip to content

Commit f3c9c40

Browse files
author
MarcoFalke
committed
Merge #13545: tests: Fix test case streams_serializedata_xor. Remove Boost dependency.
962d8ee Remove boost dependency (boost/assign/std/vector.hpp) (practicalswift) c6fd0df Fix incorrect tests (practicalswift) Pull request description: * Fix test case `streams_serializedata_xor`. * Remove Boost dependency. Tree-SHA512: 609c4ced1b6a8b86f6a37e4220535f1b3c9f2e80949cd034ecc069a94c55c05cd514f2e132fe7f715161ee29811a0fadb6903635c507411d8dc3e7efe864edeb
2 parents 90990d2 + 962d8ee commit f3c9c40

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/test/streams_tests.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
#include <support/allocators/zeroafterfree.h>
77
#include <test/test_bitcoin.h>
88

9-
#include <boost/assign/std/vector.hpp> // for 'operator+=()'
109
#include <boost/test/unit_test.hpp>
1110

12-
using namespace boost::assign; // bring 'operator+=()' into scope
13-
1411
BOOST_FIXTURE_TEST_SUITE(streams_tests, BasicTestingSetup)
1512

1613
BOOST_AUTO_TEST_CASE(streams_vector_writer)
@@ -80,22 +77,25 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
8077

8178
// Degenerate case
8279

83-
key += '\x00','\x00';
80+
key.push_back('\x00');
81+
key.push_back('\x00');
8482
ds.Xor(key);
8583
BOOST_CHECK_EQUAL(
8684
std::string(expected_xor.begin(), expected_xor.end()),
8785
std::string(ds.begin(), ds.end()));
8886

89-
in += '\x0f','\xf0';
90-
expected_xor += '\xf0','\x0f';
87+
in.push_back('\x0f');
88+
in.push_back('\xf0');
89+
expected_xor.push_back('\xf0');
90+
expected_xor.push_back('\x0f');
9191

9292
// Single character key
9393

9494
ds.clear();
9595
ds.insert(ds.begin(), in.begin(), in.end());
9696
key.clear();
9797

98-
key += '\xff';
98+
key.push_back('\xff');
9999
ds.Xor(key);
100100
BOOST_CHECK_EQUAL(
101101
std::string(expected_xor.begin(), expected_xor.end()),
@@ -105,14 +105,17 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
105105

106106
in.clear();
107107
expected_xor.clear();
108-
in += '\xf0','\x0f';
109-
expected_xor += '\x0f','\x00';
108+
in.push_back('\xf0');
109+
in.push_back('\x0f');
110+
expected_xor.push_back('\x0f');
111+
expected_xor.push_back('\x00');
110112

111113
ds.clear();
112114
ds.insert(ds.begin(), in.begin(), in.end());
113115

114116
key.clear();
115-
key += '\xff','\x0f';
117+
key.push_back('\xff');
118+
key.push_back('\x0f');
116119

117120
ds.Xor(key);
118121
BOOST_CHECK_EQUAL(

test/lint/lint-includes.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ EXPECTED_BOOST_INCLUDES=(
5353
boost/algorithm/string/predicate.hpp
5454
boost/algorithm/string/replace.hpp
5555
boost/algorithm/string/split.hpp
56-
boost/assign/std/vector.hpp
5756
boost/bind.hpp
5857
boost/chrono/chrono.hpp
5958
boost/date_time/posix_time/posix_time.hpp

0 commit comments

Comments
 (0)