Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/platform/text/BidiResolverTest.cpp

Issue 2811453002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/text (Closed)
Patch Set: fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 << bidi_test::nameFromParagraphDirection(paragraph_direction); 209 << bidi_test::nameFromParagraphDirection(paragraph_direction);
210 210
211 std::vector<int> actual_order; 211 std::vector<int> actual_order;
212 std::vector<int> actual_levels; 212 std::vector<int> actual_levels;
213 actual_levels.assign(input.size(), -1); 213 actual_levels.assign(input.size(), -1);
214 BidiCharacterRun* run = runs.FirstRun(); 214 BidiCharacterRun* run = runs.FirstRun();
215 while (run) { 215 while (run) {
216 // Blink's UBA just makes runs, the actual ordering of the display of 216 // Blink's UBA just makes runs, the actual ordering of the display of
217 // characters is handled later in our pipeline, so we fake it here: 217 // characters is handled later in our pipeline, so we fake it here:
218 bool reversed = run->Reversed(false); 218 bool reversed = run->Reversed(false);
219 ASSERT(run->Stop() >= run->Start()); 219 DCHECK_GE(run->Stop(), run->Start());
220 size_t length = run->Stop() - run->Start(); 220 size_t length = run->Stop() - run->Start();
221 for (size_t i = 0; i < length; i++) { 221 for (size_t i = 0; i < length; i++) {
222 int input_index = reversed ? run->Stop() - i - 1 : run->Start() + i; 222 int input_index = reversed ? run->Stop() - i - 1 : run->Start() + i;
223 if (!IsNonRenderedCodePoint(input[input_index])) 223 if (!IsNonRenderedCodePoint(input[input_index]))
224 actual_order.push_back(input_index); 224 actual_order.push_back(input_index);
225 // BidiTest.txt gives expected level data in the order of the original 225 // BidiTest.txt gives expected level data in the order of the original
226 // input. 226 // input.
227 actual_levels[input_index] = run->Level(); 227 actual_levels[input_index] = run->Level();
228 } 228 }
229 run = run->Next(); 229 run = run->Next();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 << runner.order_failures_ << " order failures."; 315 << runner.order_failures_ << " order failures.";
316 316
317 EXPECT_EQ(91660u, runner.tests_run_); 317 EXPECT_EQ(91660u, runner.tests_run_);
318 EXPECT_EQ(39u, runner.tests_skipped_); 318 EXPECT_EQ(39u, runner.tests_skipped_);
319 EXPECT_EQ(0u, runner.ignored_char_failures_); 319 EXPECT_EQ(0u, runner.ignored_char_failures_);
320 EXPECT_EQ(14533u, runner.level_failures_); 320 EXPECT_EQ(14533u, runner.level_failures_);
321 EXPECT_EQ(14533u, runner.order_failures_); 321 EXPECT_EQ(14533u, runner.order_failures_);
322 } 322 }
323 323
324 } // namespace blink 324 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/BidiResolver.h ('k') | third_party/WebKit/Source/platform/text/BidiRunList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698