mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
core-util-test: Test parsing integer strings with leading zeros
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
This commit is contained in:
parent
6bc00720f3
commit
b76964e480
1 changed files with 10 additions and 0 deletions
|
|
@ -100,6 +100,10 @@ START_TEST (modargs_test_atoi) {
|
|||
ck_assert_int_eq(value, 100000);
|
||||
ck_assert_int_eq(pa_atoi("-100000", &value), 0);
|
||||
ck_assert_int_eq(value, -100000);
|
||||
ck_assert_int_eq(pa_atoi("010", &value), 0);
|
||||
ck_assert_int_eq(value, 10);
|
||||
ck_assert_int_eq(pa_atoi("-010", &value), 0);
|
||||
ck_assert_int_eq(value, -10);
|
||||
|
||||
// hexadecimal
|
||||
ck_assert_int_eq(pa_atoi("0x100000", &value), 0);
|
||||
|
|
@ -120,6 +124,8 @@ START_TEST (modargs_test_atou) {
|
|||
// decimal
|
||||
ck_assert_int_eq(pa_atou("100000", &value), 0);
|
||||
ck_assert_int_eq(value, 100000);
|
||||
ck_assert_int_eq(pa_atou("010", &value), 0);
|
||||
ck_assert_int_eq(value, 10);
|
||||
|
||||
// hexadecimal
|
||||
ck_assert_int_eq(pa_atou("0x100000", &value), 0);
|
||||
|
|
@ -142,6 +148,10 @@ START_TEST (modargs_test_atol) {
|
|||
ck_assert_int_eq(value, 100000l);
|
||||
ck_assert_int_eq(pa_atol("-100000", &value), 0);
|
||||
ck_assert_int_eq(value, -100000l);
|
||||
ck_assert_int_eq(pa_atol("010", &value), 0);
|
||||
ck_assert_int_eq(value, 10);
|
||||
ck_assert_int_eq(pa_atol("-010", &value), 0);
|
||||
ck_assert_int_eq(value, -10);
|
||||
|
||||
// hexadecimal
|
||||
ck_assert_int_eq(pa_atol("0x100000", &value), 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue