Vladimir Levin | ad6660a | 2018-01-18 12:35:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "include/core/SkFlattenable.h" |
| 9 | #include "tests/Test.h" |
Vladimir Levin | ad6660a | 2018-01-18 12:35:11 -0800 | [diff] [blame] | 10 | |
| 11 | DEF_TEST(FlattenableNameToFactory, r) { |
| 12 | if (!SkFlattenable::NameToFactory("SkImageShader")) { |
| 13 | ERRORF(r, "SkFlattenable::NameToFactory() fails with SkImageShader."); |
| 14 | } |
| 15 | if (SkFlattenable::NameToFactory("AAA-non-existent")) { |
| 16 | ERRORF(r, "SkFlattenable::NameToFactory() succeeds with AAA-non-existent."); |
| 17 | } |
| 18 | if (SkFlattenable::NameToFactory("SkNonExistent")) { |
| 19 | ERRORF(r, "SkFlattenable::NameToFactory() succeeds with SkNonExistent"); |
| 20 | } |
| 21 | if (SkFlattenable::NameToFactory("ZZZ-non-existent")) { |
| 22 | ERRORF(r, "SkFlattenable::NameToFactory() succeeds with ZZZ-non-existent."); |
| 23 | } |
| 24 | } |