Skip to content

Commit b1ec95d

Browse files
committed
test: replace cmocka assert_in_range with assert_uint_in_range
suppress warnings seen after updating cmocka 1.1.7 -> 2.0.1 (homebrew installs this version now.) ``` /Users/runner/work/toywasm/toywasm/test/test.c:478:9: error: 'cmocka_macro' is deprecated: assert_in_range: use assert_int_in_range or assert_uint_in_range instead [-Werror,-Wdeprecated-declarations] assert_in_range(id, 1, 3); ^ /opt/homebrew/include/cmocka.h:5345:9: note: expanded from macro 'assert_in_range' CMOCKA_DEPRECATION_WARNING( \ ^ /opt/homebrew/include/cmocka.h:219:9: note: expanded from macro 'CMOCKA_DEPRECATION_WARNING' cmocka_macro cmocka_deprecated_var __attribute__((unused)) = 0; \ ^ /Users/runner/work/toywasm/toywasm/test/test.c:478:9: note: 'cmocka_macro' has been explicitly marked deprecated here /opt/homebrew/include/cmocka.h:5345:9: note: expanded from macro 'assert_in_range' CMOCKA_DEPRECATION_WARNING( \ ^ /opt/homebrew/include/cmocka.h:218:49: note: expanded from macro 'CMOCKA_DEPRECATION_WARNING' typedef int cmocka_macro __attribute__((deprecated(msg))); \ ^ ```
1 parent 4789b7d commit b1ec95d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,15 @@ test_idalloc(void **state)
475475
/* allocate all slots */
476476
ret = idalloc_alloc(&a, &id, mctx);
477477
assert_int_equal(ret, 0);
478-
assert_in_range(id, 1, 3);
478+
assert_uint_in_range(id, 1, 3);
479479
bm |= 1 << id;
480480
ret = idalloc_alloc(&a, &id, mctx);
481481
assert_int_equal(ret, 0);
482-
assert_in_range(id, 1, 3);
482+
assert_uint_in_range(id, 1, 3);
483483
bm |= 1 << id;
484484
ret = idalloc_alloc(&a, &id, mctx);
485485
assert_int_equal(ret, 0);
486-
assert_in_range(id, 1, 3);
486+
assert_uint_in_range(id, 1, 3);
487487
bm |= 1 << id;
488488
assert_int_equal(bm, 14);
489489

0 commit comments

Comments
 (0)