diff options
Diffstat (limited to 'tests/TypefaceTest.cpp')
-rw-r--r-- | tests/TypefaceTest.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/TypefaceTest.cpp b/tests/TypefaceTest.cpp index 6175d36157..c8e96c5a7c 100644 --- a/tests/TypefaceTest.cpp +++ b/tests/TypefaceTest.cpp @@ -50,7 +50,10 @@ static void TypefaceStyle_test(skiatest::Reporter* reporter, os2Table->usWidthClass.value = static_cast<WidthType>(SkEndian_SwapBE16(width)); sk_sp<SkTypeface> newTypeface(SkTypeface::MakeFromStream(new SkMemoryStream(sk_ref_sp(data)))); - SkASSERT_RELEASE(newTypeface); + if (!newTypeface) { + // Not all SkFontMgr can MakeFromStream(). + return; + } SkFontStyle newStyle = newTypeface->fontStyle(); @@ -111,6 +114,11 @@ DEF_TEST(TypefaceAxes, reporter) { // TODO: if axes are set and the back-end doesn't support them, should we create the typeface? sk_sp<SkTypeface> typeface = fm->makeFromStream(std::move(distortable), params); + if (!typeface) { + // Not all SkFontMgr can makeFromStream(). + return; + } + int count = typeface->getVariationDesignPosition(nullptr, 0); if (count == -1) { return; |