Allow constructing Buffers from std::vector

This commit is contained in:
Matias Fontanini
2017-06-04 08:31:57 -07:00
parent c58a4792d3
commit 895a983d17
2 changed files with 23 additions and 1 deletions

View File

@@ -43,6 +43,13 @@ TEST_F(BufferTest, VectorConversion) {
EXPECT_EQ(data, string(buffer_as_vector.begin(), buffer_as_vector.end()));
}
TEST_F(BufferTest, VectorConstruction) {
const string str_data = "Hello world!";
const vector<uint8_t> data(str_data.begin(), str_data.end());
Buffer buffer(data);
EXPECT_EQ(str_data, buffer);
}
TEST_F(BufferTest, Equality) {
string data = "Hello world!";
Buffer buffer1(data);