1 // Copyright 2022 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "core/fxcrt/fx_string_wrappers.h" 6 7 #include "testing/gtest/include/gtest/gtest.h" 8 TEST(STLUtil,string)9TEST(STLUtil, string) { 10 fxcrt::string str; 11 str += '2'; 12 str += '2'; 13 str += "C is "; 14 str += '7'; 15 str += '1'; 16 str += '.'; 17 str += '6'; 18 str += "F"; 19 EXPECT_STREQ("22C is 71.6F", str.c_str()); 20 } 21 TEST(STLUtil,OStringStream)22TEST(STLUtil, OStringStream) { 23 fxcrt::ostringstream str; 24 str << 22 << "C is " << 71.6f << "F"; 25 EXPECT_STREQ("22C is 71.6F", str.str().c_str()); 26 } 27