summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_widestring_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_widestring_unittest.cpp')
-rw-r--r--core/fxcrt/cfx_widestring_unittest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_widestring_unittest.cpp b/core/fxcrt/cfx_widestring_unittest.cpp
index dd44cb70af..498b4f0b6a 100644
--- a/core/fxcrt/cfx_widestring_unittest.cpp
+++ b/core/fxcrt/cfx_widestring_unittest.cpp
@@ -4,6 +4,8 @@
#include "core/fxcrt/cfx_widestring.h"
+#include <vector>
+
#include "testing/fx_string_testhelpers.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -689,6 +691,18 @@ TEST(fxcrt, WideStringUTF16LE_Encode) {
}
}
+TEST(fxcrt, WideStringCFromVector) {
+ std::vector<CFX_WideStringC::UnsignedType> null_vec;
+ CFX_WideStringC null_string(null_vec);
+ EXPECT_EQ(0, null_string.GetLength());
+
+ std::vector<CFX_WideStringC::UnsignedType> lower_a_vec(
+ 10, static_cast<CFX_WideStringC::UnsignedType>(L'a'));
+ CFX_WideStringC lower_a_string(lower_a_vec);
+ EXPECT_EQ(10, lower_a_string.GetLength());
+ EXPECT_EQ(L"aaaaaaaaaa", lower_a_string);
+}
+
TEST(fxcrt, WideStringCOperatorSubscript) {
// CFX_WideStringC includes the NUL terminator for non-empty strings.
CFX_WideStringC abc(L"abc");