Skip to content

Commit 041af23

Browse files
committed
Add more tests.
1 parent c646b34 commit 041af23

14 files changed

+217
-0
lines changed

bindgen-tests/tests/expectations/tests/macro-cast.rs

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/macro-do-while.rs

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/macro-func-arg-variable-same-name.rs

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/macro-func-nested.rs

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/macro-macos-limits.rs

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#define ULONG_MAX 4294967295
2+
3+
typedef unsigned long TickType_t;
4+
#define portMAX_DELAY (TickType_t) ULONG_MAX
5+
6+
#define NEG_TO_POS (unsigned int) -1
7+
#define BIG_TO_SMALL (unsigned short) ULONG_MAX
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int xTaskDelayUntil(int, int);
2+
3+
#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
4+
do { \
5+
( void ) xTaskDelayUntil( ( pxPreviousWakeTime ), ( xTimeIncrement ) ); \
6+
} while( 0 )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// The `x` argument of the `f3` function-like macro
2+
// and the `x` in the nested `y` macro should be treated
3+
// as different variables.
4+
#define y x
5+
#define f3(x) y + y
6+
#define x 2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// The `f1` macro call in `f2` should be expanded.
2+
#define f1(x) x * 2
3+
#define f2(y) y * f1(y)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* Number of bits in a `char'. */
2+
#undef CHAR_BIT
3+
#define CHAR_BIT 8
4+
5+
/* Maximum length of a multibyte character. */
6+
#ifndef MB_LEN_MAX
7+
#define MB_LEN_MAX 1
8+
#endif
9+
10+
/* Minimum and maximum values a `signed char' can hold. */
11+
#undef SCHAR_MIN
12+
#define SCHAR_MIN (-128)
13+
#undef SCHAR_MAX
14+
#define SCHAR_MAX 127
15+
16+
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
17+
#undef UCHAR_MAX
18+
#define UCHAR_MAX 255
19+
20+
/* Minimum and maximum values a `char' can hold. */
21+
#ifdef __CHAR_UNSIGNED__
22+
#undef CHAR_MIN
23+
#define CHAR_MIN 0
24+
#undef CHAR_MAX
25+
#define CHAR_MAX 255
26+
#else
27+
#undef CHAR_MIN
28+
#define CHAR_MIN (-128)
29+
#undef CHAR_MAX
30+
#define CHAR_MAX 127
31+
#endif
32+
33+
/* Minimum and maximum values a `signed short int' can hold. */
34+
#undef SHRT_MIN
35+
#define SHRT_MIN (-32768)
36+
#undef SHRT_MAX
37+
#define SHRT_MAX 32767
38+
39+
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
40+
#undef USHRT_MAX
41+
#define USHRT_MAX 65535
42+
43+
/* Minimum and maximum values a `signed int' can hold. */
44+
#ifndef __INT_MAX__
45+
#define __INT_MAX__ 2147483647
46+
#endif
47+
#undef INT_MIN
48+
#define INT_MIN (-INT_MAX-1)
49+
#undef INT_MAX
50+
#define INT_MAX __INT_MAX__
51+
52+
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
53+
#undef UINT_MAX
54+
#define UINT_MAX (INT_MAX * 2U + 1)
55+
56+
/* Minimum and maximum values a `signed long int' can hold.
57+
(Same as `int'). */
58+
#ifndef __LONG_MAX__
59+
#define __LONG_MAX__ 2147483647L
60+
#endif
61+
#undef LONG_MIN
62+
#define LONG_MIN (-LONG_MAX-1)
63+
#undef LONG_MAX
64+
#define LONG_MAX __LONG_MAX__
65+
66+
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
67+
#undef ULONG_MAX
68+
#define ULONG_MAX (LONG_MAX * 2UL + 1)
69+
70+
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
71+
/* Minimum and maximum values a `signed long long int' can hold. */
72+
#ifndef __LONG_LONG_MAX__
73+
#define __LONG_LONG_MAX__ 9223372036854775807LL
74+
#endif
75+
#undef LONG_LONG_MIN
76+
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
77+
#undef LONG_LONG_MAX
78+
#define LONG_LONG_MAX __LONG_LONG_MAX__
79+
80+
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
81+
#undef ULONG_LONG_MAX
82+
#define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
83+
#endif

0 commit comments

Comments
 (0)