MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST_P

Function TEST_P

extensions/protobuf/value_end_to_end_test.cc:88–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86};
87
88TEST_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
119INSTANTIATE_TEST_SUITE_P(
120 Singular, ProtobufValueEndToEndTest,

Callers

nothing calls this directly

Calls 3

CreateProgramFunction · 0.85
InsertOrAssignValueMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70

Tested by

no test coverage detected