-
Notifications
You must be signed in to change notification settings - Fork 824
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+doc(c-api): Test and document the C A PI #1851
Conversation
use inline_c::assert_c; | ||
|
||
#[test] | ||
fn test_engine_new() { |
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.
Is this test really useful? It seems redundant with the examples from the documentation.
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 initially wanted to improve this test, but our C API doesn't offer enough features. Let's keep this as is, and I'll improve it later.
This patch does several things: 1. It applies our Rust patterns for C API by replacing the raw pointer by `Option<Box<T>>`, 2. It allows `wasm_$name_vec_delete` to handle null pointer, 3. Because it takes ownership of the `wasm_$name_vec_t`, the pointer is correctly dropped (which fix the memory leak).
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
So. I pushed a commit. Git says everything is up-to-date. But the commit doesn't appear here. Hmmm. |
bors try |
tryBuild failed: |
Because we test the C API with many features combination, we can't ensure tests will pass with every combination
bors try |
bors r+ |
Description
This PR improves the test suites and the documentation of the C API.
Review