Skip to content

test: replace cmocka assert_in_range with assert_uint_in_range#339

Merged
yamt merged 2 commits intomasterfrom
cmocka-update
Jan 2, 2026
Merged

test: replace cmocka assert_in_range with assert_uint_in_range#339
yamt merged 2 commits intomasterfrom
cmocka-update

Conversation

@yamt
Copy link
Owner

@yamt yamt commented Jan 1, 2026

suppress warnings seen after updating cmocka 1.1.7 -> 2.0.1

 /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)));      \
                                                ^

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)));      \
                                                ^
```
@yamt yamt force-pushed the cmocka-update branch 2 times, most recently from d6b19ba to 2069e0f Compare January 1, 2026 10:20
@yamt yamt merged commit 85a2d02 into master Jan 2, 2026
436 of 438 checks passed
@yamt yamt deleted the cmocka-update branch January 2, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant