| 445 | } |
| 446 | |
| 447 | void TestMerge() { |
| 448 | int num_null[2]; |
| 449 | random_numbers(2, 42, 0, 100, num_null); |
| 450 | |
| 451 | auto statistics1 = MakeStatistics<TestType>(this->schema_.Column(0)); |
| 452 | this->GenerateData(1000); |
| 453 | statistics1->Update(this->values_ptr_, this->values_.size() - num_null[0], |
| 454 | num_null[0]); |
| 455 | |
| 456 | auto statistics2 = MakeStatistics<TestType>(this->schema_.Column(0)); |
| 457 | this->GenerateData(1000); |
| 458 | statistics2->Update(this->values_ptr_, this->values_.size() - num_null[1], |
| 459 | num_null[1]); |
| 460 | |
| 461 | auto total = MakeStatistics<TestType>(this->schema_.Column(0)); |
| 462 | total->Merge(*statistics1); |
| 463 | total->Merge(*statistics2); |
| 464 | |
| 465 | ASSERT_EQ(num_null[0] + num_null[1], total->null_count()); |
| 466 | ASSERT_EQ(this->values_.size() * 2 - num_null[0] - num_null[1], total->num_values()); |
| 467 | ASSERT_EQ(total->min(), std::min(statistics1->min(), statistics2->min())); |
| 468 | ASSERT_EQ(total->max(), std::max(statistics1->max(), statistics2->max())); |
| 469 | } |
| 470 | |
| 471 | void TestEquals() { |
| 472 | const auto n_values = 1; |
no test coverage detected