OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
9 #include "SkFontMgr.h" | 9 #include "SkFontMgr.h" |
10 #include "SkTypeface.h" | 10 #include "SkTypeface.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 static void test_fontiter(skiatest::Reporter* reporter, bool verbose) { | 43 static void test_fontiter(skiatest::Reporter* reporter, bool verbose) { |
44 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault()); | 44 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault()); |
45 int count = fm->countFamilies(); | 45 int count = fm->countFamilies(); |
46 | 46 |
47 for (int i = 0; i < count; ++i) { | 47 for (int i = 0; i < count; ++i) { |
48 SkString fname; | 48 SkString fname; |
49 fm->getFamilyName(i, &fname); | 49 fm->getFamilyName(i, &fname); |
50 REPORTER_ASSERT(reporter, fname.size() > 0); | 50 » if (fname.size() == 0) { |
bungeman-skia
2014/03/05 18:01:53
Ack! A tab!
Do we even need this? Does anything f
hal.canary
2014/03/05 18:24:32
Now that I think about it, the other ASSERTs didn'
| |
51 | 51 continue; |
52 } | |
52 SkAutoTUnref<SkFontStyleSet> fnset(fm->matchFamily(fname.c_str())); | 53 SkAutoTUnref<SkFontStyleSet> fnset(fm->matchFamily(fname.c_str())); |
53 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); | 54 SkAutoTUnref<SkFontStyleSet> set(fm->createStyleSet(i)); |
54 REPORTER_ASSERT(reporter, fnset->count() == set->count()); | 55 REPORTER_ASSERT(reporter, fnset->count() == set->count()); |
55 | 56 |
56 if (verbose) { | 57 if (verbose) { |
57 SkDebugf("[%2d] %s\n", i, fname.c_str()); | 58 SkDebugf("[%2d] %s\n", i, fname.c_str()); |
58 } | 59 } |
59 | 60 |
60 for (int j = 0; j < set->count(); ++j) { | 61 for (int j = 0; j < set->count(); ++j) { |
61 SkString sname; | 62 SkString sname; |
(...skipping 11 matching lines...) Expand all Loading... | |
73 } | 74 } |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
77 DEFINE_bool(verboseFontMgr, false, "run verbose fontmgr tests."); | 78 DEFINE_bool(verboseFontMgr, false, "run verbose fontmgr tests."); |
78 | 79 |
79 DEF_TEST(FontMgr, reporter) { | 80 DEF_TEST(FontMgr, reporter) { |
80 test_fontiter(reporter, FLAGS_verboseFontMgr); | 81 test_fontiter(reporter, FLAGS_verboseFontMgr); |
81 test_alias_names(reporter); | 82 test_alias_names(reporter); |
82 } | 83 } |
OLD | NEW |