diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index 49827be559..ec4ffbfb7c 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -85,6 +85,8 @@ BOOST_AUTO_TEST_CASE(sizes) BOOST_CHECK_EQUAL(GetSerializeSize(int64_t(0), 0), 8U); BOOST_CHECK_EQUAL(GetSerializeSize(uint64_t(0), 0), 8U); BOOST_CHECK_EQUAL(GetSerializeSize(bool(0), 0), 1U); + BOOST_CHECK_EQUAL(GetSerializeSize(std::array{0}, 0), 1U); + BOOST_CHECK_EQUAL(GetSerializeSize(std::array{0, 0}, 0), 2U); } BOOST_AUTO_TEST_CASE(varints) @@ -179,6 +181,16 @@ BOOST_AUTO_TEST_CASE(vector_bool) BOOST_CHECK((HashWriter{} << vec1).GetHash() == (HashWriter{} << vec2).GetHash()); } +BOOST_AUTO_TEST_CASE(array) +{ + std::array array1{1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1}; + DataStream ds; + ds << array1; + std::array array2; + ds >> array2; + BOOST_CHECK(array1 == array2); +} + BOOST_AUTO_TEST_CASE(noncanonical) { // Write some non-canonical CompactSize encodings, and