Create a FunctionContext for tests that doesn't allocate memory through a mem pool.
| 35 | |
| 36 | // Create a FunctionContext for tests that doesn't allocate memory through a mem pool. |
| 37 | FunctionContext* CreateFunctionContext( |
| 38 | MemPool* pool) { |
| 39 | FunctionContext::TypeDesc return_type; |
| 40 | return_type.type = FunctionContext::Type::TYPE_INT; |
| 41 | FunctionContext::TypeDesc param_desc; |
| 42 | param_desc.type = FunctionContext::Type::TYPE_INT; |
| 43 | std::vector<FunctionContext::TypeDesc> arg_types(2, param_desc); |
| 44 | FunctionContext* ctx = FunctionContextImpl::CreateContext( |
| 45 | nullptr, pool, pool, return_type, arg_types, 0, true); |
| 46 | EXPECT_TRUE(ctx != nullptr); |
| 47 | return ctx; |
| 48 | } |
| 49 | |
| 50 | // Create a FunctionContext where the used mem pool comes as a parameter. Can be used |
| 51 | // for tests that allocate memory through mem pool, e.g. truncate strings tests. |
no outgoing calls
no test coverage detected