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: improve capi.imported_memory_access test #665

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Nov 25, 2020

This test was added before imporing memory was supported in C API. Now I remembered that it should actually test something.

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #665 (2e6c1e9) into master (87d25ef) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #665   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files          71       71           
  Lines        9805     9821   +16     
=======================================
+ Hits         9736     9752   +16     
  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/capi_test.cpp 100.00% <100.00%> (ø)

@gumb0 gumb0 requested review from axic and chfast November 25, 2020 11:28
memory_data[0] = 0xaa;
memory_data[1] = 0xbb;

EXPECT_EQ(fizzy_execute(instance, 0, nullptr, 0).value.i64, 0x22bbaa);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also check memory in instance_memory.

from_hex("0061736d010000000503010001070701036d656d02000b08010041010b021122");
auto module_memory = fizzy_parse(wasm_memory.data(), wasm_memory.size());
ASSERT_NE(module_memory, nullptr);
auto instance_memory =
Copy link
Collaborator

Choose a reason for hiding this comment

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

For readability, you can indicate which objects are pointers by auto*.

@gumb0 gumb0 force-pushed the capi-imported-memory-access branch from 32e8a89 to 91a31c5 Compare November 25, 2020 13:42
@gumb0 gumb0 force-pushed the capi-imported-memory-access branch from 91a31c5 to 2e6c1e9 Compare December 15, 2020 18:24
@gumb0 gumb0 merged commit 090fdf6 into master Dec 16, 2020
@gumb0 gumb0 deleted the capi-imported-memory-access branch December 16, 2020 10:49
@gumb0 gumb0 mentioned this pull request Dec 21, 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