mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Regression test for a recently fixed strtod bug.
This commit is contained in:
parent
c713eaa603
commit
c0ff67d57f
1 changed files with 11 additions and 1 deletions
|
|
@ -49,8 +49,9 @@ main(int argc, char *argv[])
|
|||
long double ld = 0.0;
|
||||
double d = 0.0;
|
||||
float f = 0.0;
|
||||
char *endp;
|
||||
|
||||
printf("1..3\n");
|
||||
printf("1..4\n");
|
||||
|
||||
buf[0] = '\0';
|
||||
assert(setlocale(LC_NUMERIC, ""));
|
||||
|
|
@ -274,6 +275,15 @@ main(int argc, char *argv[])
|
|||
|
||||
printf("ok 3 - scanfloat\n");
|
||||
|
||||
/*
|
||||
* Tests specific to strtod().
|
||||
*/
|
||||
|
||||
assert(strtod("0xy", &endp) == 0);
|
||||
assert(strcmp("xy", endp) == 0);
|
||||
|
||||
printf("ok 4 - scanfloat\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue