diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-14 18:54:02 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-14 18:54:02 +0000 |
commit | a618550847f7c09eea7bb27e43bb226f330e5525 (patch) | |
tree | 6934dcf3e855b910887aa80958990939ca59d761 /chrome/browser/history/snippet_unittest.cc | |
parent | 2b99be2e12968b5d3d4f5818d6a76a8d42d818bc (diff) | |
download | chromium_src-a618550847f7c09eea7bb27e43bb226f330e5525.zip chromium_src-a618550847f7c09eea7bb27e43bb226f330e5525.tar.gz chromium_src-a618550847f7c09eea7bb27e43bb226f330e5525.tar.bz2 |
Port some unit tests in chrome/browser/
This first requires http://codereview.chromium.org/8618 .
Only snippet_unittest is enabled for build. For rest of files
it's only a platform cleanup.
Review URL: http://codereview.chromium.org/8191
Patch from Paweł Hajdan jr.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/snippet_unittest.cc')
-rw-r--r-- | chrome/browser/history/snippet_unittest.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/history/snippet_unittest.cc b/chrome/browser/history/snippet_unittest.cc index b137077..3208cf4 100644 --- a/chrome/browser/history/snippet_unittest.cc +++ b/chrome/browser/history/snippet_unittest.cc @@ -228,7 +228,7 @@ TEST(Snippets, DISABLED_ThaiUTF8) { TEST(Snippets, ExtractMatchPositions) { struct TestData { const std::string offsets_string; - const int expected_match_count; + const size_t expected_match_count; const int expected_matches[10]; } data[] = { { "0 0 1 2 0 0 4 1 0 0 1 5", 1, { 1,6 } }, @@ -242,11 +242,11 @@ TEST(Snippets, ExtractMatchPositions) { { "0 0 1 2 0 0 1 1", 1, { 1,3 } }, { "0 0 1 1 0 0 5 2 0 0 10 1 0 0 3 10", 2, { 1,2, 3,13 } }, }; - for (int i = 0; i < arraysize(data); ++i) { + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { Snippet::MatchPositions matches; Snippet::ExtractMatchPositions(data[i].offsets_string, "0", &matches); EXPECT_EQ(data[i].expected_match_count, matches.size()); - for (int j = 0; j < data[i].expected_match_count; ++j) { + for (size_t j = 0; j < data[i].expected_match_count; ++j) { EXPECT_EQ(data[i].expected_matches[2 * j], matches[j].first); EXPECT_EQ(data[i].expected_matches[2 * j + 1], matches[j].second); } |