| 224 | } |
| 225 | |
| 226 | TEST_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 | |
| 247 | TEST_P(EvaluatorMemorySafetyTest, ProgramSafeAfterRuntimeDestroyed) { |
| 248 | const auto& test_case = GetTestCase(); |
nothing calls this directly
no test coverage detected