ICU-4620 properly fix unconfig failures.

X-SVN-Rev: 18188
This commit is contained in:
George Rhoten 2005-07-10 15:45:12 +00:00
parent 8dcffb23b3
commit 0ffb6e241f
6 changed files with 4 additions and 17 deletions

View File

@ -11,8 +11,6 @@
#include "hash.h" #include "hash.h"
#include <stdlib.h> #include <stdlib.h>
#if !UCONFIG_NO_CONVERSION
int32_t int32_t
DataMap::utoi(const UnicodeString &s) const DataMap::utoi(const UnicodeString &s) const
{ {
@ -71,7 +69,7 @@ void RBDataMap::init(UResourceBundle *data, UErrorCode &status) {
UResourceBundle *t = NULL; UResourceBundle *t = NULL;
for(i = 0; i < ures_getSize(data); i++) { for(i = 0; i < ures_getSize(data); i++) {
t = ures_getByIndex(data, i, t, &status); t = ures_getByIndex(data, i, t, &status);
fData->put(UnicodeString(ures_getKey(t), ""), new ResourceBundle(t, status), status); fData->put(UnicodeString(ures_getKey(t), -1, US_INV), new ResourceBundle(t, status), status);
} }
ures_close(t); ures_close(t);
} }
@ -102,7 +100,7 @@ const ResourceBundle *RBDataMap::getItem(const char* key, UErrorCode &status) co
return NULL; return NULL;
} }
UnicodeString hashKey(key, ""); UnicodeString hashKey(key, -1, US_INV);
const ResourceBundle *r = (ResourceBundle *)fData->get(hashKey); const ResourceBundle *r = (ResourceBundle *)fData->get(hashKey);
if(r != NULL) { if(r != NULL) {
return r; return r;
@ -220,5 +218,4 @@ const int32_t* RBDataMap::getIntArray(int32_t& count, const char* key, UErrorCod
return NULL; return NULL;
} }
} }
#endif

View File

@ -8,7 +8,6 @@
#include "unicode/testdata.h" #include "unicode/testdata.h"
#if !UCONFIG_NO_CONVERSION
TestData::TestData(const char* name) TestData::TestData(const char* name)
: name(name), : name(name),
@ -140,5 +139,4 @@ UBool RBTestData::nextCase(const DataMap *& nextCase, UErrorCode &status)
} }
} }
#endif

View File

@ -9,7 +9,6 @@
#include "unicode/tstdtmod.h" #include "unicode/tstdtmod.h"
#include "cmemory.h" #include "cmemory.h"
#if !UCONFIG_NO_CONVERSION
TestDataModule *TestDataModule::getTestDataModule(const char* name, TestLog& log, UErrorCode &status) TestDataModule *TestDataModule::getTestDataModule(const char* name, TestLog& log, UErrorCode &status)
{ {
@ -73,7 +72,7 @@ RBTestDataModule::RBTestDataModule(const char* name, TestLog& log, UErrorCode& s
fNumberOfTests = ures_getSize(fTestData); fNumberOfTests = ures_getSize(fTestData);
fInfoRB = ures_getByKey(fModuleBundle, "Info", NULL, &status); fInfoRB = ures_getByKey(fModuleBundle, "Info", NULL, &status);
if(status != U_ZERO_ERROR) { if(status != U_ZERO_ERROR) {
log.errln("Unable to initalize test data - missing mandatory description resources!"); log.errln(UNICODE_STRING_SIMPLE("Unable to initalize test data - missing mandatory description resources!"));
fDataTestValid = FALSE; fDataTestValid = FALSE;
} else { } else {
fInfo = new RBDataMap(fInfoRB, status); fInfo = new RBDataMap(fInfoRB, status);
@ -158,7 +157,7 @@ RBTestDataModule::getTestBundle(const char* bundleName, UErrorCode &status)
if (testBundle == NULL) { if (testBundle == NULL) {
testBundle = ures_openDirect(icu_data, bundleName, &status); testBundle = ures_openDirect(icu_data, bundleName, &status);
if (status != U_ZERO_ERROR) { if (status != U_ZERO_ERROR) {
fLog.errln(UnicodeString("Failed: could not load test data from resourcebundle: ") + UnicodeString(bundleName)); fLog.errln(UNICODE_STRING_SIMPLE("Failed: could not load test data from resourcebundle: ") + UnicodeString(bundleName, -1, US_INV));
fDataTestValid = FALSE; fDataTestValid = FALSE;
} }
} }
@ -168,4 +167,3 @@ RBTestDataModule::getTestBundle(const char* bundleName, UErrorCode &status)
} }
} }
#endif

View File

@ -12,7 +12,6 @@
#include "unicode/resbund.h" #include "unicode/resbund.h"
#include "unicode/testtype.h" #include "unicode/testtype.h"
#if !UCONFIG_NO_CONVERSION
U_NAMESPACE_BEGIN U_NAMESPACE_BEGIN
@ -134,7 +133,6 @@ public:
// ... etc ... // ... etc ...
}; };
#endif
#endif #endif

View File

@ -14,7 +14,6 @@
#include "unicode/tstdtmod.h" #include "unicode/tstdtmod.h"
#include "unicode/datamap.h" #include "unicode/datamap.h"
#if !UCONFIG_NO_CONVERSION
/** This is the class that abstracts one of the tests in a data file /** This is the class that abstracts one of the tests in a data file
* It is usually instantiated using TestDataModule::CreateTestData method * It is usually instantiated using TestDataModule::CreateTestData method
@ -109,5 +108,4 @@ public:
}; };
#endif #endif
#endif

View File

@ -18,7 +18,6 @@
#include "unicode/datamap.h" #include "unicode/datamap.h"
#include "unicode/testlog.h" #include "unicode/testlog.h"
#if !UCONFIG_NO_CONVERSION
/* This class abstracts the actual organization of the /* This class abstracts the actual organization of the
* data for data driven tests * data for data driven tests
@ -113,5 +112,4 @@ private:
#endif #endif
#endif