mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-18 03:29:49 +00:00
Fix several tests affected by our new handling of floating-point constants.
These had implicitly assumed that floating-point constants had only double precision, rather than extended.
This commit is contained in:
parent
d72c0fb9a5
commit
da6898214f
@ -10,7 +10,7 @@ main ()
|
||||
|
||||
|
||||
d1 = atof ("3.5e-22");
|
||||
if (d1 != 3.5e-22)
|
||||
if (d1 != (double)3.5e-22)
|
||||
goto Fail;
|
||||
|
||||
i = atoi ("-32765");
|
||||
|
@ -59,7 +59,7 @@ main ()
|
||||
if (i != 1)
|
||||
goto Fail3;
|
||||
string [47] = '\0';
|
||||
if (strcmp (string, "% +1.2345599999999999e-203 a string % N"))
|
||||
if (strcmp (string, "% +1.2345600000000000e-203 a string % N"))
|
||||
goto Fail;
|
||||
|
||||
rewind (stdout);
|
||||
@ -67,10 +67,10 @@ main ()
|
||||
if (i != 1)
|
||||
goto Fail3;
|
||||
string [47] = '\0';
|
||||
if (strcmp (string, "% +1.2345599999999999e-203 a string % N"))
|
||||
if (strcmp (string, "% +1.2345600000000000e-203 a string % N"))
|
||||
goto Fail;
|
||||
|
||||
if (strcmp (sstring, "% +1.2345599999999999e-203 a string % N\n"))
|
||||
if (strcmp (sstring, "% +1.2345600000000000e-203 a string % N\n"))
|
||||
goto Fail;
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ main ()
|
||||
if (i != 1)
|
||||
goto Fail3;
|
||||
string [53] = '\0';
|
||||
if (strcmp (string, " +1.2345599999999999e-203 -4.700000E+00 5e+00 E"))
|
||||
if (strcmp (string, " +1.2345600000000000e-203 -4.700000E+00 5e+00 E"))
|
||||
goto Fail;
|
||||
|
||||
rewind (stdout);
|
||||
@ -61,10 +61,10 @@ main ()
|
||||
if (i != 1)
|
||||
goto Fail3;
|
||||
string [53] = '\0';
|
||||
if (strcmp (string, " +1.2345599999999999e-203 -4.700000E+00 5e+00 E"))
|
||||
if (strcmp (string, " +1.2345600000000000e-203 -4.700000E+00 5e+00 E"))
|
||||
goto Fail;
|
||||
|
||||
if (strcmp (sstring, " +1.2345599999999999e-203 -4.700000E+00 5e+00 E\n"))
|
||||
if (strcmp (sstring, " +1.2345600000000000e-203 -4.700000E+00 5e+00 E\n"))
|
||||
goto Fail;
|
||||
|
||||
|
||||
|
@ -35,11 +35,11 @@ main ()
|
||||
|
||||
/* Test negative values. */
|
||||
a = -1e+308;
|
||||
if (fabs(a - (-1.E308)) > 1e-302)
|
||||
if (fabs(a - (double)(-1.E308)) > 1e-302)
|
||||
goto Fail;
|
||||
|
||||
a = -.1e-307;
|
||||
if (fabs(a - (-1.0e-308)) > 1e-302)
|
||||
if (fabs(a - (double)(-1.0e-308)) > 1e-302)
|
||||
goto Fail;
|
||||
|
||||
/* Test other miscellaneous values. */
|
||||
|
@ -34,12 +34,12 @@ main ()
|
||||
goto Fail;
|
||||
|
||||
/* Test negative values. */
|
||||
a = -1e+4932;
|
||||
if (fabs(a - (-1.E4932)) > 1e4920)
|
||||
a = -1e+4932L;
|
||||
if (fabs(a - (-1.E4932L)) > 1e4920L)
|
||||
goto Fail;
|
||||
|
||||
a = -.1e-4943;
|
||||
if (fabs(a - (-1.0e-4932)) > 1e-4935)
|
||||
a = -.1e-4943L;
|
||||
if (fabs(a - (-1.0e-4932L)) > 1e-4932L)
|
||||
goto Fail;
|
||||
|
||||
/* Test other miscellaneous values. */
|
||||
|
@ -84,7 +84,7 @@ main ()
|
||||
d1 [i] = &d; /* dimensioned array of */
|
||||
d = 123.0e50; /* pointers to double */
|
||||
for (k = 7; k >= 0; k--)
|
||||
if (fabs(*(d1 [k]) - 0.123E53) > 0.00001)
|
||||
if (fabs(*(d1 [k]) - (double)0.123E53) > 0.00001)
|
||||
goto Fail;
|
||||
|
||||
for (k = 8; k >= 0; k--) /* assign & check singly-dimensioned */
|
||||
|
@ -103,7 +103,7 @@ static int TestEm (void)
|
||||
d1 [i] = &d; /* dimensioned array of */
|
||||
d = 123.0e50; /* pointers to double */
|
||||
for (k = 7; k >= 0; k--)
|
||||
if (fabs(*(d1 [k]) - 0.123E53) > 0.00001)
|
||||
if (fabs(*(d1 [k]) - (double)0.123E53) > 0.00001)
|
||||
goto Fail;
|
||||
|
||||
for (k = 8; k >= 0; k--) /* assign & check singly-dimensioned */
|
||||
|
@ -20,7 +20,7 @@ main ()
|
||||
i--; L--; ch--; ui--; ul--; uch--; c--; f--; d--; e--;
|
||||
if ((i != 4) || (L != 32776) || (ch != 'x') || (ui != 65533) ||
|
||||
(ul != 0x7fFFffFE) || (uch != 0x7f) || (c != 4294967294ul) ||
|
||||
(f != 2.5) || (d != 86.65) || (e != 91.33))
|
||||
(f != 2.5) || (d != (double)86.65) || (e != 91.33))
|
||||
goto Fail;
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ main ()
|
||||
|
||||
if ((i != -5) || (L != 1) || (ch != '\v') || (ui != 217) ||
|
||||
(ul != 179) || (uch != 0) || (c != -477) ||
|
||||
(f != 1.0) || (d != 17.53) || (e != 92.33))
|
||||
(f != 1.0) || (d != (double)17.53) || (e != 92.33))
|
||||
goto Fail;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user