diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-08-15 22:01:30 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-08-15 22:01:30 -0700 |
| commit | 37af20d053624e0cc2e5245ec2f6eba7a55158be (patch) | |
| tree | aaffc7d962d85c3cbbfe6e8410f125a16413b24c /tests | |
| parent | 82e164f8796d57aa78c14b20f0a750f4b40c861b (diff) | |
Fix coverage recipe and failed tests (retval changes)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/smrt_arena.c | 10 | ||||
| -rw-r--r-- | tests/string.c | 2 | ||||
| -rw-r--r-- | tests/wav.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/smrt_arena.c b/tests/smrt_arena.c index 505a5e0..1fececf 100644 --- a/tests/smrt_arena.c +++ b/tests/smrt_arena.c @@ -222,7 +222,7 @@ Test(smrt_arena, pop_to_mark_restores_position) { b32 popped = smrt_arena_pop_to_mark(arena); uint32_t *j = smrt_arena_push(arena, sizeof(uint32_t), true); - cr_expect_eq(popped, true); + cr_expect_eq(popped, 0); cr_assert_eq(i, j); smrt_arena_destroy(arena); @@ -239,7 +239,7 @@ Test(smrt_arena, mark_at_base_position_is_valid) { b32 popped = smrt_arena_pop_to_mark(arena); - cr_expect_eq(popped, true); + cr_expect_eq(popped, 0); cr_expect_eq(arena->pos, SMRT_ARENA_BASE_POS); smrt_arena_destroy(arena); @@ -252,7 +252,7 @@ Test(smrt_arena, pop_to_mark_without_mark_fails) { b32 popped = smrt_arena_pop_to_mark(arena); - cr_expect_eq(popped, false); + cr_expect_eq(popped, -1); smrt_arena_destroy(arena); } @@ -342,8 +342,8 @@ Test(smrt_arena, auto_decommit_pop_past_mark_resets_mark) { cr_expect_lt(arena->commit_pos, mark_pos); cr_expect_eq(arena->mark_pos, 0); - b32 popped = smrt_arena_pop_to_mark(arena); - cr_expect_eq(popped, false); + i32 popped = smrt_arena_pop_to_mark(arena); + cr_expect_eq(popped, -1); smrt_arena_destroy(arena); } diff --git a/tests/string.c b/tests/string.c index d106380..e38994e 100644 --- a/tests/string.c +++ b/tests/string.c @@ -104,7 +104,7 @@ Test(string, set_string_too_large_fails) { b32 ok = strng_set(s, "way too long for a 4 byte buffer"); - cr_expect_eq(ok, false); + cr_expect_eq(ok, -1); cr_expect_eq(s->len, 0); smrt_arena_destroy(arena); diff --git a/tests/wav.c b/tests/wav.c index 7635223..6a853dd 100644 --- a/tests/wav.c +++ b/tests/wav.c @@ -262,7 +262,7 @@ Test(wav, read_rejects_non_pcm_format, .init = non_pcm_setup, .fini = non_pcm_te wav_fmt_chunk_t fmtchunk = make_wav_fmt_chunk(1, 8000, 8); fmtchunk.audio_format = 6; // A-law, neither PCM integer (1) nor IEEE float (3) - cr_assert(write_wav_file(wav_file, &fmtchunk, data)); + cr_assert(write_wav_file(wav_file, &fmtchunk, data) == 0); fclose(wav_file); @@ -303,7 +303,7 @@ Test(wav, write_sine, .init = write_sine_setup, .fini = write_sine_teardown) { wav_fmt_chunk_t fmtchunk = make_wav_fmt_chunk(1, sample_count, 8); - cr_assert(write_wav_file(wav_file, &fmtchunk, data)); + cr_assert(write_wav_file(wav_file, &fmtchunk, data) == 0); fclose(wav_file); @@ -370,7 +370,7 @@ Test(wav, read_32bps_float_round_trip, .init = float32_wav_setup, .fini = float3 wav_fmt_chunk_t fmtchunk = make_wav_fmt_chunk(1, 44100, 32); fmtchunk.audio_format = 3; // IEEE 754 float - cr_assert(write_wav_file(wav_file, &fmtchunk, data)); + cr_assert(write_wav_file(wav_file, &fmtchunk, data) == 0); fclose(wav_file); @@ -435,7 +435,7 @@ Test(wav, read_24bps_round_trip, .init = pcm24_wav_setup, .fini = pcm24_wav_tear wav_fmt_chunk_t fmtchunk = make_wav_fmt_chunk(1, 44100, 24); - cr_assert(write_wav_file(wav_file, &fmtchunk, data)); + cr_assert(write_wav_file(wav_file, &fmtchunk, data) == 0); fclose(wav_file); |