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

Unified Diff: components/autofill/core/browser/address_unittest.cc

Issue 2417783004: 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/browser/address_unittest.cc
diff --git a/components/autofill/core/browser/address_unittest.cc b/components/autofill/core/browser/address_unittest.cc
index d178f04ff2143744e29357b2977c50d7e7bf75fd..67d55cb058edfe03286cb9c59c0ac967012dc4eb 100644
--- a/components/autofill/core/browser/address_unittest.cc
+++ b/components/autofill/core/browser/address_unittest.cc
@@ -132,11 +132,10 @@ TEST_F(AddressTest, IsCountry) {
"United states",
"us"
};
- for (size_t i = 0; i < arraysize(kValidMatches); ++i) {
- SCOPED_TRACE(kValidMatches[i]);
+ for (const auto& valid_match : kValidMatches) {
vabr (Chromium) 2016/10/17 07:40:33 const char* valid_match...
jdoerrie 2016/10/17 08:42:27 Done.
+ SCOPED_TRACE(valid_match);
ServerFieldTypeSet matching_types;
- address.GetMatchingTypes(ASCIIToUTF16(kValidMatches[i]), "US",
- &matching_types);
+ address.GetMatchingTypes(ASCIIToUTF16(valid_match), "US", &matching_types);
ASSERT_EQ(1U, matching_types.size());
EXPECT_EQ(ADDRESS_HOME_COUNTRY, *matching_types.begin());
}
@@ -145,9 +144,9 @@ TEST_F(AddressTest, IsCountry) {
"United",
"Garbage"
};
- for (size_t i = 0; i < arraysize(kInvalidMatches); ++i) {
+ for (const auto& invalid_match : kInvalidMatches) {
vabr (Chromium) 2016/10/17 07:40:33 const char*
jdoerrie 2016/10/17 08:42:27 Done.
ServerFieldTypeSet matching_types;
- address.GetMatchingTypes(ASCIIToUTF16(kInvalidMatches[i]), "US",
+ address.GetMatchingTypes(ASCIIToUTF16(invalid_match), "US",
&matching_types);
EXPECT_EQ(0U, matching_types.size());
}

Powered by Google App Engine
This is Rietveld 408576698