Lines Matching refs:absl
33 absl::MockingBitGen gen; in TEST()
35 EXPECT_NE(absl::Uniform<int>(gen, 1, 1000000), 20); in TEST()
36 EXPECT_CALL(absl::MockUniform<int>(), Call(gen, 1, 1000000)) in TEST()
38 EXPECT_EQ(absl::Uniform<int>(gen, 1, 1000000), 20); in TEST()
40 EXPECT_NE(absl::Uniform<double>(gen, 0.0, 100.0), 5.0); in TEST()
41 EXPECT_CALL(absl::MockUniform<double>(), Call(gen, 0.0, 100.0)) in TEST()
43 EXPECT_EQ(absl::Uniform<double>(gen, 0.0, 100.0), 5.0); in TEST()
45 EXPECT_NE(absl::Exponential<double>(gen, 1.0), 42); in TEST()
46 EXPECT_CALL(absl::MockExponential<double>(), Call(gen, 1.0)) in TEST()
48 EXPECT_EQ(absl::Exponential<double>(gen, 1.0), 42); in TEST()
50 EXPECT_NE(absl::Poisson<int>(gen, 1.0), 500); in TEST()
51 EXPECT_CALL(absl::MockPoisson<int>(), Call(gen, 1.0)).WillOnce(Return(500)); in TEST()
52 EXPECT_EQ(absl::Poisson<int>(gen, 1.0), 500); in TEST()
54 EXPECT_NE(absl::Bernoulli(gen, 0.000001), true); in TEST()
55 EXPECT_CALL(absl::MockBernoulli(), Call(gen, 0.000001)) in TEST()
57 EXPECT_EQ(absl::Bernoulli(gen, 0.000001), true); in TEST()
59 EXPECT_NE(absl::Zipf<int>(gen, 1000000, 2.0, 1.0), 1221); in TEST()
60 EXPECT_CALL(absl::MockZipf<int>(), Call(gen, 1000000, 2.0, 1.0)) in TEST()
62 EXPECT_EQ(absl::Zipf<int>(gen, 1000000, 2.0, 1.0), 1221); in TEST()
64 EXPECT_NE(absl::Gaussian<double>(gen, 0.0, 1.0), 0.001); in TEST()
65 EXPECT_CALL(absl::MockGaussian<double>(), Call(gen, 0.0, 1.0)) in TEST()
67 EXPECT_EQ(absl::Gaussian<double>(gen, 0.0, 1.0), 0.001); in TEST()
69 EXPECT_NE(absl::LogUniform<int>(gen, 0, 1000000, 2), 500000); in TEST()
70 EXPECT_CALL(absl::MockLogUniform<int>(), Call(gen, 0, 1000000, 2)) in TEST()
72 EXPECT_EQ(absl::LogUniform<int>(gen, 0, 1000000, 2), 500000); in TEST()
76 absl::MockingBitGen gen; in TEST()
78 EXPECT_NE(absl::Uniform<int>(gen, 1, 1000000), 20); in TEST()
79 ON_CALL(absl::MockUniform<int>(), Call(gen, 1, 1000000)) in TEST()
81 EXPECT_EQ(absl::Uniform<int>(gen, 1, 1000000), 20); in TEST()
83 EXPECT_NE(absl::Uniform<double>(gen, 0.0, 100.0), 5.0); in TEST()
84 ON_CALL(absl::MockUniform<double>(), Call(gen, 0.0, 100.0)) in TEST()
86 EXPECT_EQ(absl::Uniform<double>(gen, 0.0, 100.0), 5.0); in TEST()
88 EXPECT_NE(absl::Exponential<double>(gen, 1.0), 42); in TEST()
89 ON_CALL(absl::MockExponential<double>(), Call(gen, 1.0)) in TEST()
91 EXPECT_EQ(absl::Exponential<double>(gen, 1.0), 42); in TEST()
93 EXPECT_NE(absl::Poisson<int>(gen, 1.0), 500); in TEST()
94 ON_CALL(absl::MockPoisson<int>(), Call(gen, 1.0)).WillByDefault(Return(500)); in TEST()
95 EXPECT_EQ(absl::Poisson<int>(gen, 1.0), 500); in TEST()
97 EXPECT_NE(absl::Bernoulli(gen, 0.000001), true); in TEST()
98 ON_CALL(absl::MockBernoulli(), Call(gen, 0.000001)) in TEST()
100 EXPECT_EQ(absl::Bernoulli(gen, 0.000001), true); in TEST()
102 EXPECT_NE(absl::Zipf<int>(gen, 1000000, 2.0, 1.0), 1221); in TEST()
103 ON_CALL(absl::MockZipf<int>(), Call(gen, 1000000, 2.0, 1.0)) in TEST()
105 EXPECT_EQ(absl::Zipf<int>(gen, 1000000, 2.0, 1.0), 1221); in TEST()
107 EXPECT_NE(absl::Gaussian<double>(gen, 0.0, 1.0), 0.001); in TEST()
108 ON_CALL(absl::MockGaussian<double>(), Call(gen, 0.0, 1.0)) in TEST()
110 EXPECT_EQ(absl::Gaussian<double>(gen, 0.0, 1.0), 0.001); in TEST()
112 EXPECT_NE(absl::LogUniform<int>(gen, 0, 1000000, 2), 2040); in TEST()
113 ON_CALL(absl::MockLogUniform<int>(), Call(gen, 0, 1000000, 2)) in TEST()
115 EXPECT_EQ(absl::LogUniform<int>(gen, 0, 1000000, 2), 2040); in TEST()
119 absl::MockingBitGen gen; in TEST()
121 EXPECT_NE(absl::Zipf<int>(gen, 1000000, 2.0, 1.0), 1221); in TEST()
122 ON_CALL(absl::MockZipf<int>(), Call(gen, 1000000, 2.0, 1.0)) in TEST()
124 EXPECT_EQ(absl::Zipf<int>(gen, 1000000, 2.0, 1.0), 1221); in TEST()
128 absl::MockingBitGen gen; in TEST()
130 EXPECT_CALL(absl::MockUniform<int>(), Call(gen, 1, 10000)) in TEST()
134 EXPECT_EQ(absl::Uniform(gen, 1, 10000), 20); in TEST()
135 EXPECT_EQ(absl::Uniform(gen, 1, 10000), 40); in TEST()
136 EXPECT_EQ(absl::Uniform(gen, 1, 10000), 60); in TEST()
140 absl::MockingBitGen gen; in TEST()
142 ON_CALL(absl::MockExponential<double>(), Call(gen, 1.0)) in TEST()
145 EXPECT_EQ(absl::Exponential<double>(gen), 200); in TEST()
146 EXPECT_EQ(absl::Exponential<double>(gen, 1.0), 200); in TEST()
150 auto get_value = [](absl::BitGenRef gen_ref) { in TEST()
151 return absl::Uniform(gen_ref, 1, 1000000); in TEST()
153 absl::MockingBitGen unmocked_generator; in TEST()
154 absl::MockingBitGen mocked_with_3; in TEST()
155 absl::MockingBitGen mocked_with_11; in TEST()
157 EXPECT_CALL(absl::MockUniform<int>(), Call(mocked_with_3, 1, 1000000)) in TEST()
160 EXPECT_CALL(absl::MockUniform<int>(), Call(mocked_with_11, 1, 1000000)) in TEST()
177 absl::MockingBitGen gen; in TEST()
178 EXPECT_CALL(absl::MockUniform<uint32_t>(), Call(gen)).WillOnce(Return(42)); in TEST()
180 EXPECT_NE(absl::Uniform<uint16_t>(gen), 42); // Not mocked in TEST()
181 EXPECT_EQ(absl::Uniform<uint32_t>(gen), 42); // Mock triggered in TEST()
187 absl::MockingBitGen gen; in TEST()
188 EXPECT_CALL(absl::MockExponential<double>(), Call(gen, 1.0)) in TEST()
196 absl::MockingBitGen gen; in TEST()
198 EXPECT_CALL(absl::MockUniform<int>(), in TEST()
199 Call(absl::IntervalClosed, gen, 1, 1000000)) in TEST()
201 EXPECT_NE(absl::Uniform(gen, 1, 1000000), 301); // Not mocked in TEST()
202 EXPECT_EQ(absl::Uniform(absl::IntervalClosed, gen, 1, 1000000), 301); in TEST()
206 absl::MockingBitGen gen; in TEST()
207 EXPECT_CALL(absl::MockUniform<uint32_t>(), Call(gen)).WillOnce(Return(42)); in TEST()
208 EXPECT_EQ(absl::Uniform<uint32_t>(gen), 42); in TEST()
212 auto roll_some_dice = [](absl::BitGenRef gen_ref) { in TEST()
215 r = absl::Uniform(absl::IntervalClosed, gen_ref, 1, 6); in TEST()
220 absl::MockingBitGen gen; in TEST()
228 ON_CALL(absl::MockUniform<int>(), Call(absl::IntervalClosed, gen, 1, 6)) in TEST()
236 absl::MockingBitGen gen; in TEST()
237 EXPECT_CALL(absl::MockUniform<int>(), Call(gen, 1, 1000000)) in TEST()
240 EXPECT_CALL(absl::MockUniform<int>(), Call(gen, 1000001, 2000000)) in TEST()
243 EXPECT_EQ(absl::Uniform(gen, 1000001, 2000000), 1); in TEST()
244 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 0); in TEST()
245 EXPECT_EQ(absl::Uniform(gen, 1000001, 2000000), 1); in TEST()
246 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 0); in TEST()
247 EXPECT_EQ(absl::Uniform(gen, 1000001, 2000000), 1); in TEST()
248 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 0); in TEST()
254 absl::MockingBitGen gen; in TEST()
255 EXPECT_CALL(absl::MockUniform<int>(), Call(gen, 1, 1000000)) in TEST()
260 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 15); in TEST()
261 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 15); in TEST()
262 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 15); in TEST()
265 EXPECT_NE(absl::Uniform(gen, 1, 1000000), 15); in TEST()
271 absl::MockingBitGen gen; in TEST()
272 EXPECT_CALL(absl::MockBernoulli(), Call(gen, 0.0)).Times(0); in TEST()
273 EXPECT_CALL(absl::MockPoisson<int>(), Call(gen, 1.0)).Times(0); in TEST()
280 absl::MockingBitGen gen; in TEST()
281 ON_CALL(absl::MockUniform<int>(), Call(absl::IntervalClosed, gen, _, 1000)) in TEST()
283 ON_CALL(absl::MockUniform<int>(), in TEST()
284 Call(absl::IntervalClosed, gen, _, Ne(1000))) in TEST()
287 EXPECT_EQ(absl::Uniform(absl::IntervalClosed, gen, 10, 1000000), 99); in TEST()
288 EXPECT_EQ(absl::Uniform(absl::IntervalClosed, gen, 10, 1000), 11); in TEST()
292 absl::MockingBitGen gen; in TEST()
293 ON_CALL(absl::MockUniform<int>(), Call(gen, 1, _)) in TEST()
295 ON_CALL(absl::MockUniform<int>(), Call(gen, Ne(1), _)) in TEST()
297 EXPECT_EQ(absl::Uniform(gen, 3, 1000000), 99); in TEST()
298 EXPECT_EQ(absl::Uniform(gen, 1, 1000000), 25); in TEST()
302 absl::MockingBitGen gen; in TEST()
303 ON_CALL(absl::MockUniform<int>(), Call(gen, _, _)) in TEST()
305 EXPECT_EQ(absl::Uniform(gen, 1, 1000), 145); in TEST()
306 EXPECT_EQ(absl::Uniform(gen, 10, 1000), 145); in TEST()
307 EXPECT_EQ(absl::Uniform(gen, 100, 1000), 145); in TEST()
313 absl::MockingBitGen gen; in TEST()
316 ON_CALL(absl::MockUniform<size_t>(), Call(gen, 0, _)) in TEST()
319 auto& elem = values[absl::Uniform(gen, 0u, values.size())]; in TEST()
327 absl::MockingBitGen gen; in TEST()
328 ON_CALL(absl::MockPoisson<int>(), Call(gen, _)) in TEST()
331 EXPECT_EQ(absl::Poisson<int>(gen, 1.7), 17); in TEST()
332 EXPECT_EQ(absl::Poisson<int>(gen, 0.03), 0); in TEST()
336 absl::MockingBitGen gen; in TEST()
340 EXPECT_CALL(absl::MockPoisson<int>(), Call(gen, 1.0)).WillOnce(Return(3)); in TEST()
341 EXPECT_CALL(absl::MockPoisson<int>(), Call(gen, 2.0)).WillOnce(Return(4)); in TEST()
343 EXPECT_EQ(absl::Poisson<int>(gen, 1.0), 3); in TEST()
344 EXPECT_EQ(absl::Poisson<int>(gen, 2.0), 4); in TEST()