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

Side by Side Diff: components/query_parser/snippet_unittest.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 12 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
« no previous file with comments | « components/query_parser/snippet.cc ('k') | components/rappor/bloom_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/query_parser/snippet.h" 5 #include "components/query_parser/snippet.h"
6 6
7 #include <stddef.h>
8
7 #include <algorithm> 9 #include <algorithm>
8 10
11 #include "base/macros.h"
9 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
11 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
12 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
13 16
14 namespace query_parser { 17 namespace query_parser {
15 namespace { 18 namespace {
16 19
17 // A sample document to compute snippets of. 20 // A sample document to compute snippets of.
18 // The \x bits after the first "Google" are UTF-8 of U+2122 TRADE MARK SIGN, 21 // The \x bits after the first "Google" are UTF-8 of U+2122 TRADE MARK SIGN,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 Snippet::ExtractMatchPositions(data[i].offsets_string, "0", &matches); 245 Snippet::ExtractMatchPositions(data[i].offsets_string, "0", &matches);
243 EXPECT_EQ(data[i].expected_match_count, matches.size()); 246 EXPECT_EQ(data[i].expected_match_count, matches.size());
244 for (size_t j = 0; j < data[i].expected_match_count; ++j) { 247 for (size_t j = 0; j < data[i].expected_match_count; ++j) {
245 EXPECT_EQ(data[i].expected_matches[2 * j], matches[j].first); 248 EXPECT_EQ(data[i].expected_matches[2 * j], matches[j].first);
246 EXPECT_EQ(data[i].expected_matches[2 * j + 1], matches[j].second); 249 EXPECT_EQ(data[i].expected_matches[2 * j + 1], matches[j].second);
247 } 250 }
248 } 251 }
249 } 252 }
250 253
251 } // namespace query_parser 254 } // namespace query_parser
OLDNEW
« no previous file with comments | « components/query_parser/snippet.cc ('k') | components/rappor/bloom_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698