OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 Yandex LLC. All rights reserved. | 2 * Copyright (c) 2013 Yandex LLC. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 isTestFirstAndLastCharsInCategoryFailed = true; | 51 isTestFirstAndLastCharsInCategoryFailed = true; |
52 | 52 |
53 // Break enumeration process | 53 // Break enumeration process |
54 return 0; | 54 return 0; |
55 } | 55 } |
56 | 56 |
57 return 1; | 57 return 1; |
58 } | 58 } |
59 | 59 |
60 TEST(UnicodeUtilitiesTest, Separators) { | 60 TEST(UnicodeUtilitiesTest, Separators) { |
61 static const bool | 61 // clang-format off |
62 latinSeparatorTable | 62 static const bool latinSeparatorTable[256] = { |
63 [kMaxLatinCharCount] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 63 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
64 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 64 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
65 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 65 // space ! " # $ % & ' ( ) * + , - . / |
66 1, 1, 1, // space ! " # $ % & ' ( ) * + , - .
/ | 66 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
67 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, | 81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
82 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, | 82 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, |
83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, | 84 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 |
85 0, 0, 0, 0, 0, 0, 0, 0}; | 85 }; |
| 86 // clang-format on |
86 | 87 |
87 for (UChar32 character = 0; character < kMaxLatinCharCount; ++character) { | 88 for (UChar32 character = 0; character < kMaxLatinCharCount; ++character) { |
88 EXPECT_EQ(isSeparator(character), latinSeparatorTable[character]); | 89 EXPECT_EQ(isSeparator(character), latinSeparatorTable[character]); |
89 } | 90 } |
90 | 91 |
91 isTestFirstAndLastCharsInCategoryFailed = false; | 92 isTestFirstAndLastCharsInCategoryFailed = false; |
92 u_enumCharTypes(&testFirstAndLastCharsInCategory, 0); | 93 u_enumCharTypes(&testFirstAndLastCharsInCategory, 0); |
93 EXPECT_FALSE(isTestFirstAndLastCharsInCategoryFailed); | 94 EXPECT_FALSE(isTestFirstAndLastCharsInCategoryFailed); |
94 } | 95 } |
95 | 96 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, | 243 voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, |
243 WTF_ARRAY_LENGTH(voicedKanaString2))); | 244 WTF_ARRAY_LENGTH(voicedKanaString2))); |
244 | 245 |
245 voicedKanaString2[0] = 0x3043; | 246 voicedKanaString2[0] = 0x3043; |
246 EXPECT_FALSE(checkKanaStringsEqual( | 247 EXPECT_FALSE(checkKanaStringsEqual( |
247 voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, | 248 voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, |
248 WTF_ARRAY_LENGTH(voicedKanaString2))); | 249 WTF_ARRAY_LENGTH(voicedKanaString2))); |
249 } | 250 } |
250 | 251 |
251 } // namespace blink | 252 } // namespace blink |
OLD | NEW |