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

Side by Side Diff: tests/FontConfigParser.cpp

Issue 925933003: Verify all parsed test font files start with cap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/ports/SkFontConfigParser_android.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkFontConfigParser_android.h" 10 #include "SkFontConfigParser_android.h"
(...skipping 30 matching lines...) Expand all
41 REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont); 41 REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont);
42 42
43 // Check that the languages are all sane. 43 // Check that the languages are all sane.
44 for (int i = 0; i < fontFamilies.count(); ++i) { 44 for (int i = 0; i < fontFamilies.count(); ++i) {
45 const SkString& lang = fontFamilies[i]->fLanguage.getTag(); 45 const SkString& lang = fontFamilies[i]->fLanguage.getTag();
46 for (size_t j = 0; j < lang.size(); ++j) { 46 for (size_t j = 0; j < lang.size(); ++j) {
47 int c = lang[j]; 47 int c = lang[j];
48 REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); 48 REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c);
49 } 49 }
50 } 50 }
51
52 // All file names in the test configuration files start with a capital lette r.
djsollen 2015/02/13 16:17:49 comment that this isn't a requirement, but since i
bungeman-skia 2015/02/13 16:38:07 Done.
53 for (int i = 0; i < fontFamilies.count(); ++i) {
54 FontFamily& family = *fontFamilies[i];
55 for (int j = 0; j < family.fFonts.count(); ++j) {
56 FontFileInfo& file = family.fFonts[j];
57 REPORTER_ASSERT(reporter, !file.fFileName.isEmpty() &&
58 file.fFileName[0] >= 'A' &&
59 file.fFileName[0] <= 'Z');
60 }
61 }
51 } 62 }
52 63
53 void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) { 64 void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) {
54 if (!FLAGS_verboseFontMgr) { 65 if (!FLAGS_verboseFontMgr) {
55 return; 66 return;
56 } 67 }
57 68
58 for (int i = 0; i < fontFamilies.count(); ++i) { 69 for (int i = 0; i < fontFamilies.count(); ++i) {
59 SkDebugf("Family %d:\n", i); 70 SkDebugf("Family %d:\n", i);
60 switch(fontFamilies[i]->fVariant) { 71 switch(fontFamilies[i]->fVariant) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter); 141 ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter);
131 } else { 142 } else {
132 resourcesMissing = true; 143 resourcesMissing = true;
133 } 144 }
134 145
135 if (resourcesMissing) { 146 if (resourcesMissing) {
136 SkDebugf("---- Resource files missing for FontConfigParser test\n"); 147 SkDebugf("---- Resource files missing for FontConfigParser test\n");
137 } 148 }
138 } 149 }
139 150
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigParser_android.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698