diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-06-21 10:13:08 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-06-27 10:13:29 +0200 |
commit | fa257bc8312b91c2d281f48ca2500d9cba353cc5 (patch) | |
tree | d4d5c6c16128273515ab9031ea54bbf0d5b0e24a /src/test/serialize_tests.cpp | |
parent | 679f825ba3aae45af4476f357a67f8e6ec9483e2 (diff) |
util: Allow std::byte and char Span serialization
Diffstat (limited to 'src/test/serialize_tests.cpp')
-rw-r--r-- | src/test/serialize_tests.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index 09f77d2b61..88543a8aef 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -241,6 +241,15 @@ BOOST_AUTO_TEST_CASE(class_methods) ss2 << intval << boolval << stringval << charstrval << txval; ss2 >> methodtest3; BOOST_CHECK(methodtest3 == methodtest4); + { + DataStream ds; + const std::string in{"ab"}; + ds << Span{in}; + std::array<std::byte, 2> out; + ds >> Span{out}; + BOOST_CHECK_EQUAL(out.at(0), std::byte{'a'}); + BOOST_CHECK_EQUAL(out.at(1), std::byte{'b'}); + } } BOOST_AUTO_TEST_SUITE_END() |