X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/2ca993e82fb37b597a3c73ecd1586a139a6579c5..0f5d89e82340278ed3d7d50029f37cab2c41a57e:/icuSources/test/cintltst/cnmdptst.c diff --git a/icuSources/test/cintltst/cnmdptst.c b/icuSources/test/cintltst/cnmdptst.c index 14c70747..de04e2c6 100644 --- a/icuSources/test/cintltst/cnmdptst.c +++ b/icuSources/test/cintltst/cnmdptst.c @@ -1,3 +1,5 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: * Copyright (c) 1997-2016, International Business Machines Corporation @@ -67,7 +69,7 @@ static void TestPatterns(void) UChar *str=NULL; UErrorCode status = U_ZERO_ERROR; const char* pat[] = { "#.#", "#.", ".#", "#" }; - const char* newpat[] = { "#0.#", "#0.", "#.0", "#" }; + const char* newpat[] = { "#0.#", "#0.", "#.0", "#" }; // ICU 61 behavior const char* num[] = { "0", "0.", ".0", "0" }; log_verbose("\nTesting different format patterns\n"); @@ -470,7 +472,7 @@ static void TestCurrencyPreEuro(void) "nl_NL_PREEURO", }; - const char* result[]={ + const char* result[]={ // ICU 61 behavior "\\u20A7\\u00A02", "2\\u00A0F", "IEP1.50", "1,50\\u00A0mk", "2\\u00A0F", "ITL\\u00A02", "1$50\\u00A0\\u200B", "\\u00F6S\\u00A01,50", "1,50\\u00A0\\u0394\\u03C1\\u03C7", "2\\u00A0\\u20A7", "1,50\\u00A0FB", "IEP1.50", "1,50\\u00A0BEF", "1,50\\u00A0DM", "1,50\\u00A0BEF", "\\u20A7\\u00A02", "1,50\\u00A0F", "2\\u00A0\\u20A7", @@ -729,17 +731,17 @@ static void TestSecondaryGrouping(void) { u_uastrcpy(buffer, "12,34,56,789"); if ((u_strcmp(resultBuffer, buffer) != 0) || U_FAILURE(status)) { - log_err("Fail: Formatting \"#,##,###\" pattern with 123456789 got %s, expected %s\n", resultBuffer, "12,34,56,789"); + log_err("Fail: Formatting \"#,##,###\" pattern with 123456789 got %s, expected %s\n", austrdup(resultBuffer), "12,34,56,789"); } if (pos.beginIndex != 0 && pos.endIndex != 12) { log_err("Fail: Formatting \"#,##,###\" pattern pos = (%d, %d) expected pos = (0, 12)\n", pos.beginIndex, pos.endIndex); } memset(resultBuffer,0, sizeof(UChar)*512); unum_toPattern(f, FALSE, resultBuffer, 512, &status); - u_uastrcpy(buffer, "#,##,###"); + u_uastrcpy(buffer, "#,##,###"); // ICU 61 behavior if ((u_strcmp(resultBuffer, buffer) != 0) || U_FAILURE(status)) { - log_err("Fail: toPattern() got %s, expected %s\n", resultBuffer, "#,##,###"); + log_err("Fail: toPattern() got %s, expected %s\n", austrdup(resultBuffer), "#,##,###"); } memset(resultBuffer,0, sizeof(UChar)*512); u_uastrcpy(buffer, "#,###"); @@ -753,14 +755,14 @@ static void TestSecondaryGrouping(void) { u_uastrcpy(buffer, "12,3456,789"); if ((u_strcmp(resultBuffer, buffer) != 0) || U_FAILURE(status)) { - log_err("Fail: Formatting \"#,###\" pattern with 123456789 got %s, expected %s\n", resultBuffer, "12,3456,789"); + log_err("Fail: Formatting \"#,###\" pattern with 123456789 got %s, expected %s\n", austrdup(resultBuffer), "12,3456,789"); } memset(resultBuffer,0, sizeof(UChar)*512); unum_toPattern(f, FALSE, resultBuffer, 512, &status); - u_uastrcpy(buffer, "#,####,###"); + u_uastrcpy(buffer, "#,####,###"); // ICU 61 behavior if ((u_strcmp(resultBuffer, buffer) != 0) || U_FAILURE(status)) { - log_err("Fail: toPattern() got %s, expected %s\n", resultBuffer, "#,####,###"); + log_err("Fail: toPattern() got %s, expected %s\n", austrdup(resultBuffer), "#,####,###"); } memset(resultBuffer,0, sizeof(UChar)*512); g = unum_open(UNUM_DECIMAL, NULL,0,"hi_IN",NULL, &status);