mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
tests: fix json test for large numbers
PRIu64 means print a uint64_t, not an unsigned long. This is warned by the compiler: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'long unsigned int' This causes build failures on some 32-bit archs https://buildd.debian.org/status/fetch.php?pkg=pulseaudio&arch=i386&ver=14.99.1%2Bdfsg1-2&stamp=1622553415&raw=0 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/571>
This commit is contained in:
parent
a7d44750af
commit
a12d90e2ed
1 changed files with 5 additions and 5 deletions
|
|
@ -98,7 +98,7 @@ START_TEST(int_test) {
|
|||
unsigned int i;
|
||||
const char *ints_parse[] = { "1", "-1", "1234", "0" };
|
||||
const int64_t ints_compare[] = { 1, -1, 1234, 0 };
|
||||
char *ulong_max_str;
|
||||
char *uint64_max_str;
|
||||
|
||||
for (i = 0; i < PA_ELEMENTSOF(ints_parse); i++) {
|
||||
o = pa_json_parse(ints_parse[i]);
|
||||
|
|
@ -111,10 +111,10 @@ START_TEST(int_test) {
|
|||
}
|
||||
|
||||
/* test that parser would fail on integer overflow */
|
||||
ulong_max_str = pa_sprintf_malloc("%"PRIu64, ULONG_MAX);
|
||||
o = pa_json_parse(ulong_max_str);
|
||||
uint64_max_str = pa_sprintf_malloc("%"PRIu64, UINT64_MAX);
|
||||
o = pa_json_parse(uint64_max_str);
|
||||
fail_unless(o == NULL);
|
||||
pa_xfree(ulong_max_str);
|
||||
pa_xfree(uint64_max_str);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ START_TEST(double_test) {
|
|||
}
|
||||
|
||||
/* test that parser would fail on double exponent overflow */
|
||||
very_large_double_str = pa_sprintf_malloc("%"PRIu64"e%"PRIu64, ULONG_MAX, ULONG_MAX);
|
||||
very_large_double_str = pa_sprintf_malloc("%"PRIu64"e%"PRIu64, UINT64_MAX, UINT64_MAX);
|
||||
o = pa_json_parse(very_large_double_str);
|
||||
fail_unless(o == NULL);
|
||||
pa_xfree(very_large_double_str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue