Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: core/fpdfapi/fpdf_font/fpdf_font_unittest.cpp

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/fpdfapi/fpdf_font/font_int.h" 5 #include "core/fpdfapi/fpdf_font/font_int.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 TEST(fpdf_font, StringToCode) { 8 TEST(fpdf_font, StringToCode) {
9 EXPECT_EQ(0, CPDF_ToUnicodeMap::StringToCode("")); 9 EXPECT_EQ(0u, CPDF_ToUnicodeMap::StringToCode(""));
10 EXPECT_EQ(194, CPDF_ToUnicodeMap::StringToCode("<c2")); 10 EXPECT_EQ(194u, CPDF_ToUnicodeMap::StringToCode("<c2"));
11 EXPECT_EQ(162, CPDF_ToUnicodeMap::StringToCode("<A2")); 11 EXPECT_EQ(162u, CPDF_ToUnicodeMap::StringToCode("<A2"));
12 EXPECT_EQ(2802, CPDF_ToUnicodeMap::StringToCode("<Af2")); 12 EXPECT_EQ(2802u, CPDF_ToUnicodeMap::StringToCode("<Af2"));
13 EXPECT_EQ(12, CPDF_ToUnicodeMap::StringToCode("12")); 13 EXPECT_EQ(12u, CPDF_ToUnicodeMap::StringToCode("12"));
14 EXPECT_EQ(128, CPDF_ToUnicodeMap::StringToCode("128")); 14 EXPECT_EQ(128u, CPDF_ToUnicodeMap::StringToCode("128"));
15 } 15 }
16 16
17 TEST(fpdf_font, StringToWideString) { 17 TEST(fpdf_font, StringToWideString) {
18 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("")); 18 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString(""));
19 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("1234")); 19 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("1234"));
20 20
21 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("<c2")); 21 EXPECT_EQ(L"", CPDF_ToUnicodeMap::StringToWideString("<c2"));
22 22
23 CFX_WideString res = L"\xc2ab"; 23 CFX_WideString res = L"\xc2ab";
24 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab")); 24 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab"));
25 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abab")); 25 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abab"));
26 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab 1234")); 26 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2ab 1234"));
27 27
28 res += L"\xfaab"; 28 res += L"\xfaab";
29 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abFaAb")); 29 EXPECT_EQ(res, CPDF_ToUnicodeMap::StringToWideString("<c2abFaAb"));
30 } 30 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_colorstate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698