status=U_ZERO_ERROR;
resultlength=resultLengthOut+1;
result=(UChar*)malloc(sizeof(UChar) * resultlength);
- u_formatMessage( "fr", pattern, u_strlen(pattern), result, resultlength, &status, str , str1);
+ u_formatMessage( "fr", pattern, u_strlen(pattern), result, resultlength, &status, str , str1, 6);
if(u_strcmp(result, expected)==0)
log_verbose("PASS: MessagFormat successful on Select test#2\n");
else{
/* Null ptrs for strings, vectors */
test_format("Null string - %s", 50, 0, "Null string - *NULL*", __LINE__, NULL);
- test_format("Null string - %S", 50, 0, "Null string - *NULL*", __LINE__, NULL);
+ test_format("Null string - %S", 50, 0, "Null string - *NULL*", __LINE__, NULL, -1);
test_format("Null vector - %vc", 50, 0, "Null vector - *NULL* [00000002]", __LINE__, NULL, 2);
test_format("Null vector - %vC", 50, 0, "Null vector - *NULL* [00000002]", __LINE__, NULL, 2);
test_format("Null vector - %vd", 50, 0, "Null vector - *NULL* [00000002]", __LINE__, NULL, 2);
void NumberFormatTest::TestCurrencyUnit(void){
UErrorCode ec = U_ZERO_ERROR;
- static const UChar USD[] = {85, 83, 68, 0}; /*USD*/
- static const char USD8[] = {85, 83, 68, 0};
- static const UChar BAD[] = {63, 63, 63, 0}; /*???*/
- static const UChar BAD2[] = {63, 63, 65, 0}; /*???*/
- static const UChar XXX[] = u"XXX";
- static const char XXX8[] = {88, 88, 88};
+ static const UChar USD[] = u"USD";
+ static const char USD8[] = "USD";
+ static const UChar BAD[] = u"???";
+ static const UChar BAD2[] = u"??A";
+ static const UChar XXX[] = u"XXX";
+ static const char XXX8[] = "XXX";
CurrencyUnit cu(USD, ec);
assertSuccess("CurrencyUnit", ec);
assertSuccess("Constructing locale string", status);
Locale locale(localeId.data());
- NumberingSystem* ns = NumberingSystem::createInstance(locale, status);
- assertFalse("Should not be null", ns == nullptr);
+ LocalPointer<NumberingSystem> ns(NumberingSystem::createInstance(locale, status));
+ assertFalse("Should not be null", ns.getAlias() == nullptr);
assertSuccess("Should create with no error", status);
}
}
// Read in the dictionary source file
if (verbose) { printf("Opening file %s...\n", wordFileName); }
const char *codepage = "UTF-8";
- UCHARBUF *f = ucbuf_open(wordFileName, &codepage, TRUE, FALSE, status);
+ LocalUCHARBUFPointer f(ucbuf_open(wordFileName, &codepage, TRUE, FALSE, status));
if (status.isFailure()) {
fprintf(stderr, "error opening input file: ICU Error \"%s\"\n", status.errorName());
exit(status.reset());
int minlen = 255;
int maxlen = 0;
UBool isOk = TRUE;
- while (readLine(f, fileLine, status)) {
+ while (readLine(f.getAlias(), fileLine, status)) {
lineCount++;
if (fileLine.isEmpty()) continue;
-
+
// Parse word [spaces value].
int32_t keyLen;
for (keyLen = 0; keyLen < fileLine.length() && !u_isspace(fileLine[keyLen]); ++keyLen) {}
}
/* Parse the data into an SRBRoot */
- struct SRBRoot *data =
- parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), FALSE, FALSE, &errorCode);
+ LocalPointer<SRBRoot> data(
+ parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), FALSE, FALSE, &errorCode));
if (U_FAILURE(errorCode)) {
return;
}