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 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 << bidi_test::nameFromParagraphDirection(paragraphDirection); | 207 << bidi_test::nameFromParagraphDirection(paragraphDirection); |
208 | 208 |
209 std::vector<int> actualOrder; | 209 std::vector<int> actualOrder; |
210 std::vector<int> actualLevels; | 210 std::vector<int> actualLevels; |
211 actualLevels.assign(input.size(), -1); | 211 actualLevels.assign(input.size(), -1); |
212 BidiCharacterRun* run = runs.firstRun(); | 212 BidiCharacterRun* run = runs.firstRun(); |
213 while (run) { | 213 while (run) { |
214 // Blink's UBA just makes runs, the actual ordering of the display of | 214 // Blink's UBA just makes runs, the actual ordering of the display of |
215 // characters is handled later in our pipeline, so we fake it here: | 215 // characters is handled later in our pipeline, so we fake it here: |
216 bool reversed = run->reversed(false); | 216 bool reversed = run->reversed(false); |
217 ASSERT(run->stop() >= run->start()); | 217 DCHECK_GE(run->stop(), run->start()); |
218 size_t length = run->stop() - run->start(); | 218 size_t length = run->stop() - run->start(); |
219 for (size_t i = 0; i < length; i++) { | 219 for (size_t i = 0; i < length; i++) { |
220 int inputIndex = reversed ? run->stop() - i - 1 : run->start() + i; | 220 int inputIndex = reversed ? run->stop() - i - 1 : run->start() + i; |
221 if (!isNonRenderedCodePoint(input[inputIndex])) | 221 if (!isNonRenderedCodePoint(input[inputIndex])) |
222 actualOrder.push_back(inputIndex); | 222 actualOrder.push_back(inputIndex); |
223 // BidiTest.txt gives expected level data in the order of the original | 223 // BidiTest.txt gives expected level data in the order of the original |
224 // input. | 224 // input. |
225 actualLevels[inputIndex] = run->level(); | 225 actualLevels[inputIndex] = run->level(); |
226 } | 226 } |
227 run = run->next(); | 227 run = run->next(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 << runner.m_orderFailures << " order failures."; | 310 << runner.m_orderFailures << " order failures."; |
311 | 311 |
312 EXPECT_EQ(91660u, runner.m_testsRun); | 312 EXPECT_EQ(91660u, runner.m_testsRun); |
313 EXPECT_EQ(39u, runner.m_testsSkipped); | 313 EXPECT_EQ(39u, runner.m_testsSkipped); |
314 EXPECT_EQ(0u, runner.m_ignoredCharFailures); | 314 EXPECT_EQ(0u, runner.m_ignoredCharFailures); |
315 EXPECT_EQ(14533u, runner.m_levelFailures); | 315 EXPECT_EQ(14533u, runner.m_levelFailures); |
316 EXPECT_EQ(14533u, runner.m_orderFailures); | 316 EXPECT_EQ(14533u, runner.m_orderFailures); |
317 } | 317 } |
318 | 318 |
319 } // namespace blink | 319 } // namespace blink |
OLD | NEW |