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

Side by Side Diff: icu46/source/test/cintltst/cformtst.c

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « icu46/source/test/cintltst/cformtst.h ('k') | icu46/source/test/cintltst/cfrtst.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 1997-2007, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 ********************************************************************/
6 /******************************************************************************* *
7 *
8 * File CFORMTST.C
9 *
10 * Modification History:
11 * Name Description
12 * Madhu Katragadda Creation
13 ******************************************************************************** *
14 */
15
16 /* FormatTest is a medium top level test for everything in the C FORMAT API */
17
18 #include "unicode/utypes.h"
19
20 #if !UCONFIG_NO_FORMATTING
21
22 #include "cintltst.h"
23 #include "cformtst.h"
24
25 void addCalTest(TestNode**);
26 void addDateForTest(TestNode**);
27 void addDateTimePatternGeneratorTest(TestNode** root);
28 void addNumForTest(TestNode**);
29 void addMsgForTest(TestNode**);
30 void addDateForRgrTest(TestNode**);
31 void addNumFrDepTest(TestNode**);
32 void addDtFrDepTest(TestNode**);
33 void addUtmsTest(TestNode**);
34 void addCurrencyTest(TestNode**);
35
36 void addFormatTest(TestNode** root);
37
38 void addFormatTest(TestNode** root)
39 {
40 addCalTest(root);
41 addDateForTest(root);
42 addDateTimePatternGeneratorTest(root);
43 addNumForTest(root);
44 addNumFrDepTest(root);
45 addMsgForTest(root);
46 addDateForRgrTest(root);
47 addDtFrDepTest(root);
48 addUtmsTest(root);
49 addCurrencyTest(root);
50 }
51 /*Internal functions used*/
52
53 UChar* myDateFormat(UDateFormat* dat, UDate d1)
54 {
55 UChar *result1=NULL;
56 int32_t resultlength, resultlengthneeded;
57 UErrorCode status = U_ZERO_ERROR;
58
59
60 resultlength=0;
61 resultlengthneeded=udat_format(dat, d1, NULL, resultlength, NULL, &status);
62 if(status==U_BUFFER_OVERFLOW_ERROR)
63 {
64 status=U_ZERO_ERROR;
65 resultlength=resultlengthneeded+1;
66 result1=(UChar*)ctst_malloc(sizeof(UChar) * resultlength);
67 udat_format(dat, d1, result1, resultlength, NULL, &status);
68 }
69 if(U_FAILURE(status))
70 {
71 log_err("Error in formatting using udat_format(.....): %s\n", myErrorNam e(status));
72 return 0;
73 }
74 return result1;
75
76 }
77
78 #endif /* #if !UCONFIG_NO_FORMATTING */
OLDNEW
« no previous file with comments | « icu46/source/test/cintltst/cformtst.h ('k') | icu46/source/test/cintltst/cfrtst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698