| 378 | } |
| 379 | |
| 380 | void TestMerge() { |
| 381 | int num_null[2]; |
| 382 | random_numbers(2, 42, 0, 100, num_null); |
| 383 | |
| 384 | auto statistics1 = MakeStatistics<TestType>(this->schema_.Column(0)); |
| 385 | this->GenerateData(1000); |
| 386 | statistics1->Update(this->values_ptr_, this->values_.size() - num_null[0], |
| 387 | num_null[0]); |
| 388 | |
| 389 | auto statistics2 = MakeStatistics<TestType>(this->schema_.Column(0)); |
| 390 | this->GenerateData(1000); |
| 391 | statistics2->Update(this->values_ptr_, this->values_.size() - num_null[1], |
| 392 | num_null[1]); |
| 393 | |
| 394 | auto total = MakeStatistics<TestType>(this->schema_.Column(0)); |
| 395 | total->Merge(*statistics1); |
| 396 | total->Merge(*statistics2); |
| 397 | |
| 398 | ASSERT_EQ(num_null[0] + num_null[1], total->null_count()); |
| 399 | ASSERT_EQ(this->values_.size() * 2 - num_null[0] - num_null[1], total->num_values()); |
| 400 | ASSERT_EQ(total->min(), std::min(statistics1->min(), statistics2->min())); |
| 401 | ASSERT_EQ(total->max(), std::max(statistics1->max(), statistics2->max())); |
| 402 | } |
| 403 | |
| 404 | void TestEquals() { |
| 405 | const auto n_values = 1; |
no test coverage detected