-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Add more tests for call depth #666
Conversation
Codecov Report
@@ Coverage Diff @@
## master #666 +/- ##
=======================================
Coverage 99.29% 99.29%
=======================================
Files 71 71
Lines 9739 9805 +66
=======================================
+ Hits 9670 9736 +66
Misses 69 69
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f208ad8
to
0056322
Compare
test/unittests/execute_call_test.cpp
Outdated
auto i1 = instantiate(parse(wasm1), {}, {}, {}, {{&counter, {ValType::i64, true}}}); | ||
counter.i64 = 0; | ||
EXPECT_THAT(execute(*i1, 0, {}), Traps()); | ||
EXPECT_EQ(counter.i64, MaxDepth + 1); // FIXME: Should be MaxDepth. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should it be? Function is executed MaxDepth + 1
times, because depth starts with 0 and ends with MaxDepth
inclusive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is correct, but I prefer there to be 2048 allowed calls, not 2049. This is changed in #669.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the FIXME comment as we have #669 to discuss it.
test/unittests/execute_call_test.cpp
Outdated
EXPECT_EQ(counter, MaxDepth / 2 + 1); | ||
} | ||
|
||
TEST(execute_call, call_imported_interleaved_infinite_recursion_start_with_wasm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could have been just an additional execution in the previous test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged.
0056322
to
6d8e5b7
Compare
6d8e5b7
to
f126df0
Compare
No description provided.