Skip to content

Commit

Permalink
next attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteemann committed Nov 26, 2021
1 parent d5efe04 commit 4bd0f1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/testsSharedSlice.cpp
Expand Up @@ -1209,7 +1209,7 @@ TEST(SharedSliceRefcountTest, createFromOpenBuffer) {
}

TEST(SharedSliceRefcountTest, createFromUInt8) {
std::shared_ptr<uint8_t[]> data(new uint8_t[7]);
std::shared_ptr<uint8_t> data(new uint8_t[7], std::default_delete<uint8_t[]>());
char* p = reinterpret_cast<char*>(data.get());
*p++ = '\x46';
*p++ = 'f';
Expand All @@ -1218,14 +1218,14 @@ TEST(SharedSliceRefcountTest, createFromUInt8) {
*p++ = 'b';
*p++ = 'a';
*p++ = 'r';

SharedSlice sharedSlice{std::const_pointer_cast<uint8_t const>(data)};
ASSERT_TRUE(sharedSlice.isString());
ASSERT_EQ("foobar", sharedSlice.copyString());
}

TEST(SharedSliceRefcountTest, createFromUInt8Move) {
std::shared_ptr<uint8_t[]> data(new uint8_t[7]);
std::shared_ptr<uint8_t> data(new uint8_t[7], std::default_delete<uint8_t[]>());
char* p = reinterpret_cast<char*>(data.get());
*p++ = '\x46';
*p++ = 'f';
Expand Down

0 comments on commit 4bd0f1b

Please sign in to comment.