X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..e4f10fab0c078f399c9deef476d9c9b73b47dff8:/icuSources/test/intltest/tsputil.cpp diff --git a/icuSources/test/intltest/tsputil.cpp b/icuSources/test/intltest/tsputil.cpp index 1f4b66ee..009e3802 100644 --- a/icuSources/test/intltest/tsputil.cpp +++ b/icuSources/test/intltest/tsputil.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2006, International Business Machines Corporation and + * Copyright (c) 1997-2011, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -21,7 +21,6 @@ PUtilTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* / CASE(2, testPositiveInfinity) CASE(3, testNegativeInfinity) CASE(4, testZero) - CASE(5, testU_INLINE) // CASE(, testIEEEremainder) default: name = ""; break; //needed to end loop @@ -43,7 +42,7 @@ PUtilTest::testIEEEremainder() // 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. @@ -255,19 +254,19 @@ PUtilTest::testPositiveInfinity(void) 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."); } } @@ -293,19 +292,19 @@ PUtilTest::testNegativeInfinity(void) 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."); } } @@ -325,26 +324,26 @@ PUtilTest::testZero(void) 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."); } @@ -400,19 +399,19 @@ PUtilTest::NaNGT(void) 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"); } } @@ -427,19 +426,19 @@ PUtilTest::NaNLT(void) 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"); } } @@ -454,19 +453,19 @@ PUtilTest::NaNGTE(void) 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"); } } @@ -481,19 +480,19 @@ PUtilTest::NaNLTE(void) 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"); } } @@ -508,19 +507,19 @@ PUtilTest::NaNE(void) 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"); } } @@ -535,31 +534,19 @@ PUtilTest::NaNNE(void) 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"); } } - -U_INLINE int32_t inlineTriple(int32_t x) { - return 3*x; -} - -// "code" coverage test for Jitterbug 4515 RFE: in C++, use U_INLINE=inline -void -PUtilTest::testU_INLINE() { - if(inlineTriple(2)!=6 || inlineTriple(-55)!=-165) { - errln("inlineTriple() failed"); - } -}