diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-04-01 08:45:54 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-04-01 08:45:54 +0000 |
commit | 201a7320f48b1d8868bc1fb38ee1182ad3d84dd7 (patch) | |
tree | d3591478e3a024d6f4a39c76b49ffc66885dd918 /document/src/tests/documentselectparsertest.cpp | |
parent | 013342a0470e7a5b456921010009c38a4a0c828f (diff) |
Add more limit details to parse failure messages
Diffstat (limited to 'document/src/tests/documentselectparsertest.cpp')
-rw-r--r-- | document/src/tests/documentselectparsertest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp index fce0d90db72..2d2b7bfd085 100644 --- a/document/src/tests/documentselectparsertest.cpp +++ b/document/src/tests/documentselectparsertest.cpp @@ -1611,7 +1611,7 @@ TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_field_exprs) { expr += ".foo"; } expr += ".hash() != 0"; - verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested"); + verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested (max 1024 levels)"); } TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_arithmetic_exprs) { @@ -1621,7 +1621,7 @@ TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_arithmetic_exprs expr += "+1"; } expr += " != 0"; - verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested"); + verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested (max 1024 levels)"); } TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_binary_logical_exprs) { @@ -1632,7 +1632,7 @@ TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_binary_logical_e for (size_t i = 0; i < 10000; ++i) { expr += (i % 2 == 0 ? " and " : " or ") + cmp_subexpr; } - verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested"); + verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested (max 1024 levels)"); } TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_unary_logical_exprs) { @@ -1642,7 +1642,7 @@ TEST_F(DocumentSelectParserTest, recursion_depth_is_bounded_for_unary_logical_ex expr += "not "; } expr += "true"; - verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested"); + verifyFailedParse(expr, "ParsingFailedException: expression is too deeply nested (max 1024 levels)"); } TEST_F(DocumentSelectParserTest, selection_has_upper_limit_on_input_size) { @@ -1650,7 +1650,7 @@ TEST_F(DocumentSelectParserTest, selection_has_upper_limit_on_input_size) { std::string expr = ("testdoctype1.a_biii" + std::string(select::ParserLimits::MaxSelectionByteSize, 'i') + "iiig_identifier"); - verifyFailedParse(expr, "ParsingFailedException: expression is too large to be parsed"); + verifyFailedParse(expr, "ParsingFailedException: expression is too large to be parsed (max 1048576 bytes)"); } TEST_F(DocumentSelectParserTest, lexing_does_not_have_superlinear_time_complexity) { |