Skip to content
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

Merged
merged 1 commit into from
Dec 4, 2020
Merged

test: Add more tests for call depth #666

merged 1 commit into from
Dec 4, 2020

Conversation

chfast
Copy link
Collaborator

@chfast chfast commented Nov 25, 2020

No description provided.

@chfast chfast requested review from axic and gumb0 November 25, 2020 17:47
@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #666 (f126df0) into master (ed0c522) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #666   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files          71       71           
  Lines        9739     9805   +66     
=======================================
+ Hits         9670     9736   +66     
  Misses         69       69           
Flag Coverage Δ
spectests 91.46% <ø> (ø)
unittests 99.29% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
test/unittests/execute_call_test.cpp 100.00% <100.00%> (ø)

@chfast chfast force-pushed the test_call_depth branch 4 times, most recently from f208ad8 to 0056322 Compare November 27, 2020 13:02
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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

EXPECT_EQ(counter, MaxDepth / 2 + 1);
}

TEST(execute_call, call_imported_interleaved_infinite_recursion_start_with_wasm)
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged.

@chfast chfast merged commit d7caaf5 into master Dec 4, 2020
@chfast chfast deleted the test_call_depth branch December 4, 2020 16:01
@gumb0 gumb0 mentioned this pull request Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants