diff options
author | Abseil Team <absl-team@google.com> | 2019-11-21 10:30:22 -0800 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-11-22 11:35:22 -0500 |
commit | 16d9fd58a51c6083234e2e9f8f50e49ed5ed02e4 (patch) | |
tree | c4d5da856d0ee16401bb6d9694c998e51b2f604c /absl/base/internal/periodic_sampler_test.cc | |
parent | bcaae6009c0833b73c6fa7bdd972921d8081a724 (diff) |
Export of internal Abseil changes
--
db8dbd0e8a7b0125a4819dfc81c9bd2496849c71 by Abseil Team <absl-team@google.com>:
Create GetSkipCount() and GetStride() methods and add rounding bias correction.
PiperOrigin-RevId: 281780897
GitOrigin-RevId: db8dbd0e8a7b0125a4819dfc81c9bd2496849c71
Change-Id: I56a97288b1cb38a9357c065747f8d9bc4b187fee
Diffstat (limited to 'absl/base/internal/periodic_sampler_test.cc')
-rw-r--r-- | absl/base/internal/periodic_sampler_test.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/absl/base/internal/periodic_sampler_test.cc b/absl/base/internal/periodic_sampler_test.cc index 1ba61377..29f4d24d 100644 --- a/absl/base/internal/periodic_sampler_test.cc +++ b/absl/base/internal/periodic_sampler_test.cc @@ -42,9 +42,9 @@ TEST(PeriodicSamplerBaseTest, Sample) { EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(16)); EXPECT_CALL(sampler, GetExponentialBiased(16)) - .WillOnce(Return(1)) .WillOnce(Return(2)) - .WillOnce(Return(3)); + .WillOnce(Return(3)) + .WillOnce(Return(4)); EXPECT_FALSE(sampler.Sample()); EXPECT_TRUE(sampler.Sample()); @@ -63,9 +63,9 @@ TEST(PeriodicSamplerBaseTest, ImmediatelySample) { EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(16)); EXPECT_CALL(sampler, GetExponentialBiased(16)) - .WillOnce(Return(0)) .WillOnce(Return(1)) - .WillOnce(Return(2)); + .WillOnce(Return(2)) + .WillOnce(Return(3)); EXPECT_TRUE(sampler.Sample()); @@ -100,7 +100,7 @@ TEST(PeriodicSamplerBaseTest, Disable) { StrictMock<MockPeriodicSampler> sampler; EXPECT_CALL(sampler, period()).WillOnce(Return(16)); - EXPECT_CALL(sampler, GetExponentialBiased(16)).WillOnce(Return(2)); + EXPECT_CALL(sampler, GetExponentialBiased(16)).WillOnce(Return(3)); EXPECT_FALSE(sampler.Sample()); EXPECT_FALSE(sampler.Sample()); @@ -119,7 +119,7 @@ TEST(PeriodicSamplerBaseTest, Enable) { EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(16)); EXPECT_CALL(sampler, GetExponentialBiased(16)) .Times(2) - .WillRepeatedly(Return(2)); + .WillRepeatedly(Return(3)); EXPECT_FALSE(sampler.Sample()); EXPECT_FALSE(sampler.Sample()); |