#include <limits>
#include "build/build_config.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/utf16.h"
#include "testing/gtest/include/gtest/gtest.h"
char* TerminatedFloatToString(float value, pdfium::span<char> buf) { … }
char* TerminatedDoubleToString(double value, pdfium::span<char> buf) { … }
TEST(fxstring, FXUTF8Encode) { … }
TEST(fxstring, FXUTF8EncodeSupplementary) { … }
#if defined(WCHAR_T_IS_16_BIT)
TEST(fxstring, FXUTF8EncodeSurrogateErrorRecovery) {
EXPECT_EQ("(\xed\xa0\x80)", FX_UTF8Encode(L"(\xd800)")) << "High";
EXPECT_EQ("(\xed\xb0\x80)", FX_UTF8Encode(L"(\xdc00)")) << "Low";
EXPECT_EQ("(\xed\xa0\x80🎨)", FX_UTF8Encode(L"(\xd800\xd83c\xdfa8)"))
<< "High-high";
EXPECT_EQ("(🎨\xed\xb0\x80)", FX_UTF8Encode(L"(\xd83c\xdfa8\xdc00)"))
<< "Low-low";
}
#endif
TEST(fxstring, ByteStringToFloat) { … }
TEST(fxstring, WideStringToFloat) { … }
TEST(fxstring, FloatToString) { … }
TEST(fxstring, ByteStringToDouble) { … }
TEST(fxstring, WideStringToDouble) { … }
TEST(fxstring, DoubleToString) { … }
TEST(fxstring, SplitByteString) { … }
TEST(fxstring, SplitByteStringView) { … }
TEST(fxstring, SplitWideString) { … }
TEST(fxstring, SplitWideStringView) { … }
TEST(fxstring, ByteStringSplitEfficiency) { … }
TEST(fxstring, ByteStringViewSplitEfficiency) { … }
TEST(fxstring, WideStringSplitEfficiency) { … }
TEST(fxstring, WideStringViewSplitEfficiency) { … }