| 79 | } |
| 80 | |
| 81 | TEST(StandardRuntimeTest, RecursionLimitExceeded) { |
| 82 | RuntimeOptions opts; |
| 83 | opts.max_recursion_depth = 1; |
| 84 | |
| 85 | ASSERT_OK_AND_ASSIGN(auto builder, |
| 86 | CreateStandardRuntimeBuilder( |
| 87 | google::protobuf::DescriptorPool::generated_pool(), opts)); |
| 88 | |
| 89 | ASSERT_OK_AND_ASSIGN(auto runtime, std::move(builder).Build()); |
| 90 | |
| 91 | ASSERT_OK_AND_ASSIGN(ParsedExpr expr, ParseWithTestMacros("1 + 2")); |
| 92 | |
| 93 | EXPECT_THAT(ProtobufRuntimeAdapter::CreateProgram(*runtime, expr), |
| 94 | StatusIs(absl::StatusCode::kInvalidArgument, |
| 95 | HasSubstr("Maximum recursion depth of 1 exceeded"))); |
| 96 | } |
| 97 | |
| 98 | TEST(StandardRuntimeTest, RecursionUnderLimit) { |
| 99 | RuntimeOptions opts; |
nothing calls this directly
no test coverage detected