blob: 1524b79348f6f17d12b4c348ec2dff1c2727744f [file] [log] [blame]
Vladimir Levinad6660a2018-01-18 12:35:11 -08001/*
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 Kleinc0bd9f92019-04-23 12:05:21 -05008#include "include/core/SkFlattenable.h"
9#include "tests/Test.h"
Vladimir Levinad6660a2018-01-18 12:35:11 -080010
11DEF_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}