OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
| 7 |
8 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "TestClassDef.h" |
9 #include "SkPaint.h" | 10 #include "SkPaint.h" |
10 #include "SkUtils.h" | 11 #include "SkUtils.h" |
11 | 12 |
12 // Unicode Variation Selector ranges: inclusive | 13 // Unicode Variation Selector ranges: inclusive |
13 #define UVS_MIN0 0x180B | 14 #define UVS_MIN0 0x180B |
14 #define UVS_MAX0 0x180D | 15 #define UVS_MAX0 0x180D |
15 #define UVS_MIN1 0xFE00 | 16 #define UVS_MIN1 0xFE00 |
16 #define UVS_MAX1 0xFE0F | 17 #define UVS_MAX1 0xFE0F |
17 #define UVS_MIN2 0xE0100 | 18 #define UVS_MIN2 0xE0100 |
18 #define UVS_MAX2 0xE01EF | 19 #define UVS_MAX2 0xE01EF |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int count32 = paint.textToGlyphs(text32, len32, glyphs32); | 71 int count32 = paint.textToGlyphs(text32, len32, glyphs32); |
71 | 72 |
72 REPORTER_ASSERT(reporter, (int)len8 == count8); | 73 REPORTER_ASSERT(reporter, (int)len8 == count8); |
73 REPORTER_ASSERT(reporter, (int)len8 == count16); | 74 REPORTER_ASSERT(reporter, (int)len8 == count16); |
74 REPORTER_ASSERT(reporter, (int)len8 == count32); | 75 REPORTER_ASSERT(reporter, (int)len8 == count32); |
75 | 76 |
76 REPORTER_ASSERT(reporter, !memcmp(glyphs8, glyphs16, count8 * sizeof(uint16_
t))); | 77 REPORTER_ASSERT(reporter, !memcmp(glyphs8, glyphs16, count8 * sizeof(uint16_
t))); |
77 REPORTER_ASSERT(reporter, !memcmp(glyphs8, glyphs32, count8 * sizeof(uint16_
t))); | 78 REPORTER_ASSERT(reporter, !memcmp(glyphs8, glyphs32, count8 * sizeof(uint16_
t))); |
78 } | 79 } |
79 | 80 |
80 static void TestUnicode(skiatest::Reporter* reporter) { | 81 DEF_TEST(Unicode, reporter) { |
81 test_uvs(reporter); | 82 test_uvs(reporter); |
82 test_textencodings(reporter); | 83 test_textencodings(reporter); |
83 } | 84 } |
84 | |
85 #include "TestClassDef.h" | |
86 DEFINE_TESTCLASS("Unicode", TestUnicodeClass, TestUnicode) | |
OLD | NEW |