| 1164 | }; |
| 1165 | |
| 1166 | void CheckRoundtrip(const RecordBatch& batch) { |
| 1167 | ExtensionTypeGuard guard({uuid(), dict_extension_type(), complex128()}); |
| 1168 | |
| 1169 | TestSchemaRoundTrip(batch.schema()); |
| 1170 | |
| 1171 | ASSERT_OK_AND_ASSIGN(auto writer, IntegrationJsonWriter::Open(batch.schema())); |
| 1172 | ASSERT_OK(writer->WriteRecordBatch(batch)); |
| 1173 | |
| 1174 | ASSERT_OK_AND_ASSIGN(auto json_data, writer->Finish()); |
| 1175 | |
| 1176 | ASSERT_OK_AND_ASSIGN(auto reader, |
| 1177 | IntegrationJsonReader::Open(std::make_shared<Buffer>(json_data))); |
| 1178 | ASSERT_OK_AND_ASSIGN(auto result_batch, reader->ReadRecordBatch(0)); |
| 1179 | ASSERT_OK(result_batch->ValidateFull()); |
| 1180 | |
| 1181 | // take care of float rounding error in the text representation |
| 1182 | ApproxCompareBatch(batch, *result_batch); |
| 1183 | } |
| 1184 | |
| 1185 | TEST_P(TestJsonRoundTrip, RoundTrip) { |
| 1186 | std::shared_ptr<RecordBatch> batch; |
no test coverage detected