OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "Test.h" |
| 9 |
| 10 #if defined(SK_XML) |
| 11 |
8 #include "SkDOM.h" | 12 #include "SkDOM.h" |
9 #include "Test.h" | |
10 | 13 |
11 DEF_TEST(SkDOM_test, r) { | 14 DEF_TEST(SkDOM_test, r) { |
12 static const char gDoc[] = | 15 static const char gDoc[] = |
13 "<root a='1' b='2'>" | 16 "<root a='1' b='2'>" |
14 "<elem1 c='3' />" | 17 "<elem1 c='3' />" |
15 "<elem2 d='4' />" | 18 "<elem2 d='4' />" |
16 "<elem3 e='5'>" | 19 "<elem3 e='5'>" |
17 "<subelem1/>" | 20 "<subelem1/>" |
18 "<subelem2 f='6' g='7'/>" | 21 "<subelem2 f='6' g='7'/>" |
19 "</elem3>" | 22 "</elem3>" |
(...skipping 10 matching lines...) Expand all Loading... |
30 const char* v = dom.findAttr(root, "a"); | 33 const char* v = dom.findAttr(root, "a"); |
31 REPORTER_ASSERT(r, v && !strcmp(v, "1")); | 34 REPORTER_ASSERT(r, v && !strcmp(v, "1")); |
32 v = dom.findAttr(root, "b"); | 35 v = dom.findAttr(root, "b"); |
33 REPORTER_ASSERT(r, v && !strcmp(v, "2")); | 36 REPORTER_ASSERT(r, v && !strcmp(v, "2")); |
34 v = dom.findAttr(root, "c"); | 37 v = dom.findAttr(root, "c"); |
35 REPORTER_ASSERT(r, v == nullptr); | 38 REPORTER_ASSERT(r, v == nullptr); |
36 | 39 |
37 REPORTER_ASSERT(r, dom.getFirstChild(root, "elem1")); | 40 REPORTER_ASSERT(r, dom.getFirstChild(root, "elem1")); |
38 REPORTER_ASSERT(r, !dom.getFirstChild(root, "subelem1")); | 41 REPORTER_ASSERT(r, !dom.getFirstChild(root, "subelem1")); |
39 } | 42 } |
| 43 |
| 44 #endif // SK_XML |
OLD | NEW |