@@ -575,7 +575,10 @@ TEST(SketchColumnTestSuite, TestMergeResizing) {
575575 }
576576 ASSERT_EQ (column1.capacity , 10 );
577577 column1.merge (column2);
578- ASSERT_EQ (column1.capacity , column2.capacity );
578+ ASSERT_LE (column1.capacity , column2.capacity );
579+ ASSERT_GE (column1.capacity , 1 );
580+ auto sample = column1.sample ();
581+ ASSERT_EQ (sample.result , GOOD);
579582}
580583
581584// as we insert more unique items, maximum nonzero bucket depth should never decrease
@@ -606,7 +609,7 @@ TEST(SketchColumnTestSuite, TestClear) {
606609 auto sample = column.sample ();
607610 ASSERT_EQ (sample.result , GOOD);
608611 column.clear ();
609- for (size_t i = 0 ; i < capacity; i++) {
612+ for (size_t i = 0 ; i < column. capacity ; i++) {
610613 bool good = Bucket_Boruvka::is_empty (column.buckets [i]);
611614 ASSERT_EQ (good, true );
612615 }
@@ -624,7 +627,7 @@ TEST(SketchColumnTestSuite, TestClearMerge) {
624627 }
625628 column1.merge (column2);
626629 column2.clear ();
627- for (size_t i = 0 ; i < capacity; i++) {
630+ for (size_t i = 0 ; i < column2. capacity ; i++) {
628631 bool good = Bucket_Boruvka::is_empty (column2.buckets [i]);
629632 ASSERT_EQ (good, true );
630633 }
@@ -640,7 +643,7 @@ TEST(SketchColumnTestSuite, TestClearMerge) {
640643 }
641644 column3.merge (column4);
642645 column3.clear ();
643- for (size_t i = 0 ; i < capacity; i++) {
646+ for (size_t i = 0 ; i < column3. capacity ; i++) {
644647 bool empty = Bucket_Boruvka::is_empty (column3.buckets [i]);
645648 ASSERT_EQ (empty, true );
646649 }
0 commit comments