| 275 | |
| 276 | template <typename ElementType, typename OptionsType> |
| 277 | void TestSourceSinkError( |
| 278 | std::string source_factory_name, |
| 279 | std::function<Result<std::vector<ElementType>>(const BatchesWithSchema&)> |
| 280 | to_elements) { |
| 281 | ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make()); |
| 282 | std::shared_ptr<Schema> no_schema; |
| 283 | |
| 284 | auto exp_batches = MakeBasicBatches(); |
| 285 | ASSERT_OK_AND_ASSIGN(auto elements, to_elements(exp_batches)); |
| 286 | auto element_it_maker = [&elements]() { |
| 287 | return MakeVectorIterator<ElementType>(elements); |
| 288 | }; |
| 289 | |
| 290 | auto null_executor_options = OptionsType{exp_batches.schema, element_it_maker}; |
| 291 | ASSERT_OK(MakeExecNode(source_factory_name, plan.get(), {}, null_executor_options)); |
| 292 | |
| 293 | auto null_schema_options = OptionsType{no_schema, element_it_maker}; |
| 294 | ASSERT_THAT(MakeExecNode(source_factory_name, plan.get(), {}, null_schema_options), |
| 295 | Raises(StatusCode::Invalid, HasSubstr("not null"))); |
| 296 | |
| 297 | auto no_io_but_executor = OptionsType{exp_batches.schema, element_it_maker, |
| 298 | io::default_io_context().executor()}; |
| 299 | no_io_but_executor.requires_io = false; |
| 300 | ASSERT_THAT(MakeExecNode(source_factory_name, plan.get(), {}, no_io_but_executor), |
| 301 | Raises(StatusCode::Invalid, HasSubstr("io_executor was not nullptr"))); |
| 302 | } |
| 303 | |
| 304 | template <typename ElementType, typename OptionsType> |
| 305 | void TestSourceSink( |
nothing calls this directly
no test coverage detected