summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_bytestring_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_bytestring_unittest.cpp')
-rw-r--r--core/fxcrt/cfx_bytestring_unittest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_bytestring_unittest.cpp b/core/fxcrt/cfx_bytestring_unittest.cpp
index 3b679a086c..9cfc773fad 100644
--- a/core/fxcrt/cfx_bytestring_unittest.cpp
+++ b/core/fxcrt/cfx_bytestring_unittest.cpp
@@ -4,6 +4,8 @@
#include "core/fxcrt/cfx_bytestring.h"
+#include <vector>
+
#include "testing/fx_string_testhelpers.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -773,6 +775,17 @@ TEST(fxcrt, ByteStringCFromChar) {
EXPECT_NE(longer_string, lower_a_string_from_char);
}
+TEST(fxcrt, ByteStringCFromVector) {
+ std::vector<uint8_t> null_vec;
+ CFX_ByteStringC null_string(null_vec);
+ EXPECT_EQ(0, null_string.GetLength());
+
+ std::vector<uint8_t> lower_a_vec(10, static_cast<uint8_t>('a'));
+ CFX_ByteStringC lower_a_string(lower_a_vec);
+ EXPECT_EQ(10, lower_a_string.GetLength());
+ EXPECT_EQ("aaaaaaaaaa", lower_a_string);
+}
+
TEST(fxcrt, ByteStringCGetID) {
CFX_ByteStringC null_string;
EXPECT_EQ(0u, null_string.GetID());