nearby: snapshot of cl/317978613

Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I4bf367877a986910bb03e1c54aa972b4bcd59942
This commit is contained in:
Alexey Polyudov
2020-06-23 19:52:26 -07:00
parent 32828732ff
commit 6b27a508ed
164 changed files with 8663 additions and 1212 deletions
+8
View File
@@ -65,4 +65,12 @@ TEST(ByteArrayTest, SetExplicitData) {
EXPECT_EQ(0, memcmp(message, bytes.data(), kMessageSize));
}
TEST(ByteArrayTest, CreateFromNonNullTerminatedStdArray) {
constexpr static const std::array data{'a', '\x00', 'b'};
ByteArray bytes{data};
EXPECT_EQ(bytes.size(), 3);
EXPECT_EQ(bytes.size(), std::string(bytes).size());
EXPECT_EQ(std::string(bytes), std::string(data.data(), data.size()));
}
} // namespace