Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "font_int.h" | 7 #include "core/src/fpdfapi/fpdf_font/font_int.h" |
|
Tom Sepez
2016/02/17 21:32:26
no space sort order
dsinclair
2016/02/17 21:54:00
Done.
| |
| 8 | 8 |
| 9 TEST(fpdf_font, StringToCode) { | 9 TEST(fpdf_font, StringToCode) { |
| 10 EXPECT_EQ(0, CPDF_ToUnicodeMap::StringToCode("")); | 10 EXPECT_EQ(0, CPDF_ToUnicodeMap::StringToCode("")); |
| 11 EXPECT_EQ(194, CPDF_ToUnicodeMap::StringToCode("<c2")); | 11 EXPECT_EQ(194, CPDF_ToUnicodeMap::StringToCode("<c2")); |
| 12 EXPECT_EQ(162, CPDF_ToUnicodeMap::StringToCode("<A2")); | 12 EXPECT_EQ(162, CPDF_ToUnicodeMap::StringToCode("<A2")); |
| 13 EXPECT_EQ(2802, CPDF_ToUnicodeMap::StringToCode("<Af2")); | 13 EXPECT_EQ(2802, CPDF_ToUnicodeMap::StringToCode("<Af2")); |
| 14 EXPECT_EQ(12, CPDF_ToUnicodeMap::StringToCode("12")); | 14 EXPECT_EQ(12, CPDF_ToUnicodeMap::StringToCode("12")); |
| 15 EXPECT_EQ(128, CPDF_ToUnicodeMap::StringToCode("128")); | 15 EXPECT_EQ(128, CPDF_ToUnicodeMap::StringToCode("128")); |
| 16 } | 16 } |
| 17 | 17 |
| 18 TEST(fpdf_font, StringToWideString) { | 18 TEST(fpdf_font, StringToWideString) { |
| 19 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("")); | 19 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("")); |
| 20 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("1234")); | 20 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("1234")); |
| 21 | 21 |
| 22 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("<c2")); | 22 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("<c2")); |
| 23 | 23 |
| 24 CFX_WideString res = L"\xc2ab"; | 24 CFX_WideString res = L"\xc2ab"; |
| 25 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab")); | 25 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab")); |
| 26 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abab")); | 26 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abab")); |
| 27 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab 1234")); | 27 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab 1234")); |
| 28 | 28 |
| 29 res += L"\xfaab"; | 29 res += L"\xfaab"; |
| 30 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abFaAb")); | 30 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abFaAb")); |
| 31 } | 31 } |
| OLD | NEW |