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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_bytestring_unittest.cpp b/core/fxcrt/cfx_bytestring_unittest.cpp
index 14d9393371..c53b90025b 100644
--- a/core/fxcrt/cfx_bytestring_unittest.cpp
+++ b/core/fxcrt/cfx_bytestring_unittest.cpp
@@ -786,6 +786,13 @@ TEST(fxcrt, ByteStringCFromVector) {
CFX_ByteStringC lower_a_string(lower_a_vec);
EXPECT_EQ(10, lower_a_string.GetLength());
EXPECT_EQ("aaaaaaaaaa", lower_a_string);
+
+ std::vector<uint8_t> cleared_vec;
+ cleared_vec.push_back(42);
+ cleared_vec.pop_back();
+ CFX_ByteStringC cleared_string(cleared_vec);
+ EXPECT_EQ(0, cleared_string.GetLength());
+ EXPECT_EQ(nullptr, cleared_string.raw_str());
}
TEST(fxcrt, ByteStringCGetID) {