diff options
author | Lee Clagett <code@leeclagett.com> | 2020-10-13 15:09:18 +0000 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2020-10-13 15:09:18 +0000 |
commit | 249eae5f4aad8c90e4e0eae19268fbf74fe05783 (patch) | |
tree | fd4672980a4090fb666f8c003799cfff64537bf9 /tests/unit_tests/epee_utils.cpp | |
parent | Merge pull request #6927 (diff) | |
download | monero-249eae5f4aad8c90e4e0eae19268fbf74fe05783.tar.xz |
Allow byte_stream->byte_slice conversion to shrink unused buffer space
Diffstat (limited to '')
-rw-r--r-- | tests/unit_tests/epee_utils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unit_tests/epee_utils.cpp b/tests/unit_tests/epee_utils.cpp index b365cad86..0a1f0d3de 100644 --- a/tests/unit_tests/epee_utils.cpp +++ b/tests/unit_tests/epee_utils.cpp @@ -1090,11 +1090,13 @@ TEST(ByteStream, ToByteSlice) epee::byte_stream stream; + stream.reserve(128*1024); stream.write(source); EXPECT_EQ(sizeof(source), stream.size()); + EXPECT_EQ(128*1024, stream.capacity()); EXPECT_TRUE(equal(source, byte_span{stream.data(), stream.size()})); - const epee::byte_slice slice{std::move(stream)}; + const epee::byte_slice slice{std::move(stream), true}; EXPECT_EQ(0u, stream.size()); EXPECT_EQ(0u, stream.available()); EXPECT_EQ(0u, stream.capacity()); |