@@ -246,9 +246,28 @@ TEST(aggregation, Base2ExponentialHistogramAggregation)
246
246
EXPECT_EQ (histo_point.scale_ , SCALE0);
247
247
EXPECT_EQ (histo_point.max_buckets_ , MAX_BUCKETS0);
248
248
ASSERT_TRUE (histo_point.positive_buckets_ .Empty ());
249
+ ASSERT_TRUE (histo_point.negative_buckets_ .Empty ());
250
+
251
+ // Create a new aggreagte based in point data
252
+ {
253
+ auto point_data = histo_point;
254
+ Base2ExponentialHistogramAggregation scale0_aggr2 (point_data);
255
+ scale0_aggr2.Aggregate (0.0 , {});
256
+
257
+ auto histo_point2 = nostd::get<Base2ExponentialHistogramPointData>(point);
258
+ EXPECT_EQ (histo_point2.count_ , 0 );
259
+ EXPECT_EQ (histo_point2.sum_ , 0.0 );
260
+ EXPECT_EQ (histo_point2.zero_count_ , 0 );
261
+ EXPECT_EQ (histo_point2.min_ , (std::numeric_limits<double >::max)());
262
+ EXPECT_EQ (histo_point2.max_ , (std::numeric_limits<double >::min)());
263
+ EXPECT_EQ (histo_point2.scale_ , SCALE0);
264
+ EXPECT_EQ (histo_point2.max_buckets_ , MAX_BUCKETS0);
265
+ ASSERT_TRUE (histo_point2.positive_buckets_ .Empty ());
266
+ ASSERT_TRUE (histo_point2.negative_buckets_ .Empty ());
267
+ }
249
268
250
269
// zero point
251
- scale0_aggr.Aggregate (0.0 , {});
270
+ scale0_aggr.Aggregate (static_cast < int64_t >( 0.0 ) , {});
252
271
histo_point = nostd::get<Base2ExponentialHistogramPointData>(scale0_aggr.ToPoint ());
253
272
EXPECT_EQ (histo_point.count_ , 1 );
254
273
EXPECT_EQ (histo_point.zero_count_ , 1 );
0 commit comments