Fix |pitch_family| values in CFX_FolderFontInfoTest.
In CFX_FolderFontInfoTest, FindFont() was tested with |pitch_family|
values as 2, which doesn't match any existing pitch family values
defined as FXFONT_FF_*. This CL replaces the invalid pitch family values
with FXFONT_FF_ROMAN, since all fonts used for this test are
proportional Roman fonts.
Change-Id: I5ed88be6a36e90fa6a0e03d8c3e3a05ba08f16ff
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/75390
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Hui Yingst <nigi@chromium.org>
diff --git a/core/fxge/cfx_folderfontinfo_unittest.cpp b/core/fxge/cfx_folderfontinfo_unittest.cpp
index dea29d4..30739fe 100644
--- a/core/fxge/cfx_folderfontinfo_unittest.cpp
+++ b/core/fxge/cfx_folderfontinfo_unittest.cpp
@@ -6,6 +6,7 @@
#include <utility>
+#include "core/fxge/fx_font.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/base/stl_util.h"
@@ -69,25 +70,24 @@
TEST_F(CFX_FolderFontInfoTest, TestFindFont) {
// Find "Symbol" font
void* font = FindFont(/*weight=*/0, /*bItalic=*/false, /*charset=*/2,
- /*pitch_family=*/2, kSymbol, /*bMatchName=*/true);
+ FXFONT_FF_ROMAN, kSymbol, /*bMatchName=*/true);
ASSERT_TRUE(font);
EXPECT_EQ(GetFaceName(font), kSymbol);
// Find "Calibri" font that is not present in the installed fonts
EXPECT_FALSE(FindFont(/*weight=*/0, /*bItalic=*/false, /*charset=*/2,
- /*pitch_family=*/2, kCalibri,
- /*bMatchName=*/true));
+ FXFONT_FF_ROMAN, kCalibri, /*bMatchName=*/true));
// Find the closest matching font to "Bookself" font that is present in the
// installed fonts
font = FindFont(/*weight=*/0, /*bItalic=*/false, /*charset=*/2,
- /*pitch_family=*/2, kBookshelf, /*bMatchName=*/true);
+ FXFONT_FF_ROMAN, kBookshelf, /*bMatchName=*/true);
ASSERT_TRUE(font);
EXPECT_EQ(GetFaceName(font), kBookshelfSymbol7);
// Find "Symbol" font when name matching is false
font = FindFont(/*weight=*/0, /*bItalic=*/false, /*charset=*/2,
- /*pitch_family=*/2, kSymbol, /*bMatchName=*/false);
+ FXFONT_FF_ROMAN, kSymbol, /*bMatchName=*/false);
ASSERT_TRUE(font);
EXPECT_EQ(GetFaceName(font), kArial);
}