Skip to content

Commit 9bca786

Browse files
DimStar77mwilck
authored andcommitted
tests: fix tests when built against cmocka 1.1.8 or newer
CMocka 1.1.8 udate check for uintptr_t Without including stdint, the test fails to compile (using GCC15) with In file included from test-log.c:6: test-log.c: In function ‘__wrap_dlog’: test-log.c:23:20: error: ‘uintptr_t’ undeclared (first use in this function) 23 | expected = mock_ptr_type(char *); | ^~~~~~~~~~~~~ test-log.c:10:1: note: ‘uintptr_t’ is defined in header ‘<stdint.h>’; this is probably fixable by adding ‘#include <stdint.h>’ 9 | #include "debug.h" +++ |+#include <stdint.h> 10 | test-log.c:23:20: note: each undeclared identifier is reported only once for each function it appears in 23 | expected = mock_ptr_type(char *); | ^~~~~~~~~~~~~ test-log.c:23:20: error: expected ‘)’ before ‘_mock’ 23 | expected = mock_ptr_type(char *); | ^~~~~~~~~~~~~ test-log.c:23:20: note: to match this ‘(’ 23 | expected = mock_ptr_type(char *); | ^~~~~~~~~~~~~ Reviewed-by: Martin Wilck <mwilck@suse.com>
1 parent 3973293 commit 9bca786

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/test-log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <setjmp.h>
22
#include <stddef.h>
33
#include <stdarg.h>
4+
#include <stdint.h>
45
#include <stdio.h>
56
#include <string.h>
67
#include <cmocka.h>

0 commit comments

Comments
 (0)