diff options
Diffstat (limited to 'test/test_fmt_sscanf.c')
-rw-r--r-- | test/test_fmt_sscanf.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/test_fmt_sscanf.c b/test/test_fmt_sscanf.c index b2a4e74..8abab69 100644 --- a/test/test_fmt_sscanf.c +++ b/test/test_fmt_sscanf.c @@ -677,6 +677,38 @@ test_38(void) #undef STRING } +static void +test_39(void) +{ + int reta, retb; + unsigned int ia, ib; + +#define STRING "0" +#define FORMAT "%u" + reta = sscanf(STRING, FORMAT, &ia); + retb = fmt_sscanf(STRING, FORMAT, &ib); + check(reta == retb); + check(ia == ib); +#undef FORMAT +#undef STRING +} + +static void +test_40(void) +{ + int reta, retb; + int ia, ib; + +#define STRING "-0" +#define FORMAT "%d" + reta = sscanf(STRING, FORMAT, &ia); + retb = fmt_sscanf(STRING, FORMAT, &ib); + check(reta == retb); + check(ia == ib); +#undef FORMAT +#undef STRING +} + int main(int argc, char *argv[]) { @@ -721,6 +753,8 @@ main(int argc, char *argv[]) test_36(); test_37(); test_38(); + test_39(); + test_40(); return 0; } |