| 86 | }; |
| 87 | |
| 88 | TEST_P(ProtobufValueEndToEndTest, Runner) { |
| 89 | TestAllTypes message; |
| 90 | |
| 91 | ASSERT_TRUE( |
| 92 | google::protobuf::TextFormat::ParseFromString(test_case().msg_textproto, &message)); |
| 93 | |
| 94 | Activation activation; |
| 95 | activation.InsertOrAssignValue( |
| 96 | "msg", |
| 97 | Value::FromMessage(message, google::protobuf::DescriptorPool::generated_pool(), |
| 98 | google::protobuf::MessageFactory::generated_factory(), &arena_)); |
| 99 | |
| 100 | RuntimeOptions opts; |
| 101 | opts.enable_empty_wrapper_null_unboxing = true; |
| 102 | ASSERT_OK_AND_ASSIGN(auto builder, |
| 103 | CreateStandardRuntimeBuilder( |
| 104 | google::protobuf::DescriptorPool::generated_pool(), opts)); |
| 105 | |
| 106 | ASSERT_OK_AND_ASSIGN(std::unique_ptr<const Runtime> runtime, |
| 107 | std::move(builder).Build()); |
| 108 | |
| 109 | ASSERT_OK_AND_ASSIGN(ParsedExpr expr, Parse(test_case().expr)); |
| 110 | |
| 111 | ASSERT_OK_AND_ASSIGN(std::unique_ptr<TraceableProgram> program, |
| 112 | ProtobufRuntimeAdapter::CreateProgram(*runtime, expr)); |
| 113 | |
| 114 | ASSERT_OK_AND_ASSIGN(Value result, program->Evaluate(&arena_, activation)); |
| 115 | |
| 116 | EXPECT_THAT(result, test_case().matcher); |
| 117 | } |
| 118 | |
| 119 | INSTANTIATE_TEST_SUITE_P( |
| 120 | Singular, ProtobufValueEndToEndTest, |
nothing calls this directly
no test coverage detected