ICU-3931 Code-review comments and removed default constructor -same as Java

X-SVN-Rev: 27453
This commit is contained in:
Kirti Velankar 2010-01-30 03:21:38 +00:00
parent 632f3ce80c
commit 883c9a2bdf
2 changed files with 6 additions and 10 deletions

View file

@ -191,29 +191,25 @@ void SelectFormatTest::selectFormatAPITest(/*char *par*/)
for (int32_t i=0; i< numOfConstructors; ++i) {
status[i] = U_ZERO_ERROR;
}
selFmt[0]= new SelectFormat(status[0]);
selFmt[0]= new SelectFormat(SIMPLE_PATTERN, status[0]);
if ( U_FAILURE(status[0]) ) {
errln("ERROR: SelectFormat API test constructor with status failed!");
return;
}
selFmt[1]= new SelectFormat(SIMPLE_PATTERN, status[1]);
if ( U_FAILURE(status[1]) ) {
errln("ERROR: SelectFormat API test constructor with pattern and status failed!");
return;
}
// =========== Test copy constructor
logln("SelectFormat API test: Testing copy constructor and == operator ...");
SelectFormat fmt = *selFmt[1];
SelectFormat fmt = *selFmt[0];
SelectFormat* dupPFmt = new SelectFormat(fmt);
if ((*selFmt[1]) != (*dupPFmt)) {
if ((*selFmt[0]) != (*dupPFmt)) {
errln("ERROR: SelectFormat API test Failed in copy constructor or == operator!");
}
delete dupPFmt;
// ======= Test clone && == operator.
logln("SelectFormat API test: Testing clone and == operator ...");
if ( U_SUCCESS(status[0]) && U_SUCCESS(status[1]) ) {
if ( U_SUCCESS(status[0]) ) {
selFmt[1] = (SelectFormat*)selFmt[0]->clone();
if (selFmt[1]!=NULL) {
if ( *selFmt[1] != *selFmt[0] ) {

View file

@ -260,7 +260,7 @@ void UObjectTest::testIDs()
TESTCLASSID_CTOR(DateFormatSymbols, (status));
TESTCLASSID_CTOR(PluralFormat, (status));
TESTCLASSID_CTOR(PluralRules, (status));
TESTCLASSID_CTOR(SelectFormat, (status));
TESTCLASSID_CTOR(SelectFormat, (UnicodeString(), status) );
TESTCLASSID_FACTORY(DateTimePatternGenerator, DateTimePatternGenerator::createInstance(status));
TESTCLASSID_FACTORY(RelativeDateFormat, DateFormat::createDateInstance(DateFormat::kFullRelative, Locale::getUS()));
TESTCLASSID_CTOR(DecimalFormatSymbols, (status));