X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..08b89b0a244153b9f5bbb2f49c55ab0f7298122e:/icuSources/test/intltest/tchcfmt.cpp diff --git a/icuSources/test/intltest/tchcfmt.cpp b/icuSources/test/intltest/tchcfmt.cpp index d450a944..bd50389d 100644 --- a/icuSources/test/intltest/tchcfmt.cpp +++ b/icuSources/test/intltest/tchcfmt.cpp @@ -1,7 +1,7 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2008, International Business Machines Corporation and + * Copyright (c) 1997-2011, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -80,11 +80,23 @@ TestChoiceFormat::TestSimpleExample( void ) } delete formequal; delete formnew; - + //Testing getLimits() - double *gotLimits=0; int32_t count=0; - gotLimits=(double*)form->getLimits(count); + const double *gotLimits=form->getLimits(count); +#if 1 // ICU 4.8 deprecates and disables the ChoiceFormat getters. + if(count != 0 || gotLimits != NULL) { + errln("getLimits() returns something, should be disabled"); + } + const UnicodeString *gotFormats=form->getFormats(count); + if(count != 0 || gotFormats != NULL) { + errln("getFormats() returns something, should be disabled"); + } + const UBool *gotClosures=form->getClosures(count); + if(count != 0 || gotClosures != NULL) { + errln("getClosures() returns something, should be disabled"); + } +#else if(count != 7){ errln("getLimits didn't update the count correctly\n"); } @@ -93,10 +105,9 @@ TestChoiceFormat::TestSimpleExample( void ) errln((UnicodeString)"getLimits didn't get the limits correctly. Expected " + limits[ix] + " Got " + gotLimits[ix]); } } - //Testing getFormat() + //Testing getFormats() count=0; - UnicodeString *gotFormats=0; - gotFormats=(UnicodeString*)form->getFormats(count); + const UnicodeString *gotFormats=form->getFormats(count); if(count != 7){ errln("getFormats didn't update the count correctly\n"); } @@ -105,10 +116,9 @@ TestChoiceFormat::TestSimpleExample( void ) errln((UnicodeString)"getFormats didn't get the Formats correctly. Expected " + monthNames[ix] + " Got " + gotFormats[ix]); } } - - +#endif + delete form; - } void @@ -127,7 +137,7 @@ TestChoiceFormat::TestComplexExample( void ) Format* filenumform = NumberFormat::createInstance( status ); if (!filenumform) { - it_errln("*** test_complex_example filenumform"); + dataerrln((UnicodeString)"*** test_complex_example filenumform - " + u_errorName(status)); delete fileform; return; } @@ -216,6 +226,7 @@ TestChoiceFormat::TestComplexExample( void ) it_logln("------ additional testing in complex test ------"); it_logln(); // +#if 0 // ICU 4.8 deprecates and disables the ChoiceFormat getters. int32_t retCount; const double* retLimits = fileform->getLimits( retCount ); if ((retCount == 4) && (retLimits) @@ -238,6 +249,7 @@ TestChoiceFormat::TestComplexExample( void ) }else{ it_errln("*** getFormats unexpected result!"); } +#endif UnicodeString checkstr2[] = { "There is no folder on Disk_A", @@ -486,6 +498,7 @@ void TestChoiceFormat::TestClosures(void) { errln("FAIL: fmt1 != fmt2"); } +#if 0 // ICU 4.8 deprecates and disables the ChoiceFormat getters. int32_t i; int32_t count2 = 0; const double *limits2 = fmt2.getLimits(count2); @@ -507,6 +520,7 @@ void TestChoiceFormat::TestClosures(void) { } } } +#endif // Now test both format objects UnicodeString exp[] = { @@ -596,6 +610,7 @@ void TestChoiceFormat::TestPatterns(void) { 1.0, "b", 1.0 + 1e-9, "c"); +#if 0 // ICU 4.8 only checks the pattern syntax, not whether the ranges make sense. // Try an invalid pattern that isolates a single value. // [-Inf,1.0) [1.0,1.0) [1.0,+Inf] _testPattern("0.0#a|1.0#b|1.0#c", FALSE, @@ -614,6 +629,7 @@ void TestChoiceFormat::TestPatterns(void) { // [-Inf,2.0) [2.0,1.0) [1.0,+Inf] _testPattern("0.0#a|2.0#b|1.0#c", FALSE, 0, 0, 0, 0, 0, 0); +#endif } void TestChoiceFormat::TestChoiceFormatToPatternOverflow()