| 90 | |
| 91 | template <typename T> |
| 92 | void CheckValueCounts(const std::shared_ptr<T>& input, |
| 93 | const std::shared_ptr<Array>& expected_values, |
| 94 | const std::shared_ptr<Array>& expected_counts) { |
| 95 | ASSERT_OK_AND_ASSIGN(std::shared_ptr<Array> result, ValueCounts(input)); |
| 96 | ValidateOutput(*result); |
| 97 | auto result_struct = std::dynamic_pointer_cast<StructArray>(result); |
| 98 | ASSERT_EQ(result_struct->num_fields(), 2); |
| 99 | // TODO: We probably shouldn't rely on value ordering. |
| 100 | ASSERT_ARRAYS_EQUAL(*expected_values, *result_struct->field(kValuesFieldIndex)); |
| 101 | ASSERT_ARRAYS_EQUAL(*expected_counts, *result_struct->field(kCountsFieldIndex)); |
| 102 | } |
| 103 | |
| 104 | template <typename Type, typename T> |
| 105 | void CheckValueCounts(const std::shared_ptr<DataType>& type, |
no test coverage detected