Commit 1bb5022a authored by Byoungkown's avatar Byoungkown Committed by Commit Bot

[variations] Use base::size() instead of arraysize

arraysize is deprecated, we should use base::size() instead.
This cl clears a presubmit warnings.

Bug: 837308
Change-Id: I5479c0f16e6df0b43b617c0e15c6c28527c41cbd
Reviewed-on: https://chromium-review.googlesource.com/1213622Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Byoungkwon Ko <codeimpl@gmail.com>
Cr-Commit-Position: refs/heads/master@{#590160}
parent 59af5e55
......@@ -9,6 +9,7 @@
#include <string>
#include "base/macros.h"
#include "base/stl_util.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -31,11 +32,11 @@ TEST(CachingPermutedEntropyProviderTest, HasConsistentResults) {
// one. Loop over the trial names twice, to test that caching returns the
// expected results.
PermutedEntropyProvider provider(kEntropyValue, kMaxLowEntropySize);
for (size_t i = 0; i < 2 * arraysize(kTestTrialNames); ++i) {
for (size_t i = 0; i < 2 * base::size(kTestTrialNames); ++i) {
CachingPermutedEntropyProvider cached_provider(
&prefs, kEntropyValue, kMaxLowEntropySize);
const std::string trial_name =
kTestTrialNames[i % arraysize(kTestTrialNames)];
kTestTrialNames[i % base::size(kTestTrialNames)];
EXPECT_DOUBLE_EQ(provider.GetEntropyForTrial(trial_name, 0),
cached_provider.GetEntropyForTrial(trial_name, 0));
}
......@@ -43,9 +44,9 @@ TEST(CachingPermutedEntropyProviderTest, HasConsistentResults) {
// Now, do the same test re-using the same caching provider.
CachingPermutedEntropyProvider cached_provider(
&prefs, kEntropyValue, kMaxLowEntropySize);
for (size_t i = 0; i < 2 * arraysize(kTestTrialNames); ++i) {
for (size_t i = 0; i < 2 * base::size(kTestTrialNames); ++i) {
const std::string trial_name =
kTestTrialNames[i % arraysize(kTestTrialNames)];
kTestTrialNames[i % base::size(kTestTrialNames)];
EXPECT_DOUBLE_EQ(provider.GetEntropyForTrial(trial_name, 0),
cached_provider.GetEntropyForTrial(trial_name, 0));
}
......
......@@ -15,6 +15,7 @@
#include "base/guid.h"
#include "base/macros.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "components/variations/hashing.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -210,7 +211,7 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationSHA1) {
base::FieldTrial::ONE_TIME_RANDOMIZED, nullptr),
};
for (size_t i = 0; i < arraysize(trials); ++i) {
for (size_t i = 0; i < base::size(trials); ++i) {
for (int j = 0; j < 100; ++j)
trials[i]->AppendGroup(std::string(), 1);
}
......@@ -240,7 +241,7 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationPermuted) {
base::FieldTrial::ONE_TIME_RANDOMIZED, nullptr),
};
for (size_t i = 0; i < arraysize(trials); ++i) {
for (size_t i = 0; i < base::size(trials); ++i) {
for (int j = 0; j < 100; ++j)
trials[i]->AppendGroup(std::string(), 1);
}
......@@ -267,7 +268,7 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationWithCustomSeedPermuted) {
base::FieldTrial::ONE_TIME_RANDOMIZED, kCustomSeed, nullptr, nullptr),
};
for (size_t i = 0; i < arraysize(trials); ++i) {
for (size_t i = 0; i < base::size(trials); ++i) {
for (int j = 0; j < 100; ++j)
trials[i]->AppendGroup(std::string(), 1);
}
......@@ -294,7 +295,7 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationWithCustomSeedSHA1) {
base::FieldTrial::ONE_TIME_RANDOMIZED, kCustomSeed, nullptr, nullptr),
};
for (size_t i = 0; i < arraysize(trials); ++i) {
for (size_t i = 0; i < base::size(trials); ++i) {
for (int j = 0; j < 100; ++j)
trials[i]->AppendGroup(std::string(), 1);
}
......@@ -310,7 +311,7 @@ TEST(EntropyProviderTest, SHA1Entropy) {
GenerateSHA1Entropy("there", "1") };
EXPECT_NE(results[0], results[1]);
for (size_t i = 0; i < arraysize(results); ++i) {
for (size_t i = 0; i < base::size(results); ++i) {
EXPECT_LE(0.0, results[i]);
EXPECT_GT(1.0, results[i]);
}
......@@ -327,7 +328,7 @@ TEST(EntropyProviderTest, PermutedEntropy) {
GeneratePermutedEntropy(4321, kMaxLowEntropySize, "1") };
EXPECT_NE(results[0], results[1]);
for (size_t i = 0; i < arraysize(results); ++i) {
for (size_t i = 0; i < base::size(results); ++i) {
EXPECT_LE(0.0, results[i]);
EXPECT_GT(1.0, results[i]);
}
......@@ -352,14 +353,14 @@ TEST(EntropyProviderTest, PermutedEntropyProviderResults) {
}
TEST(EntropyProviderTest, SHA1EntropyIsUniform) {
for (size_t i = 0; i < arraysize(kTestTrialNames); ++i) {
for (size_t i = 0; i < base::size(kTestTrialNames); ++i) {
SHA1EntropyGenerator entropy_generator(kTestTrialNames[i]);
PerformEntropyUniformityTest(kTestTrialNames[i], entropy_generator);
}
}
TEST(EntropyProviderTest, PermutedEntropyIsUniform) {
for (size_t i = 0; i < arraysize(kTestTrialNames); ++i) {
for (size_t i = 0; i < base::size(kTestTrialNames); ++i) {
PermutedEntropyGenerator entropy_generator(kTestTrialNames[i]);
PerformEntropyUniformityTest(kTestTrialNames[i], entropy_generator);
}
......@@ -394,7 +395,7 @@ TEST(EntropyProviderTest, SeededRandGeneratorIsUniform) {
const int kMinAttempts = 1000;
const int kMaxAttempts = 1000000;
for (size_t i = 0; i < arraysize(kTestTrialNames); ++i) {
for (size_t i = 0; i < base::size(kTestTrialNames); ++i) {
const uint32_t seed = HashName(kTestTrialNames[i]);
internal::SeededRandGenerator rand_generator(seed);
......
......@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/metrics/field_trial.h"
#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "components/variations/variations_associated_data.h"
......@@ -75,7 +76,7 @@ TEST(ExperimentLabelsTest, ExtractNonVariationLabels) {
"experiment3=123|Tue, 21 Jan 2014 15:30:21 GMT"},
};
for (size_t i = 0; i < arraysize(test_cases); ++i) {
for (size_t i = 0; i < base::size(test_cases); ++i) {
std::string non_variation_labels = base::UTF16ToUTF8(
ExtractNonVariationLabels(
base::ASCIIToUTF16(test_cases[i].input_label)));
......
......@@ -8,6 +8,7 @@
#include <stdint.h>
#include "base/macros.h"
#include "base/stl_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace variations {
......@@ -26,7 +27,7 @@ TEST(HashingTest, HashName) {
{"abcdefghijklmonpqrstuvwxyz", 787728696u},
{"0123456789ABCDEF", 348858318U}};
for (size_t i = 0; i < arraysize(known_hashes); ++i) {
for (size_t i = 0; i < base::size(known_hashes); ++i) {
EXPECT_EQ(known_hashes[i].hash_value, HashName(known_hashes[i].name));
}
}
......
......@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "components/google/core/common/google_util.h"
#include "components/variations/variations_http_header_provider.h"
......@@ -73,12 +74,12 @@ bool IsGoogleDomain(const GURL& url) {
// Some domains don't have international TLD extensions, so testing for them
// is very straight forward.
const std::string host = url.host();
for (size_t i = 0; i < arraysize(kSuffixesToSetHeadersFor); ++i) {
for (size_t i = 0; i < base::size(kSuffixesToSetHeadersFor); ++i) {
if (base::EndsWith(host, kSuffixesToSetHeadersFor[i],
base::CompareCase::INSENSITIVE_ASCII))
return true;
}
for (size_t i = 0; i < arraysize(kHostsToSetHeadersFor); ++i) {
for (size_t i = 0; i < base::size(kHostsToSetHeadersFor); ++i) {
if (base::LowerCaseEqualsASCII(host, kHostsToSetHeadersFor[i]))
return true;
}
......
......@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/macros.h"
#include "base/stl_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
......@@ -146,7 +147,7 @@ TEST(VariationsHttpHeadersTest, ShouldAppendHeaders) {
{"https://a.b.googleweblight.com", false},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
for (size_t i = 0; i < base::size(cases); ++i) {
const GURL url(cases[i].url);
EXPECT_EQ(cases[i].should_append_headers, ShouldAppendVariationHeaders(url))
<< url;
......
......@@ -17,6 +17,7 @@
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/sha1.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
......@@ -459,7 +460,7 @@ TEST_F(VariationsServiceTest, SeedNotStoredWhenNonOKStatus) {
&prefs_, &network_tracker_),
&prefs_, GetMetricsStateManager(), true);
service.set_intercepts_fetch(false);
for (size_t i = 0; i < arraysize(non_ok_status_codes); ++i) {
for (size_t i = 0; i < base::size(non_ok_status_codes); ++i) {
EXPECT_TRUE(prefs_.FindPreference(prefs::kVariationsCompressedSeed)
->IsDefaultValue());
service.test_url_loader_factory()->ClearResponses();
......@@ -512,7 +513,7 @@ TEST_F(VariationsServiceTest, InstanceManipulations) {
std::string serialized_seed = SerializeSeed(CreateTestSeed());
VariationsService::EnableFetchForTesting();
for (size_t i = 0; i < arraysize(cases); ++i) {
for (size_t i = 0; i < base::size(cases); ++i) {
TestVariationsService service(
std::make_unique<web_resource::TestRequestAllowedNotifier>(
&prefs_, &network_tracker_),
......@@ -592,7 +593,7 @@ TEST_F(VariationsServiceTest, Observer) {
{1, 0, 1, 0, 1},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
for (size_t i = 0; i < base::size(cases); ++i) {
TestVariationsServiceObserver observer;
service.AddObserver(&observer);
......
......@@ -11,6 +11,7 @@
#include <vector>
#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/processed_study.h"
......@@ -46,20 +47,20 @@ TEST(VariationsStudyFilteringTest, CheckStudyChannel) {
const Study::Channel channels[] = {
Study::CANARY, Study::DEV, Study::BETA, Study::STABLE,
};
bool channel_added[arraysize(channels)] = { 0 };
bool channel_added[base::size(channels)] = {0};
Study::Filter filter;
// Check in the forwarded order. The loop cond is <= arraysize(channels)
// Check in the forwarded order. The loop cond is <= base::size(channels)
// instead of < so that the result of adding the last channel gets checked.
for (size_t i = 0; i <= arraysize(channels); ++i) {
for (size_t j = 0; j < arraysize(channels); ++j) {
for (size_t i = 0; i <= base::size(channels); ++i) {
for (size_t j = 0; j < base::size(channels); ++j) {
const bool expected = channel_added[j] || filter.channel_size() == 0;
const bool result = internal::CheckStudyChannel(filter, channels[j]);
EXPECT_EQ(expected, result) << "Case " << i << "," << j << " failed!";
}
if (i < arraysize(channels)) {
if (i < base::size(channels)) {
filter.add_channel(channels[i]);
channel_added[i] = true;
}
......@@ -68,15 +69,15 @@ TEST(VariationsStudyFilteringTest, CheckStudyChannel) {
// Do the same check in the reverse order.
filter.clear_channel();
memset(&channel_added, 0, sizeof(channel_added));
for (size_t i = 0; i <= arraysize(channels); ++i) {
for (size_t j = 0; j < arraysize(channels); ++j) {
for (size_t i = 0; i <= base::size(channels); ++i) {
for (size_t j = 0; j < base::size(channels); ++j) {
const bool expected = channel_added[j] || filter.channel_size() == 0;
const bool result = internal::CheckStudyChannel(filter, channels[j]);
EXPECT_EQ(expected, result) << "Case " << i << "," << j << " failed!";
}
if (i < arraysize(channels)) {
const int index = arraysize(channels) - i - 1;
if (i < base::size(channels)) {
const int index = base::size(channels) - i - 1;
filter.add_channel(channels[index]);
channel_added[index] = true;
}
......@@ -89,13 +90,13 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
};
ASSERT_EQ(Study::FormFactor_ARRAYSIZE,
static_cast<int>(arraysize(form_factors)));
static_cast<int>(base::size(form_factors)));
bool form_factor_added[arraysize(form_factors)] = { 0 };
bool form_factor_added[base::size(form_factors)] = {0};
Study::Filter filter;
for (size_t i = 0; i <= arraysize(form_factors); ++i) {
for (size_t j = 0; j < arraysize(form_factors); ++j) {
for (size_t i = 0; i <= base::size(form_factors); ++i) {
for (size_t j = 0; j < base::size(form_factors); ++j) {
const bool expected = form_factor_added[j] ||
filter.form_factor_size() == 0;
const bool result = internal::CheckStudyFormFactor(filter,
......@@ -104,7 +105,7 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
<< " failed!";
}
if (i < arraysize(form_factors)) {
if (i < base::size(form_factors)) {
filter.add_form_factor(form_factors[i]);
form_factor_added[i] = true;
}
......@@ -113,8 +114,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
// Do the same check in the reverse order.
filter.clear_form_factor();
memset(&form_factor_added, 0, sizeof(form_factor_added));
for (size_t i = 0; i <= arraysize(form_factors); ++i) {
for (size_t j = 0; j < arraysize(form_factors); ++j) {
for (size_t i = 0; i <= base::size(form_factors); ++i) {
for (size_t j = 0; j < base::size(form_factors); ++j) {
const bool expected = form_factor_added[j] ||
filter.form_factor_size() == 0;
const bool result = internal::CheckStudyFormFactor(filter,
......@@ -123,8 +124,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
<< " failed!";
}
if (i < arraysize(form_factors)) {
const int index = arraysize(form_factors) - i - 1;
if (i < base::size(form_factors)) {
const int index = base::size(form_factors) - i - 1;
filter.add_form_factor(form_factors[index]);
form_factor_added[index] = true;
}
......@@ -132,9 +133,9 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
// Test exclude_form_factors, forward order.
filter.clear_form_factor();
bool form_factor_excluded[arraysize(form_factors)] = { 0 };
for (size_t i = 0; i <= arraysize(form_factors); ++i) {
for (size_t j = 0; j < arraysize(form_factors); ++j) {
bool form_factor_excluded[base::size(form_factors)] = {0};
for (size_t i = 0; i <= base::size(form_factors); ++i) {
for (size_t j = 0; j < base::size(form_factors); ++j) {
const bool expected = filter.exclude_form_factor_size() == 0 ||
!form_factor_excluded[j];
const bool result = internal::CheckStudyFormFactor(filter,
......@@ -143,7 +144,7 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
<< j << " failed!";
}
if (i < arraysize(form_factors)) {
if (i < base::size(form_factors)) {
filter.add_exclude_form_factor(form_factors[i]);
form_factor_excluded[i] = true;
}
......@@ -152,8 +153,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
// Test exclude_form_factors, reverse order.
filter.clear_exclude_form_factor();
memset(&form_factor_excluded, 0, sizeof(form_factor_excluded));
for (size_t i = 0; i <= arraysize(form_factors); ++i) {
for (size_t j = 0; j < arraysize(form_factors); ++j) {
for (size_t i = 0; i <= base::size(form_factors); ++i) {
for (size_t j = 0; j < base::size(form_factors); ++j) {
const bool expected = filter.exclude_form_factor_size() == 0 ||
!form_factor_excluded[j];
const bool result = internal::CheckStudyFormFactor(filter,
......@@ -162,8 +163,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) {
<< j << " failed!";
}
if (i < arraysize(form_factors)) {
const int index = arraysize(form_factors) - i - 1;
if (i < base::size(form_factors)) {
const int index = base::size(form_factors) - i - 1;
filter.add_exclude_form_factor(form_factors[index]);
form_factor_excluded[index] = true;
}
......@@ -215,21 +216,21 @@ TEST(VariationsStudyFilteringTest, CheckStudyPlatform) {
Study::PLATFORM_LINUX, Study::PLATFORM_CHROMEOS,
Study::PLATFORM_ANDROID, Study::PLATFORM_IOS,
Study::PLATFORM_ANDROID_WEBVIEW, Study::PLATFORM_FUCHSIA};
ASSERT_EQ(Study::Platform_ARRAYSIZE, static_cast<int>(arraysize(platforms)));
bool platform_added[arraysize(platforms)] = { 0 };
ASSERT_EQ(Study::Platform_ARRAYSIZE, static_cast<int>(base::size(platforms)));
bool platform_added[base::size(platforms)] = {0};
Study::Filter filter;
// Check in the forwarded order. The loop cond is <= arraysize(platforms)
// Check in the forwarded order. The loop cond is <= base::size(platforms)
// instead of < so that the result of adding the last channel gets checked.
for (size_t i = 0; i <= arraysize(platforms); ++i) {
for (size_t j = 0; j < arraysize(platforms); ++j) {
for (size_t i = 0; i <= base::size(platforms); ++i) {
for (size_t j = 0; j < base::size(platforms); ++j) {
const bool expected = platform_added[j] || filter.platform_size() == 0;
const bool result = internal::CheckStudyPlatform(filter, platforms[j]);
EXPECT_EQ(expected, result) << "Case " << i << "," << j << " failed!";
}
if (i < arraysize(platforms)) {
if (i < base::size(platforms)) {
filter.add_platform(platforms[i]);
platform_added[i] = true;
}
......@@ -238,15 +239,15 @@ TEST(VariationsStudyFilteringTest, CheckStudyPlatform) {
// Do the same check in the reverse order.
filter.clear_platform();
memset(&platform_added, 0, sizeof(platform_added));
for (size_t i = 0; i <= arraysize(platforms); ++i) {
for (size_t j = 0; j < arraysize(platforms); ++j) {
for (size_t i = 0; i <= base::size(platforms); ++i) {
for (size_t j = 0; j < base::size(platforms); ++j) {
const bool expected = platform_added[j] || filter.platform_size() == 0;
const bool result = internal::CheckStudyPlatform(filter, platforms[j]);
EXPECT_EQ(expected, result) << "Case " << i << "," << j << " failed!";
}
if (i < arraysize(platforms)) {
const int index = arraysize(platforms) - i - 1;
if (i < base::size(platforms)) {
const int index = base::size(platforms) - i - 1;
filter.add_platform(platforms[index]);
platform_added[index] = true;
}
......@@ -288,7 +289,7 @@ TEST(VariationsStudyFilteringTest, CheckStudyStartDate) {
// Start date not set should result in true.
EXPECT_TRUE(internal::CheckStudyStartDate(filter, now));
for (size_t i = 0; i < arraysize(start_test_cases); ++i) {
for (size_t i = 0; i < base::size(start_test_cases); ++i) {
filter.set_start_date(TimeToProtoTime(start_test_cases[i].start_date));
const bool result = internal::CheckStudyStartDate(filter, now);
EXPECT_EQ(start_test_cases[i].expected_result, result)
......@@ -311,7 +312,7 @@ TEST(VariationsStudyFilteringTest, CheckStudyEndDate) {
// End date not set should result in true.
EXPECT_TRUE(internal::CheckStudyEndDate(filter, now));
for (size_t i = 0; i < arraysize(start_test_cases); ++i) {
for (size_t i = 0; i < base::size(start_test_cases); ++i) {
filter.set_end_date(TimeToProtoTime(start_test_cases[i].end_date));
const bool result = internal::CheckStudyEndDate(filter, now);
EXPECT_EQ(start_test_cases[i].expected_result, result) << "Case " << i
......@@ -366,7 +367,7 @@ TEST(VariationsStudyFilteringTest, CheckStudyVersion) {
// Min/max version not set should result in true.
EXPECT_TRUE(internal::CheckStudyVersion(filter, base::Version("1.2.3")));
for (size_t i = 0; i < arraysize(min_test_cases); ++i) {
for (size_t i = 0; i < base::size(min_test_cases); ++i) {
filter.set_min_version(min_test_cases[i].min_version);
const bool result = internal::CheckStudyVersion(
filter, base::Version(min_test_cases[i].version));
......@@ -375,7 +376,7 @@ TEST(VariationsStudyFilteringTest, CheckStudyVersion) {
}
filter.clear_min_version();
for (size_t i = 0; i < arraysize(max_test_cases); ++i) {
for (size_t i = 0; i < base::size(max_test_cases); ++i) {
filter.set_max_version(max_test_cases[i].max_version);
const bool result = internal::CheckStudyVersion(
filter, base::Version(max_test_cases[i].version));
......@@ -384,8 +385,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyVersion) {
}
// Check intersection semantics.
for (size_t i = 0; i < arraysize(min_test_cases); ++i) {
for (size_t j = 0; j < arraysize(max_test_cases); ++j) {
for (size_t i = 0; i < base::size(min_test_cases); ++i) {
for (size_t j = 0; j < base::size(max_test_cases); ++j) {
filter.set_min_version(min_test_cases[i].min_version);
filter.set_max_version(max_test_cases[j].max_version);
......@@ -635,7 +636,7 @@ TEST(VariationsStudyFilteringTest, IsStudyExpired) {
// Expiry date not set should result in false.
EXPECT_FALSE(internal::IsStudyExpired(study, now));
for (size_t i = 0; i < arraysize(expiry_test_cases); ++i) {
for (size_t i = 0; i < base::size(expiry_test_cases); ++i) {
study.set_expiry_date(TimeToProtoTime(expiry_test_cases[i].expiry_date));
const bool result = internal::IsStudyExpired(study, now);
EXPECT_EQ(expiry_test_cases[i].expected_result, result)
......
......@@ -17,6 +17,7 @@
#include "base/feature_list.h"
#include "base/format_macros.h"
#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
......@@ -641,7 +642,7 @@ TEST_F(VariationsSeedProcessorTest, FeatureEnabledOrDisableByTrial) {
{nullptr, kFeatureOffByDefault.name, false, true},
};
for (size_t i = 0; i < arraysize(test_cases); i++) {
for (size_t i = 0; i < base::size(test_cases); i++) {
const auto& test_case = test_cases[i];
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i));
......@@ -760,7 +761,7 @@ TEST_F(VariationsSeedProcessorTest, FeatureAssociationAndForcing) {
kForcedOffGroup, false, true},
};
for (size_t i = 0; i < arraysize(test_cases); i++) {
for (size_t i = 0; i < base::size(test_cases); i++) {
const auto& test_case = test_cases[i];
const int group = test_case.one_hundred_percent_group;
SCOPED_TRACE(base::StringPrintf(
......@@ -833,7 +834,7 @@ TEST_F(VariationsSeedProcessorTest, FeaturesInExpiredStudies) {
{kEnabledFeature, false, year_later, false},
};
for (size_t i = 0; i < arraysize(test_cases); i++) {
for (size_t i = 0; i < base::size(test_cases); i++) {
const auto& test_case = test_cases[i];
SCOPED_TRACE(
base::StringPrintf("Test[%" PRIuS "]: %s", i, test_case.feature.name));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment