/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2004, International Business Machines Corporation and
+ * Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
CASE(2, testPositiveInfinity)
CASE(3, testNegativeInfinity)
CASE(4, testZero)
-// CASE(5, testIEEEremainder)
+// CASE(, testIEEEremainder)
default: name = ""; break; //needed to end loop
}
// simple remainder checks
remainderTest(7.0, 2.5, -0.5);
remainderTest(7.0, -2.5, -0.5);
-#ifndef OS390
+#if U_PLATFORM != U_PF_OS390
// ### TODO:
// The following tests fails on S/390 with IEEE support in release builds;
// debug builds work.
errln(UnicodeString("FAIL: max(") + a + ", " + b + ") is " + result + ", expected " + exp);
else
errln(UnicodeString("FAIL: min(") + a + ", " + b + ") is " + result + ", expected " + exp);
- else
- if(max)
- logln(UnicodeString("OK: max(") + a + ", " + b + ") is " + result);
- else
- logln(UnicodeString("OK: min(") + a + ", " + b + ") is " + result);
+ else {
+ if (verbose) {
+ if(max)
+ logln(UnicodeString("OK: max(") + a + ", " + b + ") is " + result);
+ else
+ logln(UnicodeString("OK: min(") + a + ", " + b + ") is " + result);
+ }
+ }
}
//==============================
errln("FAIL: isNegativeInfinity(+Infinity) returned TRUE, should be FALSE.");
}
- if(pinf > DBL_MAX != TRUE) {
+ if((pinf > DBL_MAX) != TRUE) {
errln("FAIL: +Infinity > DBL_MAX returned FALSE, should be TRUE.");
}
- if(pinf > DBL_MIN != TRUE) {
+ if((pinf > DBL_MIN) != TRUE) {
errln("FAIL: +Infinity > DBL_MIN returned FALSE, should be TRUE.");
}
- if(pinf > ninf != TRUE) {
+ if((pinf > ninf) != TRUE) {
errln("FAIL: +Infinity > -Infinity returned FALSE, should be TRUE.");
}
- if(pinf > ten != TRUE) {
+ if((pinf > ten) != TRUE) {
errln("FAIL: +Infinity > 10.0 returned FALSE, should be TRUE.");
}
}
errln("FAIL: isPositiveInfinity(-Infinity) returned TRUE, should be FALSE.");
}
- if(ninf < DBL_MAX != TRUE) {
+ if((ninf < DBL_MAX) != TRUE) {
errln("FAIL: -Infinity < DBL_MAX returned FALSE, should be TRUE.");
}
- if(ninf < DBL_MIN != TRUE) {
+ if((ninf < DBL_MIN) != TRUE) {
errln("FAIL: -Infinity < DBL_MIN returned FALSE, should be TRUE.");
}
- if(ninf < pinf != TRUE) {
+ if((ninf < pinf) != TRUE) {
errln("FAIL: -Infinity < +Infinity returned FALSE, should be TRUE.");
}
- if(ninf < ten != TRUE) {
+ if((ninf < ten) != TRUE) {
errln("FAIL: -Infinity < 10.0 returned FALSE, should be TRUE.");
}
}
nzero *= -1;
- if(pzero == nzero != TRUE) {
+ if((pzero == nzero) != TRUE) {
errln("FAIL: 0.0 == -0.0 returned FALSE, should be TRUE.");
}
- if(pzero > nzero != FALSE) {
+ if((pzero > nzero) != FALSE) {
errln("FAIL: 0.0 > -0.0 returned TRUE, should be FALSE.");
}
- if(pzero >= nzero != TRUE) {
+ if((pzero >= nzero) != TRUE) {
errln("FAIL: 0.0 >= -0.0 returned FALSE, should be TRUE.");
}
- if(pzero < nzero != FALSE) {
+ if((pzero < nzero) != FALSE) {
errln("FAIL: 0.0 < -0.0 returned TRUE, should be FALSE.");
}
- if(pzero <= nzero != TRUE) {
+ if((pzero <= nzero) != TRUE) {
errln("FAIL: 0.0 <= -0.0 returned FALSE, should be TRUE.");
}
-#ifndef OS400 /* OS/400 will generate divide by zero exception MCH1214 */
+#if U_PLATFORM != U_PF_OS400 /* OS/400 will generate divide by zero exception MCH1214 */
if(uprv_isInfinite(1/pzero) != TRUE) {
errln("FAIL: isInfinite(1/0.0) returned FALSE, should be TRUE.");
}
double nan = uprv_getNaN();
double ten = 10.0;
- if(nan > nan != FALSE) {
+ if((nan > nan) != FALSE) {
logln("WARNING: NaN > NaN returned TRUE, should be FALSE");
}
- if(nan > pinf != FALSE) {
+ if((nan > pinf) != FALSE) {
logln("WARNING: NaN > +Infinity returned TRUE, should be FALSE");
}
- if(nan > ninf != FALSE) {
+ if((nan > ninf) != FALSE) {
logln("WARNING: NaN > -Infinity returned TRUE, should be FALSE");
}
- if(nan > ten != FALSE) {
+ if((nan > ten) != FALSE) {
logln("WARNING: NaN > 10.0 returned TRUE, should be FALSE");
}
}
double nan = uprv_getNaN();
double ten = 10.0;
- if(nan < nan != FALSE) {
+ if((nan < nan) != FALSE) {
logln("WARNING: NaN < NaN returned TRUE, should be FALSE");
}
- if(nan < pinf != FALSE) {
+ if((nan < pinf) != FALSE) {
logln("WARNING: NaN < +Infinity returned TRUE, should be FALSE");
}
- if(nan < ninf != FALSE) {
+ if((nan < ninf) != FALSE) {
logln("WARNING: NaN < -Infinity returned TRUE, should be FALSE");
}
- if(nan < ten != FALSE) {
+ if((nan < ten) != FALSE) {
logln("WARNING: NaN < 10.0 returned TRUE, should be FALSE");
}
}
double nan = uprv_getNaN();
double ten = 10.0;
- if(nan >= nan != FALSE) {
+ if((nan >= nan) != FALSE) {
logln("WARNING: NaN >= NaN returned TRUE, should be FALSE");
}
- if(nan >= pinf != FALSE) {
+ if((nan >= pinf) != FALSE) {
logln("WARNING: NaN >= +Infinity returned TRUE, should be FALSE");
}
- if(nan >= ninf != FALSE) {
+ if((nan >= ninf) != FALSE) {
logln("WARNING: NaN >= -Infinity returned TRUE, should be FALSE");
}
- if(nan >= ten != FALSE) {
+ if((nan >= ten) != FALSE) {
logln("WARNING: NaN >= 10.0 returned TRUE, should be FALSE");
}
}
double nan = uprv_getNaN();
double ten = 10.0;
- if(nan <= nan != FALSE) {
+ if((nan <= nan) != FALSE) {
logln("WARNING: NaN <= NaN returned TRUE, should be FALSE");
}
- if(nan <= pinf != FALSE) {
+ if((nan <= pinf) != FALSE) {
logln("WARNING: NaN <= +Infinity returned TRUE, should be FALSE");
}
- if(nan <= ninf != FALSE) {
+ if((nan <= ninf) != FALSE) {
logln("WARNING: NaN <= -Infinity returned TRUE, should be FALSE");
}
- if(nan <= ten != FALSE) {
+ if((nan <= ten) != FALSE) {
logln("WARNING: NaN <= 10.0 returned TRUE, should be FALSE");
}
}
double nan = uprv_getNaN();
double ten = 10.0;
- if(nan == nan != FALSE) {
+ if((nan == nan) != FALSE) {
logln("WARNING: NaN == NaN returned TRUE, should be FALSE");
}
- if(nan == pinf != FALSE) {
+ if((nan == pinf) != FALSE) {
logln("WARNING: NaN == +Infinity returned TRUE, should be FALSE");
}
- if(nan == ninf != FALSE) {
+ if((nan == ninf) != FALSE) {
logln("WARNING: NaN == -Infinity returned TRUE, should be FALSE");
}
- if(nan == ten != FALSE) {
+ if((nan == ten) != FALSE) {
logln("WARNING: NaN == 10.0 returned TRUE, should be FALSE");
}
}
double nan = uprv_getNaN();
double ten = 10.0;
- if(nan != nan != TRUE) {
+ if((nan != nan) != TRUE) {
logln("WARNING: NaN != NaN returned FALSE, should be TRUE");
}
- if(nan != pinf != TRUE) {
+ if((nan != pinf) != TRUE) {
logln("WARNING: NaN != +Infinity returned FALSE, should be TRUE");
}
- if(nan != ninf != TRUE) {
+ if((nan != ninf) != TRUE) {
logln("WARNING: NaN != -Infinity returned FALSE, should be TRUE");
}
- if(nan != ten != TRUE) {
+ if((nan != ten) != TRUE) {
logln("WARNING: NaN != 10.0 returned FALSE, should be TRUE");
}
}
-