| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 static UChar c2[] = { 0x1DBF }; | 75 static UChar c2[] = { 0x1DBF }; |
| 76 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c2, 1)); | 76 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c2, 1)); |
| 77 static UChar c3[] = { 0x1DC0 }; | 77 static UChar c3[] = { 0x1DC0 }; |
| 78 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c3, 1)); | 78 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c3, 1)); |
| 79 static UChar c4[] = { 0x1DD0 }; | 79 static UChar c4[] = { 0x1DD0 }; |
| 80 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c4, 1)); | 80 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c4, 1)); |
| 81 static UChar c5[] = { 0x1DFF }; | 81 static UChar c5[] = { 0x1DFF }; |
| 82 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c5, 1)); | 82 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c5, 1)); |
| 83 static UChar c6[] = { 0x1E00 }; | 83 static UChar c6[] = { 0x1E00 }; |
| 84 EXPECT_EQ(SimpleWithGlyphOverflowPath, Character::characterRangeCodePath(c6,
1)); | 84 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c6, 1)); |
| 85 static UChar c7[] = { 0x2000 }; | 85 static UChar c7[] = { 0x2000 }; |
| 86 EXPECT_EQ(SimpleWithGlyphOverflowPath, Character::characterRangeCodePath(c7,
1)); | 86 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c7, 1)); |
| 87 static UChar c8[] = { 0x2001 }; | 87 static UChar c8[] = { 0x2001 }; |
| 88 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c8, 1)); | 88 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c8, 1)); |
| 89 | 89 |
| 90 TestSpecificUCharRange(0x20D0, 0x20FF); | 90 TestSpecificUCharRange(0x20D0, 0x20FF); |
| 91 TestSpecificUCharRange(0x2CEF, 0x2CF1); | 91 TestSpecificUCharRange(0x2CEF, 0x2CF1); |
| 92 TestSpecificUCharRange(0x302A, 0x302F); | 92 TestSpecificUCharRange(0x302A, 0x302F); |
| 93 | 93 |
| 94 TestSpecificUCharRange(0xA67C, 0xA67D); | 94 TestSpecificUCharRange(0xA67C, 0xA67D); |
| 95 TestSpecificUCharRange(0xA6F0, 0xA6F1); | 95 TestSpecificUCharRange(0xA6F0, 0xA6F1); |
| 96 TestSpecificUCharRange(0xA800, 0xABFF); | 96 TestSpecificUCharRange(0xA800, 0xABFF); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c1, 2)); | 152 EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c1, 2)); |
| 153 // Complex-Simple is Complex | 153 // Complex-Simple is Complex |
| 154 static UChar c2[] = { 0x300, 0x2FF }; | 154 static UChar c2[] = { 0x300, 0x2FF }; |
| 155 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c2, 2)); | 155 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c2, 2)); |
| 156 // Simple-Complex is Complex | 156 // Simple-Complex is Complex |
| 157 static UChar c3[] = { 0x2FF, 0x330 }; | 157 static UChar c3[] = { 0x2FF, 0x330 }; |
| 158 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c3, 2)); | 158 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c3, 2)); |
| 159 // Complex-Complex is Complex | 159 // Complex-Complex is Complex |
| 160 static UChar c4[] = { 0x36F, 0x330 }; | 160 static UChar c4[] = { 0x36F, 0x330 }; |
| 161 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c4, 2)); | 161 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c4, 2)); |
| 162 // SimpleWithGlyphOverflow-Simple is SimpleWithGlyphOverflow | |
| 163 static UChar c5[] = { 0x1E00, 0x2FF }; | |
| 164 EXPECT_EQ(SimpleWithGlyphOverflowPath, Character::characterRangeCodePath(c5,
2)); | |
| 165 // Simple-SimpleWithGlyphOverflow is SimpleWithGlyphOverflow | |
| 166 static UChar c6[] = { 0x2FF, 0x2000 }; | |
| 167 EXPECT_EQ(SimpleWithGlyphOverflowPath, Character::characterRangeCodePath(c6,
2)); | |
| 168 // SimpleWithGlyphOverflow-Complex is Complex | |
| 169 static UChar c7[] = { 0x1E00, 0x330 }; | |
| 170 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c7, 2)); | |
| 171 // Complex-SimpleWithGlyphOverflow is Complex | |
| 172 static UChar c8[] = { 0x330, 0x2000 }; | |
| 173 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c8, 2)); | |
| 174 // Surrogate-Complex is Complex | 162 // Surrogate-Complex is Complex |
| 175 static UChar c9[] = { 0xD83C, 0xDDE5, 0x330 }; | 163 static UChar c5[] = { 0xD83C, 0xDDE5, 0x330 }; |
| 176 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c9, 3)); | 164 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c5, 3)); |
| 177 // Complex-Surrogate is Complex | 165 // Complex-Surrogate is Complex |
| 178 static UChar c10[] = { 0x330, 0xD83C, 0xDDE5 }; | 166 static UChar c6[] = { 0x330, 0xD83C, 0xDDE5 }; |
| 179 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c10, 3)); | 167 EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c6, 3)); |
| 180 } | 168 } |
| 181 | 169 |
| 182 static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, UChar32 rangeE
nd) | 170 static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, UChar32 rangeE
nd) |
| 183 { | 171 { |
| 184 EXPECT_FALSE(Character::isCJKIdeograph(rangeStart - 1)); | 172 EXPECT_FALSE(Character::isCJKIdeograph(rangeStart - 1)); |
| 185 EXPECT_TRUE(Character::isCJKIdeograph(rangeStart)); | 173 EXPECT_TRUE(Character::isCJKIdeograph(rangeStart)); |
| 186 EXPECT_TRUE(Character::isCJKIdeograph((UChar32)((uint64_t)rangeStart + (uint
64_t)rangeEnd) / 2)); | 174 EXPECT_TRUE(Character::isCJKIdeograph((UChar32)((uint64_t)rangeStart + (uint
64_t)rangeEnd) / 2)); |
| 187 EXPECT_TRUE(Character::isCJKIdeograph(rangeEnd)); | 175 EXPECT_TRUE(Character::isCJKIdeograph(rangeEnd)); |
| 188 EXPECT_FALSE(Character::isCJKIdeograph(rangeEnd + 1)); | 176 EXPECT_FALSE(Character::isCJKIdeograph(rangeEnd + 1)); |
| 189 } | 177 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 345 |
| 358 TestSpecificUChar32RangeIdeographSymbol(0x1F110, 0x1F129); | 346 TestSpecificUChar32RangeIdeographSymbol(0x1F110, 0x1F129); |
| 359 TestSpecificUChar32RangeIdeographSymbol(0x1F130, 0x1F149); | 347 TestSpecificUChar32RangeIdeographSymbol(0x1F130, 0x1F149); |
| 360 TestSpecificUChar32RangeIdeographSymbol(0x1F150, 0x1F169); | 348 TestSpecificUChar32RangeIdeographSymbol(0x1F150, 0x1F169); |
| 361 TestSpecificUChar32RangeIdeographSymbol(0x1F170, 0x1F189); | 349 TestSpecificUChar32RangeIdeographSymbol(0x1F170, 0x1F189); |
| 362 TestSpecificUChar32RangeIdeographSymbol(0x1F200, 0x1F6FF); | 350 TestSpecificUChar32RangeIdeographSymbol(0x1F200, 0x1F6FF); |
| 363 } | 351 } |
| 364 | 352 |
| 365 } // namespace blink | 353 } // namespace blink |
| 366 | 354 |
| OLD | NEW |