summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_nametree_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_nametree_unittest.cpp')
-rw-r--r--core/fpdfdoc/cpdf_nametree_unittest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpdf_nametree_unittest.cpp b/core/fpdfdoc/cpdf_nametree_unittest.cpp
index 28af9e078d..bffb496843 100644
--- a/core/fpdfdoc/cpdf_nametree_unittest.cpp
+++ b/core/fpdfdoc/cpdf_nametree_unittest.cpp
@@ -16,8 +16,9 @@ TEST(cpdf_nametree, GetUnicodeNameWithBOM) {
// Add the key "1" (with BOM) and value 100 into the array.
std::ostringstream buf;
- buf << static_cast<unsigned char>(254) << static_cast<unsigned char>(255)
- << static_cast<unsigned char>(0) << static_cast<unsigned char>(49);
+ constexpr char kData[] = "\xFE\xFF\x00\x31";
+ for (size_t i = 0; i < sizeof(kData); ++i)
+ buf.put(kData[i]);
pNames->AddNew<CPDF_String>(CFX_ByteString(buf), true);
pNames->AddNew<CPDF_Number>(100);