diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-03-14 13:35:12 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-03-14 13:35:12 -0400 |
commit | 764ec513eecbebd12781bcc96ce81ed5e736ee92 (patch) | |
tree | 12763fde4be1f10ea1183d92185917b2b587e00b /core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp | |
parent | 97da97662417085774f75c26e535c6fbe70266ae (diff) | |
download | pdfium-764ec513eecbebd12781bcc96ce81ed5e736ee92.tar.xz |
Move core/src/ up to core/.
This CL moves the core/src/ files up to core/ and fixes up the include guards,
includes and build files.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1800523005 .
Diffstat (limited to 'core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp b/core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp new file mode 100644 index 0000000000..dd2119e0cf --- /dev/null +++ b/core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp @@ -0,0 +1,30 @@ +// Copyright 2015 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/fpdfapi/fpdf_font/font_int.h" +#include "testing/gtest/include/gtest/gtest.h" + +TEST(fpdf_font, StringToCode) { + EXPECT_EQ(0, CPDF_ToUnicodeMap::StringToCode("")); + EXPECT_EQ(194, CPDF_ToUnicodeMap::StringToCode("<c2")); + EXPECT_EQ(162, CPDF_ToUnicodeMap::StringToCode("<A2")); + EXPECT_EQ(2802, CPDF_ToUnicodeMap::StringToCode("<Af2")); + EXPECT_EQ(12, CPDF_ToUnicodeMap::StringToCode("12")); + EXPECT_EQ(128, CPDF_ToUnicodeMap::StringToCode("128")); +} + +TEST(fpdf_font, StringToWideString) { + EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("")); + EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("1234")); + + EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("<c2")); + + CFX_WideString res = L"\xc2ab"; + EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab")); + EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abab")); + EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab 1234")); + + res += L"\xfaab"; + EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abFaAb")); +} |