From bb4306c68ecdaf99d896f50045126142f16dfdae Mon Sep 17 00:00:00 2001 From: Phi Hung Le Date: Fri, 23 Feb 2024 00:22:07 +0000 Subject: [PATCH] Add test cases. --- .../honest_majority_share_shuffle_utility_helper_test.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/cc/wfa/measurement/internal/duchy/protocol/share_shuffle/honest_majority_share_shuffle_utility_helper_test.cc b/src/test/cc/wfa/measurement/internal/duchy/protocol/share_shuffle/honest_majority_share_shuffle_utility_helper_test.cc index 0e00252ccd1..961c62f34b8 100644 --- a/src/test/cc/wfa/measurement/internal/duchy/protocol/share_shuffle/honest_majority_share_shuffle_utility_helper_test.cc +++ b/src/test/cc/wfa/measurement/internal/duchy/protocol/share_shuffle/honest_majority_share_shuffle_utility_helper_test.cc @@ -303,6 +303,13 @@ TEST(EstimateReach, VidSamplingIntervalWidthGreaterThanOneFails) { StatusIs(absl::StatusCode::kInvalidArgument, "interval width")); } +TEST(EstimateReach, ValidInputSucceeds) { + ASSERT_OK_AND_ASSIGN(int64_t reach_1, EstimateReach(10, 0.5)); + EXPECT_EQ(reach_1, 20); + ASSERT_OK_AND_ASSIGN(int64_t reach_2, EstimateReach(10, 1.0)); + EXPECT_EQ(reach_2, 10); +} + TEST(CombineSketchShares, EmptySketchSharesFails) { ShareShuffleSketchParams sketch_params; sketch_params.set_ring_modulus(kRingModulus);