Commit 1e997e24 authored by Guillaume Quintard's avatar Guillaume Quintard Committed by Dridi Boukelmoune

[vnum] more lenient test

fixes #3697
parent 50dbec19
......@@ -31,6 +31,7 @@
*/
/* from libvarnish/vnum.c */
#define VNUM_EPSILON (1e-9d)
double VNUM(const char *p);
vtim_dur VNUM_duration_unit(vtim_dur r, const char *b, const char *e);
vtim_dur VNUM_duration(const char *p);
......
......@@ -693,9 +693,10 @@ main(int argc, char *argv[])
++ec;
}
d1 = VNUM_duration(" 365.24219d ");
if (d1 != 31556908.8) {
d2 = 31556908.8;
if (fabs(d1 - d2) > VNUM_EPSILON) {
printf("%s: VNUM_Duration() wrong, %.3f delta = %e\n",
*argv, d1, d1 - 31556908.8);
*argv, d1, d1 - d2);
++ec;
}
/* TODO: test invalid strings */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment