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

Unified Diff: base/metrics/sample_vector_unittest.cc

Issue 1471073007: Reorganize histograms for persistence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: addressed review comments by Alexei Created 5 years 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
« no previous file with comments | « base/metrics/sample_vector.cc ('k') | base/metrics/sparse_histogram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/sample_vector_unittest.cc
diff --git a/base/metrics/sample_vector_unittest.cc b/base/metrics/sample_vector_unittest.cc
index fd4237666997ea96150fe1c4c4ab18b76d3918f6..8bd80dd0b5a7499e065f7db8bffd3d41b662fa5d 100644
--- a/base/metrics/sample_vector_unittest.cc
+++ b/base/metrics/sample_vector_unittest.cc
@@ -20,7 +20,7 @@ TEST(SampleVectorTest, AccumulateTest) {
ranges.set_range(0, 1);
ranges.set_range(1, 5);
ranges.set_range(2, 10);
- SampleVector samples(&ranges);
+ SampleVector samples(1, &ranges);
samples.Accumulate(1, 200);
samples.Accumulate(2, -300);
@@ -50,7 +50,7 @@ TEST(SampleVectorTest, AddSubtractTest) {
ranges.set_range(3, 3);
ranges.set_range(4, INT_MAX);
- SampleVector samples1(&ranges);
+ SampleVector samples1(1, &ranges);
samples1.Accumulate(0, 100);
samples1.Accumulate(2, 100);
samples1.Accumulate(4, 100);
@@ -58,7 +58,7 @@ TEST(SampleVectorTest, AddSubtractTest) {
EXPECT_EQ(300, samples1.TotalCount());
EXPECT_EQ(samples1.redundant_count(), samples1.TotalCount());
- SampleVector samples2(&ranges);
+ SampleVector samples2(2, &ranges);
samples2.Accumulate(1, 200);
samples2.Accumulate(2, 200);
samples2.Accumulate(4, 200);
@@ -91,7 +91,7 @@ TEST(SampleVectorDeathTest, BucketIndexTest) {
// [0, 1) [1, 2) [2, 4) [4, 8) [8, 16) [16, 32) [32, 64) [64, INT_MAX)
BucketRanges ranges(9);
Histogram::InitializeBucketRanges(1, 64, &ranges);
- SampleVector samples(&ranges);
+ SampleVector samples(1, &ranges);
// Normal case
samples.Accumulate(0, 1);
@@ -113,7 +113,7 @@ TEST(SampleVectorDeathTest, BucketIndexTest) {
ranges2.set_range(0, 1);
ranges2.set_range(1, 5);
ranges2.set_range(2, 10);
- SampleVector samples2(&ranges2);
+ SampleVector samples2(2, &ranges2);
// Normal case.
samples2.Accumulate(1, 1);
@@ -134,7 +134,7 @@ TEST(SampleVectorDeathTest, AddSubtractBucketNotMatchTest) {
ranges1.set_range(0, 1);
ranges1.set_range(1, 3);
ranges1.set_range(2, 5);
- SampleVector samples1(&ranges1);
+ SampleVector samples1(1, &ranges1);
// Custom buckets 2: [0, 1) [1, 3) [3, 6) [6, 7)
BucketRanges ranges2(5);
@@ -143,7 +143,7 @@ TEST(SampleVectorDeathTest, AddSubtractBucketNotMatchTest) {
ranges2.set_range(2, 3);
ranges2.set_range(3, 6);
ranges2.set_range(4, 7);
- SampleVector samples2(&ranges2);
+ SampleVector samples2(2, &ranges2);
samples2.Accumulate(1, 100);
samples1.Add(samples2);
@@ -209,7 +209,7 @@ TEST(SampleVectorIteratorTest, IterateTest) {
EXPECT_TRUE(it.Done());
// Create iterator from SampleVector.
- SampleVector samples(&ranges);
+ SampleVector samples(1, &ranges);
samples.Accumulate(0, 0);
samples.Accumulate(1, 1);
samples.Accumulate(2, 2);
@@ -239,7 +239,7 @@ TEST(SampleVectorIteratorDeathTest, IterateDoneTest) {
ranges.set_range(2, 2);
ranges.set_range(3, 3);
ranges.set_range(4, INT_MAX);
- SampleVector samples(&ranges);
+ SampleVector samples(1, &ranges);
scoped_ptr<SampleCountIterator> it = samples.Iterator();
« no previous file with comments | « base/metrics/sample_vector.cc ('k') | base/metrics/sparse_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698