Skip to content

Commit

Permalink
Fix test compilation warnings (#127)
Browse files Browse the repository at this point in the history
Resolves: #116

Signed-off-by: Sergio Arroutbi <[email protected]>
  • Loading branch information
sarroutbi authored Jan 11, 2024
1 parent 4878253 commit aee1096
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit aee1096

Please sign in to comment.