Skip to content

Commit

Permalink
sp/tests: use more succint check for TEST_CHECK.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Aug 28, 2023
1 parent 25d0e36 commit 5befe01
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/internal/stream_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,7 @@ static void test_window()
for (t = 0; t < check->window_size_sec + check->window_hop_sec; t++) {
ret = snprintf(datafile, sizeof(datafile)-1, "%s%d.mp",
DATA_SAMPLES_HOPPING_WINDOW_PATH, t + 1);
TEST_CHECK(ret <= sizeof(datafile)-1);

if (ret > sizeof(datafile)-1) {
if (!TEST_CHECK(ret <= sizeof(datafile)-1)) {
exit(1);
}
ret = file_to_buf(datafile, &data_buf);
Expand Down Expand Up @@ -674,9 +672,7 @@ static void test_snapshot()

ret = snprintf(datafile, sizeof(datafile)-1, "%s%d.mp",
DATA_SAMPLES_HOPPING_WINDOW_PATH, t + 1);
TEST_CHECK(ret <= sizeof(datafile)-1);

if (ret > sizeof(datafile)-1) {
if (!TEST_CHECK(ret <= sizeof(datafile)-1)) {
exit(1);
}

Expand Down

0 comments on commit 5befe01

Please sign in to comment.