Commit ba483a6f authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Use more unique names in fonts testcases

Many fonts tests use local helper classes TestRun, ExpectedRun and
helper macros DECLARE_RUNSVECTOR and CHECK_RUNS. With jumbo builds
those names start colliding so this patch gives the classes and
macros a prefix related to the actual test.

Change-Id: I494cfc182070ae37a87b68f08303fc8cc3ef9cfe
Reviewed-on: https://chromium-review.googlesource.com/570424
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486866}
parent f56f6e2e
...@@ -9,28 +9,29 @@ ...@@ -9,28 +9,29 @@
namespace blink { namespace blink {
struct TestRun { struct OrientationTestRun {
std::string text; std::string text;
OrientationIterator::RenderOrientation code; OrientationIterator::RenderOrientation code;
}; };
struct ExpectedRun { struct OrientationExpectedRun {
unsigned limit; unsigned limit;
OrientationIterator::RenderOrientation render_orientation; OrientationIterator::RenderOrientation render_orientation;
ExpectedRun(unsigned the_limit, OrientationExpectedRun(
OrientationIterator::RenderOrientation the_render_orientation) unsigned the_limit,
OrientationIterator::RenderOrientation the_render_orientation)
: limit(the_limit), render_orientation(the_render_orientation) {} : limit(the_limit), render_orientation(the_render_orientation) {}
}; };
class OrientationIteratorTest : public ::testing::Test { class OrientationIteratorTest : public ::testing::Test {
protected: protected:
void CheckRuns(const Vector<TestRun>& runs) { void CheckRuns(const Vector<OrientationTestRun>& runs) {
String text(g_empty_string16_bit); String text(g_empty_string16_bit);
Vector<ExpectedRun> expect; Vector<OrientationExpectedRun> expect;
for (auto& run : runs) { for (auto& run : runs) {
text.append(String::FromUTF8(run.text.c_str())); text.append(String::FromUTF8(run.text.c_str()));
expect.push_back(ExpectedRun(text.length(), run.code)); expect.push_back(OrientationExpectedRun(text.length(), run.code));
} }
OrientationIterator orientation_iterator(text.Characters16(), text.length(), OrientationIterator orientation_iterator(text.Characters16(), text.length(),
FontOrientation::kVerticalMixed); FontOrientation::kVerticalMixed);
...@@ -38,7 +39,7 @@ class OrientationIteratorTest : public ::testing::Test { ...@@ -38,7 +39,7 @@ class OrientationIteratorTest : public ::testing::Test {
} }
void VerifyRuns(OrientationIterator* orientation_iterator, void VerifyRuns(OrientationIterator* orientation_iterator,
const Vector<ExpectedRun>& expect) { const Vector<OrientationExpectedRun>& expect) {
unsigned limit; unsigned limit;
OrientationIterator::RenderOrientation render_orientation; OrientationIterator::RenderOrientation render_orientation;
unsigned long run_count = 0; unsigned long run_count = 0;
...@@ -53,9 +54,9 @@ class OrientationIteratorTest : public ::testing::Test { ...@@ -53,9 +54,9 @@ class OrientationIteratorTest : public ::testing::Test {
}; };
// TODO(esprehn): WTF::Vector should allow initialization from a literal. // TODO(esprehn): WTF::Vector should allow initialization from a literal.
#define CHECK_RUNS(...) \ #define CHECK_ORIENTATION(...) \
static const TestRun kRunsArray[] = __VA_ARGS__; \ static const OrientationTestRun kRunsArray[] = __VA_ARGS__; \
Vector<TestRun> runs; \ Vector<OrientationTestRun> runs; \
runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); \ runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); \
CheckRuns(runs); CheckRuns(runs);
...@@ -72,42 +73,44 @@ TEST_F(OrientationIteratorTest, Empty) { ...@@ -72,42 +73,44 @@ TEST_F(OrientationIteratorTest, Empty) {
} }
TEST_F(OrientationIteratorTest, OneCharLatin) { TEST_F(OrientationIteratorTest, OneCharLatin) {
CHECK_RUNS({{"A", OrientationIterator::kOrientationRotateSideways}}); CHECK_ORIENTATION({{"A", OrientationIterator::kOrientationRotateSideways}});
} }
TEST_F(OrientationIteratorTest, OneAceOfSpades) { TEST_F(OrientationIteratorTest, OneAceOfSpades) {
CHECK_RUNS({{"🂡", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION({{"🂡", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, CombiningCircle) { TEST_F(OrientationIteratorTest, CombiningCircle) {
CHECK_RUNS({{"◌́◌̀◌̈◌̂◌̄◌̊", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION({{"◌́◌̀◌̈◌̂◌̄◌̊", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, OneEthiopicSyllable) { TEST_F(OrientationIteratorTest, OneEthiopicSyllable) {
CHECK_RUNS({{"ጀ", OrientationIterator::kOrientationRotateSideways}}); CHECK_ORIENTATION({{"ጀ", OrientationIterator::kOrientationRotateSideways}});
} }
TEST_F(OrientationIteratorTest, JapaneseLetterlikeEnd) { TEST_F(OrientationIteratorTest, JapaneseLetterlikeEnd) {
CHECK_RUNS( CHECK_ORIENTATION(
{{"いろは", OrientationIterator::kOrientationKeep}, {{"いろは", OrientationIterator::kOrientationKeep},
{"ℐℒℐℒℐℒℐℒℐℒℐℒℐℒ", OrientationIterator::kOrientationRotateSideways}}); {"ℐℒℐℒℐℒℐℒℐℒℐℒℐℒ", OrientationIterator::kOrientationRotateSideways}});
} }
TEST_F(OrientationIteratorTest, LetterlikeJapaneseEnd) { TEST_F(OrientationIteratorTest, LetterlikeJapaneseEnd) {
CHECK_RUNS({{"ℐ", OrientationIterator::kOrientationRotateSideways}, CHECK_ORIENTATION({{"ℐ", OrientationIterator::kOrientationRotateSideways},
{"いろは", OrientationIterator::kOrientationKeep}}); {"いろは", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, OneCharJapanese) { TEST_F(OrientationIteratorTest, OneCharJapanese) {
CHECK_RUNS({{"い", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION({{"い", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, Japanese) { TEST_F(OrientationIteratorTest, Japanese) {
CHECK_RUNS({{"いろはにほへと", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION(
{{"いろはにほへと", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, IVS) { TEST_F(OrientationIteratorTest, IVS) {
CHECK_RUNS({{"愉\xF3\xA0\x84\x81", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION(
{{"愉\xF3\xA0\x84\x81", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, MarkAtFirstCharRotated) { TEST_F(OrientationIteratorTest, MarkAtFirstCharRotated) {
...@@ -117,47 +120,50 @@ TEST_F(OrientationIteratorTest, MarkAtFirstCharRotated) { ...@@ -117,47 +120,50 @@ TEST_F(OrientationIteratorTest, MarkAtFirstCharRotated) {
// http://www.unicode.org/reports/tr50/#grapheme_clusters // http://www.unicode.org/reports/tr50/#grapheme_clusters
// https://drafts.csswg.org/css-writing-modes-3/#vertical-orientations // https://drafts.csswg.org/css-writing-modes-3/#vertical-orientations
// U+0300 COMBINING GRAVE ACCENT is Mn (Mark, Nonspacing) with Rotated. // U+0300 COMBINING GRAVE ACCENT is Mn (Mark, Nonspacing) with Rotated.
CHECK_RUNS({{"\xCC\x80", OrientationIterator::kOrientationRotateSideways}}); CHECK_ORIENTATION(
{{"\xCC\x80", OrientationIterator::kOrientationRotateSideways}});
} }
TEST_F(OrientationIteratorTest, MarkAtFirstCharUpright) { TEST_F(OrientationIteratorTest, MarkAtFirstCharUpright) {
// U+20DD COMBINING ENCLOSING CIRCLE is Me (Mark, Enclosing) with Upright. // U+20DD COMBINING ENCLOSING CIRCLE is Me (Mark, Enclosing) with Upright.
CHECK_RUNS({{"\xE2\x83\x9D", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION({{"\xE2\x83\x9D", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, MarksAtFirstCharUpright) { TEST_F(OrientationIteratorTest, MarksAtFirstCharUpright) {
// U+20DD COMBINING ENCLOSING CIRCLE is Me (Mark, Enclosing) with Upright. // U+20DD COMBINING ENCLOSING CIRCLE is Me (Mark, Enclosing) with Upright.
// U+0300 COMBINING GRAVE ACCENT is Mn (Mark, Nonspacing) with Rotated. // U+0300 COMBINING GRAVE ACCENT is Mn (Mark, Nonspacing) with Rotated.
CHECK_RUNS({{"\xE2\x83\x9D\xCC\x80", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION(
{{"\xE2\x83\x9D\xCC\x80", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, MarksAtFirstCharUprightThenBase) { TEST_F(OrientationIteratorTest, MarksAtFirstCharUprightThenBase) {
// U+20DD COMBINING ENCLOSING CIRCLE is Me (Mark, Enclosing) with Upright. // U+20DD COMBINING ENCLOSING CIRCLE is Me (Mark, Enclosing) with Upright.
// U+0300 COMBINING GRAVE ACCENT is Mn (Mark, Nonspacing) with Rotated. // U+0300 COMBINING GRAVE ACCENT is Mn (Mark, Nonspacing) with Rotated.
CHECK_RUNS( CHECK_ORIENTATION(
{{"\xE2\x83\x9D\xCC\x80", OrientationIterator::kOrientationKeep}, {{"\xE2\x83\x9D\xCC\x80", OrientationIterator::kOrientationKeep},
{"ABC\xE2\x83\x9D", OrientationIterator::kOrientationRotateSideways}}); {"ABC\xE2\x83\x9D", OrientationIterator::kOrientationRotateSideways}});
} }
TEST_F(OrientationIteratorTest, JapaneseLatinMixedInside) { TEST_F(OrientationIteratorTest, JapaneseLatinMixedInside) {
CHECK_RUNS({{"いろはに", OrientationIterator::kOrientationKeep}, CHECK_ORIENTATION({{"いろはに", OrientationIterator::kOrientationKeep},
{"Abc", OrientationIterator::kOrientationRotateSideways}, {"Abc", OrientationIterator::kOrientationRotateSideways},
{"ほへと", OrientationIterator::kOrientationKeep}}); {"ほへと", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, PunctuationJapanese) { TEST_F(OrientationIteratorTest, PunctuationJapanese) {
CHECK_RUNS({{".…¡", OrientationIterator::kOrientationRotateSideways}, CHECK_ORIENTATION({{".…¡", OrientationIterator::kOrientationRotateSideways},
{"ほへと", OrientationIterator::kOrientationKeep}}); {"ほへと", OrientationIterator::kOrientationKeep}});
} }
TEST_F(OrientationIteratorTest, JapaneseLatinMixedOutside) { TEST_F(OrientationIteratorTest, JapaneseLatinMixedOutside) {
CHECK_RUNS({{"Abc", OrientationIterator::kOrientationRotateSideways}, CHECK_ORIENTATION({{"Abc", OrientationIterator::kOrientationRotateSideways},
{"ほへと", OrientationIterator::kOrientationKeep}, {"ほへと", OrientationIterator::kOrientationKeep},
{"Xyz", OrientationIterator::kOrientationRotateSideways}}); {"Xyz", OrientationIterator::kOrientationRotateSideways}});
} }
TEST_F(OrientationIteratorTest, JapaneseMahjonggMixed) { TEST_F(OrientationIteratorTest, JapaneseMahjonggMixed) {
CHECK_RUNS({{"いろはに🀤ほへと", OrientationIterator::kOrientationKeep}}); CHECK_ORIENTATION(
{{"いろはに🀤ほへと", OrientationIterator::kOrientationKeep}});
} }
} // namespace blink } // namespace blink
...@@ -9,35 +9,36 @@ ...@@ -9,35 +9,36 @@
namespace blink { namespace blink {
struct TestRun { struct SmallCapsTestRun {
std::string text; std::string text;
SmallCapsIterator::SmallCapsBehavior code; SmallCapsIterator::SmallCapsBehavior code;
}; };
struct ExpectedRun { struct SmallCapsExpectedRun {
unsigned limit; unsigned limit;
SmallCapsIterator::SmallCapsBehavior small_caps_behavior; SmallCapsIterator::SmallCapsBehavior small_caps_behavior;
ExpectedRun(unsigned the_limit, SmallCapsExpectedRun(
SmallCapsIterator::SmallCapsBehavior the_small_caps_behavior) unsigned the_limit,
SmallCapsIterator::SmallCapsBehavior the_small_caps_behavior)
: limit(the_limit), small_caps_behavior(the_small_caps_behavior) {} : limit(the_limit), small_caps_behavior(the_small_caps_behavior) {}
}; };
class SmallCapsIteratorTest : public ::testing::Test { class SmallCapsIteratorTest : public ::testing::Test {
protected: protected:
void CheckRuns(const Vector<TestRun>& runs) { void CheckRuns(const Vector<SmallCapsTestRun>& runs) {
String text(g_empty_string16_bit); String text(g_empty_string16_bit);
Vector<ExpectedRun> expect; Vector<SmallCapsExpectedRun> expect;
for (auto& run : runs) { for (auto& run : runs) {
text.append(String::FromUTF8(run.text.c_str())); text.append(String::FromUTF8(run.text.c_str()));
expect.push_back(ExpectedRun(text.length(), run.code)); expect.push_back(SmallCapsExpectedRun(text.length(), run.code));
} }
SmallCapsIterator small_caps_iterator(text.Characters16(), text.length()); SmallCapsIterator small_caps_iterator(text.Characters16(), text.length());
VerifyRuns(&small_caps_iterator, expect); VerifyRuns(&small_caps_iterator, expect);
} }
void VerifyRuns(SmallCapsIterator* small_caps_iterator, void VerifyRuns(SmallCapsIterator* small_caps_iterator,
const Vector<ExpectedRun>& expect) { const Vector<SmallCapsExpectedRun>& expect) {
unsigned limit; unsigned limit;
SmallCapsIterator::SmallCapsBehavior small_caps_behavior; SmallCapsIterator::SmallCapsBehavior small_caps_behavior;
unsigned long run_count = 0; unsigned long run_count = 0;
...@@ -52,13 +53,13 @@ class SmallCapsIteratorTest : public ::testing::Test { ...@@ -52,13 +53,13 @@ class SmallCapsIteratorTest : public ::testing::Test {
}; };
// Some of our compilers cannot initialize a vector from an array yet. // Some of our compilers cannot initialize a vector from an array yet.
#define DECLARE_RUNSVECTOR(...) \ #define DECLARE_SMALL_CAPS_RUNSVECTOR(...) \
static const TestRun kRunsArray[] = __VA_ARGS__; \ static const SmallCapsTestRun kRunsArray[] = __VA_ARGS__; \
Vector<TestRun> runs; \ Vector<SmallCapsTestRun> runs; \
runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray));
#define CHECK_RUNS(...) \ #define CHECK_SMALL_CAPS_RUN(...) \
DECLARE_RUNSVECTOR(__VA_ARGS__); \ DECLARE_SMALL_CAPS_RUNSVECTOR(__VA_ARGS__); \
CheckRuns(runs); CheckRuns(runs);
TEST_F(SmallCapsIteratorTest, Empty) { TEST_F(SmallCapsIteratorTest, Empty) {
...@@ -73,44 +74,44 @@ TEST_F(SmallCapsIteratorTest, Empty) { ...@@ -73,44 +74,44 @@ TEST_F(SmallCapsIteratorTest, Empty) {
} }
TEST_F(SmallCapsIteratorTest, UppercaseA) { TEST_F(SmallCapsIteratorTest, UppercaseA) {
CHECK_RUNS({{"A", SmallCapsIterator::kSmallCapsSameCase}}); CHECK_SMALL_CAPS_RUN({{"A", SmallCapsIterator::kSmallCapsSameCase}});
} }
TEST_F(SmallCapsIteratorTest, LowercaseA) { TEST_F(SmallCapsIteratorTest, LowercaseA) {
CHECK_RUNS({{"a", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); CHECK_SMALL_CAPS_RUN({{"a", SmallCapsIterator::kSmallCapsUppercaseNeeded}});
} }
TEST_F(SmallCapsIteratorTest, UppercaseLowercaseA) { TEST_F(SmallCapsIteratorTest, UppercaseLowercaseA) {
CHECK_RUNS({{"A", SmallCapsIterator::kSmallCapsSameCase}, CHECK_SMALL_CAPS_RUN({{"A", SmallCapsIterator::kSmallCapsSameCase},
{"a", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); {"a", SmallCapsIterator::kSmallCapsUppercaseNeeded}});
} }
TEST_F(SmallCapsIteratorTest, UppercasePunctuationMixed) { TEST_F(SmallCapsIteratorTest, UppercasePunctuationMixed) {
CHECK_RUNS({{"AAA??", SmallCapsIterator::kSmallCapsSameCase}}); CHECK_SMALL_CAPS_RUN({{"AAA??", SmallCapsIterator::kSmallCapsSameCase}});
} }
TEST_F(SmallCapsIteratorTest, LowercasePunctuationMixed) { TEST_F(SmallCapsIteratorTest, LowercasePunctuationMixed) {
CHECK_RUNS({{"aaa", SmallCapsIterator::kSmallCapsUppercaseNeeded}, CHECK_SMALL_CAPS_RUN({{"aaa", SmallCapsIterator::kSmallCapsUppercaseNeeded},
{"===", SmallCapsIterator::kSmallCapsSameCase}}); {"===", SmallCapsIterator::kSmallCapsSameCase}});
} }
TEST_F(SmallCapsIteratorTest, LowercasePunctuationInterleaved) { TEST_F(SmallCapsIteratorTest, LowercasePunctuationInterleaved) {
CHECK_RUNS({{"aaa", SmallCapsIterator::kSmallCapsUppercaseNeeded}, CHECK_SMALL_CAPS_RUN({{"aaa", SmallCapsIterator::kSmallCapsUppercaseNeeded},
{"===", SmallCapsIterator::kSmallCapsSameCase}, {"===", SmallCapsIterator::kSmallCapsSameCase},
{"bbb", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); {"bbb", SmallCapsIterator::kSmallCapsUppercaseNeeded}});
} }
TEST_F(SmallCapsIteratorTest, Japanese) { TEST_F(SmallCapsIteratorTest, Japanese) {
CHECK_RUNS({{"ほへと", SmallCapsIterator::kSmallCapsSameCase}}); CHECK_SMALL_CAPS_RUN({{"ほへと", SmallCapsIterator::kSmallCapsSameCase}});
} }
TEST_F(SmallCapsIteratorTest, Armenian) { TEST_F(SmallCapsIteratorTest, Armenian) {
CHECK_RUNS({{"աբգդ", SmallCapsIterator::kSmallCapsUppercaseNeeded}, CHECK_SMALL_CAPS_RUN({{"աբգդ", SmallCapsIterator::kSmallCapsUppercaseNeeded},
{"ԵԶԷԸ", SmallCapsIterator::kSmallCapsSameCase}}); {"ԵԶԷԸ", SmallCapsIterator::kSmallCapsSameCase}});
} }
TEST_F(SmallCapsIteratorTest, CombiningCharacterSequence) { TEST_F(SmallCapsIteratorTest, CombiningCharacterSequence) {
CHECK_RUNS({{"èü", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); CHECK_SMALL_CAPS_RUN({{"èü", SmallCapsIterator::kSmallCapsUppercaseNeeded}});
} }
} // namespace blink } // namespace blink
...@@ -9,35 +9,36 @@ ...@@ -9,35 +9,36 @@
namespace blink { namespace blink {
struct TestRun { struct FallbackTestRun {
std::string text; std::string text;
FontFallbackPriority font_fallback_priority; FontFallbackPriority font_fallback_priority;
}; };
struct ExpectedRun { struct FallbackExpectedRun {
unsigned limit; unsigned limit;
FontFallbackPriority font_fallback_priority; FontFallbackPriority font_fallback_priority;
ExpectedRun(unsigned the_limit, FallbackExpectedRun(unsigned the_limit,
FontFallbackPriority the_font_fallback_priority) FontFallbackPriority the_font_fallback_priority)
: limit(the_limit), font_fallback_priority(the_font_fallback_priority) {} : limit(the_limit), font_fallback_priority(the_font_fallback_priority) {}
}; };
class SymbolsIteratorTest : public ::testing::Test { class SymbolsIteratorTest : public ::testing::Test {
protected: protected:
void CheckRuns(const Vector<TestRun>& runs) { void CheckRuns(const Vector<FallbackTestRun>& runs) {
String text(g_empty_string16_bit); String text(g_empty_string16_bit);
Vector<ExpectedRun> expect; Vector<FallbackExpectedRun> expect;
for (auto& run : runs) { for (auto& run : runs) {
text.append(String::FromUTF8(run.text.c_str())); text.append(String::FromUTF8(run.text.c_str()));
expect.push_back(ExpectedRun(text.length(), run.font_fallback_priority)); expect.push_back(
FallbackExpectedRun(text.length(), run.font_fallback_priority));
} }
SymbolsIterator symbols_iterator(text.Characters16(), text.length()); SymbolsIterator symbols_iterator(text.Characters16(), text.length());
VerifyRuns(&symbols_iterator, expect); VerifyRuns(&symbols_iterator, expect);
} }
void VerifyRuns(SymbolsIterator* symbols_iterator, void VerifyRuns(SymbolsIterator* symbols_iterator,
const Vector<ExpectedRun>& expect) { const Vector<FallbackExpectedRun>& expect) {
unsigned limit; unsigned limit;
FontFallbackPriority font_fallback_priority; FontFallbackPriority font_fallback_priority;
unsigned long run_count = 0; unsigned long run_count = 0;
...@@ -53,13 +54,13 @@ class SymbolsIteratorTest : public ::testing::Test { ...@@ -53,13 +54,13 @@ class SymbolsIteratorTest : public ::testing::Test {
}; };
// Some of our compilers cannot initialize a vector from an array yet. // Some of our compilers cannot initialize a vector from an array yet.
#define DECLARE_RUNSVECTOR(...) \ #define DECLARE_FALLBACK_RUNSVECTOR(...) \
static const TestRun kRunsArray[] = __VA_ARGS__; \ static const FallbackTestRun kRunsArray[] = __VA_ARGS__; \
Vector<TestRun> runs; \ Vector<FallbackTestRun> runs; \
runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray));
#define CHECK_RUNS(...) \ #define CHECK_RUNS(...) \
DECLARE_RUNSVECTOR(__VA_ARGS__); \ DECLARE_FALLBACK_RUNSVECTOR(__VA_ARGS__); \
CheckRuns(runs); CheckRuns(runs);
TEST_F(SymbolsIteratorTest, Empty) { TEST_F(SymbolsIteratorTest, Empty) {
......
...@@ -77,17 +77,17 @@ class RunSegmenterTest : public ::testing::Test { ...@@ -77,17 +77,17 @@ class RunSegmenterTest : public ::testing::Test {
}; };
// Some of our compilers cannot initialize a vector from an array yet. // Some of our compilers cannot initialize a vector from an array yet.
#define DECLARE_RUNSVECTOR(...) \ #define DECLARE_SEGMENTER_RUNSVECTOR(...) \
static const SegmenterTestRun kRunsArray[] = __VA_ARGS__; \ static const SegmenterTestRun kRunsArray[] = __VA_ARGS__; \
Vector<SegmenterTestRun> runs; \ Vector<SegmenterTestRun> runs; \
runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray));
#define CHECK_RUNS_MIXED(...) \ #define CHECK_RUNS_MIXED(...) \
DECLARE_RUNSVECTOR(__VA_ARGS__); \ DECLARE_SEGMENTER_RUNSVECTOR(__VA_ARGS__); \
CheckRuns(runs, FontOrientation::kVerticalMixed); CheckRuns(runs, FontOrientation::kVerticalMixed);
#define CHECK_RUNS_HORIZONTAL(...) \ #define CHECK_RUNS_HORIZONTAL(...) \
DECLARE_RUNSVECTOR(__VA_ARGS__); \ DECLARE_SEGMENTER_RUNSVECTOR(__VA_ARGS__); \
CheckRuns(runs, FontOrientation::kHorizontal); CheckRuns(runs, FontOrientation::kHorizontal);
TEST_F(RunSegmenterTest, Empty) { TEST_F(RunSegmenterTest, Empty) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment