Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: source/test/cintltst/currtest.c

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/test/cintltst/cucdtst.c ('k') | source/test/cintltst/custrtrn.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /******************************************************************** 1 /********************************************************************
2 * COPYRIGHT: 2 * COPYRIGHT:
3 * Copyright (c) 2005-2012, International Business Machines Corporation and 3 * Copyright (c) 2005-2014, International Business Machines Corporation and
4 * others. All Rights Reserved. 4 * others. All Rights Reserved.
5 ********************************************************************/ 5 ********************************************************************/
6 #include "unicode/utypes.h" 6 #include "unicode/utypes.h"
7 7
8 #if !UCONFIG_NO_FORMATTING 8 #if !UCONFIG_NO_FORMATTING
9 #include "unicode/unum.h" 9 #include "unicode/unum.h"
10 #include "unicode/ucurr.h" 10 #include "unicode/ucurr.h"
11 #include "unicode/ustring.h" 11 #include "unicode/ustring.h"
12 #include "cintltst.h" 12 #include "cintltst.h"
13 #include "cstring.h" 13 #include "cstring.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (checkItemCount(UCURR_COMMON|UCURR_UNCOMMON) != 0) { 152 if (checkItemCount(UCURR_COMMON|UCURR_UNCOMMON) != 0) {
153 log_err("Error: UCURR_DEPRECATED|UCURR_NON_DEPRECATED should return 0 it ems\n"); 153 log_err("Error: UCURR_DEPRECATED|UCURR_NON_DEPRECATED should return 0 it ems\n");
154 } 154 }
155 } 155 }
156 156
157 static void TestFractionDigitOverride(void) { 157 static void TestFractionDigitOverride(void) {
158 UErrorCode status = U_ZERO_ERROR; 158 UErrorCode status = U_ZERO_ERROR;
159 UNumberFormat *fmt = unum_open(UNUM_CURRENCY, NULL, 0, "hu_HU", NULL, &statu s); 159 UNumberFormat *fmt = unum_open(UNUM_CURRENCY, NULL, 0, "hu_HU", NULL, &statu s);
160 UChar buffer[256]; 160 UChar buffer[256];
161 UChar expectedBuf[256]; 161 UChar expectedBuf[256];
162 const char expectedFirst[] = "123\\u00A0Ft"; 162 const char expectedFirst[] = "123,46\\u00A0HUF"; /* changed to use 2 fractio n digits */
163 const char expectedSecond[] = "123,46\\u00A0Ft"; 163 const char expectedSecond[] = "123,46\\u00A0HUF";
164 const char expectedThird[] = "123,456\\u00A0Ft"; 164 const char expectedThird[] = "123,456\\u00A0HUF";
165 if (U_FAILURE(status)) { 165 if (U_FAILURE(status)) {
166 log_data_err("Error: unum_open returned %s (Are you missing data?)\n", my ErrorName(status)); 166 log_data_err("Error: unum_open returned %s (Are you missing data?)\n", my ErrorName(status));
167 return; 167 return;
168 } 168 }
169 /* Make sure that you can format normal fraction digits. */ 169 /* Make sure that you can format normal fraction digits. */
170 unum_formatDouble(fmt, 123.456, buffer, sizeof(buffer)/sizeof(buffer[0]), NU LL, &status); 170 unum_formatDouble(fmt, 123.456, buffer, sizeof(buffer)/sizeof(buffer[0]), NU LL, &status);
171 u_unescape(expectedFirst, expectedBuf, strlen(expectedFirst)+1); 171 u_unescape(expectedFirst, expectedBuf, strlen(expectedFirst)+1);
172 if (u_strcmp(buffer, expectedBuf) != 0) { 172 if (u_strcmp(buffer, expectedBuf) != 0) {
173 log_err("Error: unum_formatDouble didn't return %s\n", expectedFirst); 173 log_err("Error: unum_formatDouble didn't return %s\n", expectedFirst);
174 } 174 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 { 266 {
267 TESTCASE(TestEnumList); 267 TESTCASE(TestEnumList);
268 TESTCASE(TestEnumListReset); 268 TESTCASE(TestEnumListReset);
269 TESTCASE(TestEnumListCount); 269 TESTCASE(TestEnumListCount);
270 TESTCASE(TestFractionDigitOverride); 270 TESTCASE(TestFractionDigitOverride);
271 TESTCASE(TestPrefixSuffix); 271 TESTCASE(TestPrefixSuffix);
272 TESTCASE(TestNumericCode); 272 TESTCASE(TestNumericCode);
273 } 273 }
274 274
275 #endif /* #if !UCONFIG_NO_FORMATTING */ 275 #endif /* #if !UCONFIG_NO_FORMATTING */
OLDNEW
« no previous file with comments | « source/test/cintltst/cucdtst.c ('k') | source/test/cintltst/custrtrn.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698