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

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

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

Powered by Google App Engine
This is Rietveld 408576698