-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add C Serialization Tests for #17217 #17294
Conversation
Codecov Report
@@ Coverage Diff @@
## master #17294 +/- ##
=========================================
- Coverage 82.7% 82.7% -0.1%
=========================================
Files 421 421
Lines 118023 118023
=========================================
- Hits 97661 97646 -15
- Misses 20362 20377 +15 |
for (int i = 0; i < 2; i++) { | ||
sol_assert(*params.ka[i].lamports == 42); | ||
sol_assert(!sol_memcmp(params.ka[i].data, ka_data, 4)); | ||
sol_assert(SolPubkey_same(params.ka[i].owner, &ka_owner)); |
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.
This test seems to fail consistently at this line. Why should it work if local struct ka_owner
is not initialized? What am I missing?..
Test is probably assuming zero initialized memory
…On Tue, May 18, 2021, 7:58 AM Dmitri Makarov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In programs/bpf/c/src/ser/ser.c
<#17294 (comment)>:
> + SolAccountInfo ka[1];
+ SolParameters params = (SolParameters){.ka = ka};
+
+ sol_log(__FILE__);
+
+ if (!sol_deserialize(input, ¶ms, SOL_ARRAY_SIZE(ka))) {
+ return ERROR_INVALID_ARGUMENT;
+ }
+
+ char ka_data[] = {1, 2, 3};
+ SolPubkey ka_owner;
+ sol_assert(params.ka_num == 2);
+ for (int i = 0; i < 2; i++) {
+ sol_assert(*params.ka[i].lamports == 42);
+ sol_assert(!sol_memcmp(params.ka[i].data, ka_data, 4));
+ sol_assert(SolPubkey_same(params.ka[i].owner, &ka_owner));
This test seems to fail consistently at this line. Why should it work if
local struct ka_owner is not initialized? What am I missing?..
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#17294 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSLY6VYHOCN6LWK6S5QPADTOJ6ARANCNFSM45BJDQUQ>
.
|
but the |
Fixed in: #17310 |
Problem
#17217 fix went in but didn't contain a verifying test
Summary of Changes
Add test
Fixes #