Index: tests/FontConfigParser.cpp |
diff --git a/tests/FontConfigParser.cpp b/tests/FontConfigParser.cpp |
index dc1fac0547ba44b0eb09fac6dd7ee99b5aecf34b..35cc4d098c0ab95369913e9988ac36af01876d18 100644 |
--- a/tests/FontConfigParser.cpp |
+++ b/tests/FontConfigParser.cpp |
@@ -48,6 +48,19 @@ void ValidateLoadedFonts(SkTDArray<FontFamily*> fontFamilies, const char* firstE |
REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); |
} |
} |
+ |
+ // All file names in the test configuration files start with a capital letter. |
+ // This is not a general requirement, but it is true of all the test configuration data. |
+ // Verifying ensures the filenames have been read sanely and have not been 'sliced'. |
+ for (int i = 0; i < fontFamilies.count(); ++i) { |
+ FontFamily& family = *fontFamilies[i]; |
+ for (int j = 0; j < family.fFonts.count(); ++j) { |
+ FontFileInfo& file = family.fFonts[j]; |
+ REPORTER_ASSERT(reporter, !file.fFileName.isEmpty() && |
+ file.fFileName[0] >= 'A' && |
+ file.fFileName[0] <= 'Z'); |
+ } |
+ } |
} |
void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) { |