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

Function TEST_P

runtime/memory_safety_test.cc:226–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226TEST_P(EvaluatorMemorySafetyTest, Basic) {
227 const auto& test_case = GetTestCase();
228
229 ASSERT_OK_AND_ASSIGN(std::unique_ptr<Runtime> runtime, ConfigureRuntime());
230
231 ASSERT_OK_AND_ASSIGN(ValidationResult validation,
232 GetCompiler().Compile(test_case.expression));
233
234 ASSERT_TRUE(validation.IsValid()) << validation.FormatError();
235 ASSERT_OK_AND_ASSIGN(auto ast, validation.ReleaseAst());
236 ASSERT_OK_AND_ASSIGN(std::unique_ptr<Program> program,
237 runtime->CreateProgram(std::move(ast)));
238
239 Activation activation;
240 google::protobuf::Arena arena;
241 InitActivation(test_case, arena, activation);
242 absl::StatusOr<Value> got = program->Evaluate(&arena, activation);
243
244 EXPECT_THAT(got, IsOkAndHolds(test_case.expected_matcher));
245}
246
247TEST_P(EvaluatorMemorySafetyTest, ProgramSafeAfterRuntimeDestroyed) {
248 const auto& test_case = GetTestCase();

Callers

nothing calls this directly

Calls 15

InitActivationFunction · 0.85
ConfigureRuntimeImplFunction · 0.85
StructValueIsFunction · 0.85
StringValueIsFunction · 0.85
IsValidMethod · 0.80
FormatErrorMethod · 0.80
InsertOrAssignValueMethod · 0.80
atMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.50
ConfigureRuntimeFunction · 0.50
BoolValueClass · 0.50
CreateProgramMethod · 0.45

Tested by

no test coverage detected