aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-03-20 01:35:13 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-03-20 01:35:13 -0400
commit7bf89dcbd3352d3837da7056bbf0469ed1bec374 (patch)
tree1b526094852f503b7e5643d29024dd0ab158b319 /tests
parentMerge pull request #6810 (diff)
parentAllow byte_stream->byte_slice conversion to shrink unused buffer space (diff)
downloadmonero-7bf89dcbd3352d3837da7056bbf0469ed1bec374.tar.xz
Merge pull request #7005
249eae5 Allow byte_stream->byte_slice conversion to shrink unused buffer space (Lee Clagett)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/epee_utils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unit_tests/epee_utils.cpp b/tests/unit_tests/epee_utils.cpp
index 256f8c3c2..cbe3c61b1 100644
--- a/tests/unit_tests/epee_utils.cpp
+++ b/tests/unit_tests/epee_utils.cpp
@@ -1115,11 +1115,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());