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

Unified Diff: components/autofill/core/common/autofill_regexes_unittest.cc

Issue 2478463002: Reland of place for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/common/autofill_regexes_unittest.cc
diff --git a/components/autofill/core/common/autofill_regexes_unittest.cc b/components/autofill/core/common/autofill_regexes_unittest.cc
index bf1c4250da63a6930ae5fb446f4e6d2ab5b87bc2..107830d52d1b39051ea6dac1613f1faf88f311e9 100644
--- a/components/autofill/core/common/autofill_regexes_unittest.cc
+++ b/components/autofill/core/common/autofill_regexes_unittest.cc
@@ -37,8 +37,7 @@
// Case-insensitive
{"StRiNg", "string"},
};
- for (size_t i = 0; i < arraysize(kPositiveCases); ++i) {
- const TestCase& test_case = kPositiveCases[i];
+ for (const auto& test_case : kPositiveCases) {
SCOPED_TRACE(test_case.input);
SCOPED_TRACE(test_case.pattern);
EXPECT_TRUE(MatchesPattern(ASCIIToUTF16(test_case.input),
@@ -57,8 +56,7 @@
{"string", "ring "},
{"string", "rin$"},
};
- for (size_t i = 0; i < arraysize(kNegativeCases); ++i) {
- const TestCase& test_case = kNegativeCases[i];
+ for (const auto& test_case : kNegativeCases) {
SCOPED_TRACE(test_case.input);
SCOPED_TRACE(test_case.pattern);
EXPECT_FALSE(MatchesPattern(ASCIIToUTF16(test_case.input),
@@ -97,8 +95,7 @@
{"Exp Date (MM / YY)"},
};
- for (size_t i = 0; i < arraysize(kPositiveCases); ++i) {
- const TestCase& test_case = kPositiveCases[i];
+ for (const auto& test_case : kPositiveCases) {
SCOPED_TRACE(test_case.input);
EXPECT_TRUE(MatchesPattern(ASCIIToUTF16(test_case.input),pattern));
}
@@ -132,8 +129,7 @@
{"Exp Date (MM / YYYY)"},
};
- for (size_t i = 0; i < arraysize(kNegativeCases); ++i) {
- const TestCase& test_case = kNegativeCases[i];
+ for (const auto& test_case : kNegativeCases) {
SCOPED_TRACE(test_case.input);
EXPECT_FALSE(MatchesPattern(ASCIIToUTF16(test_case.input), pattern));
}
@@ -170,8 +166,7 @@
{"Exp Date (MM / YYYY)"},
};
- for (size_t i = 0; i < arraysize(kPositiveCases); ++i) {
- const TestCase& test_case = kPositiveCases[i];
+ for (const auto& test_case : kPositiveCases) {
SCOPED_TRACE(test_case.input);
EXPECT_TRUE(MatchesPattern(ASCIIToUTF16(test_case.input),pattern));
}
@@ -205,8 +200,7 @@
{"Exp Date (MM / YY)"},
};
- for (size_t i = 0; i < arraysize(kNegativeCases); ++i) {
- const TestCase& test_case = kNegativeCases[i];
+ for (const auto& test_case : kNegativeCases) {
SCOPED_TRACE(test_case.input);
EXPECT_FALSE(MatchesPattern(ASCIIToUTF16(test_case.input), pattern));
}

Powered by Google App Engine
This is Rietveld 408576698