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

Fix test compilation warnings #127

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/alg_encr.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ test(const jose_hook_alg_t *a, const char *pt, json_t *cek, bool iter)
assert(d);

if (iter) {
uint8_t *xxx = ebuf;
for (size_t i = 0; i < elen; i++)
assert(d->feed(d, &xxx[i], 1));
if (elen) {
uint8_t *xxx = ebuf;
for (size_t i = 0; i < elen; i++) {
assert(d->feed(d, &xxx[i], 1));
}
}
} else {
assert(d->feed(d, ebuf, elen));
}
Expand Down
3 changes: 3 additions & 0 deletions tests/api_b64.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ main(int argc, char *argv[])
for (uint16_t i = 0; i <= UINT8_MAX; i++) {
union encoding enc = { i };
uint8_t dec[3] = {};
assert(dec != NULL);
assert(jose_b64_dec_buf(enc.enc, 1, dec, sizeof(dec)) == SIZE_MAX);
}

Expand All @@ -74,6 +75,7 @@ main(int argc, char *argv[])
for (uint16_t i = 0; i <= UINT8_MAX; i++) {
uint8_t dec[3] = { i };
union encoding enc = {};
assert(dec != NULL);
assert(jose_b64_enc_buf(dec, 1, enc.enc, sizeof(enc.enc)) == 2);
set(val, enc.idx);
}
Expand Down Expand Up @@ -106,6 +108,7 @@ main(int argc, char *argv[])
for (uint16_t j = 0; j <= UINT8_MAX; j++) {
uint8_t dec[3] = { i, j };
union encoding enc = {};
assert(dec != NULL);
assert(jose_b64_enc_buf(dec, 2, enc.enc, sizeof(enc.enc)) == 3);
set(val, enc.idx);
}
Expand Down