]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/cformtst.c
1 /********************************************************************
3 * Copyright (c) 1997-2004, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 ********************************************************************/
6 /********************************************************************************
10 * Modification History:
12 * Madhu Katragadda Creation
13 *********************************************************************************
16 /* FormatTest is a medium top level test for everything in the C FORMAT API */
18 #include "unicode/utypes.h"
20 #if !UCONFIG_NO_FORMATTING
25 void addCalTest(TestNode
**);
26 void addDateForTest(TestNode
**);
27 void addNumForTest(TestNode
**);
28 void addMsgForTest(TestNode
**);
29 void addDateForRgrTest(TestNode
**);
30 void addNumFrDepTest(TestNode
**);
31 void addDtFrDepTest(TestNode
**);
32 void addUtmsTest(TestNode
**);
34 void addFormatTest(TestNode
** root
);
36 void addFormatTest(TestNode
** root
)
41 addNumFrDepTest(root
);
43 addDateForRgrTest(root
);
48 /*Internal functions used*/
50 UChar
* myDateFormat(UDateFormat
* dat
, UDate d1
)
53 int32_t resultlength
, resultlengthneeded
;
54 UErrorCode status
= U_ZERO_ERROR
;
58 resultlengthneeded
=udat_format(dat
, d1
, NULL
, resultlength
, NULL
, &status
);
59 if(status
==U_BUFFER_OVERFLOW_ERROR
)
62 resultlength
=resultlengthneeded
+1;
63 result1
=(UChar
*)ctst_malloc(sizeof(UChar
) * resultlength
);
64 udat_format(dat
, d1
, result1
, resultlength
, NULL
, &status
);
68 log_err("Error in formatting using udat_format(.....): %s\n", myErrorName(status
));
75 #endif /* #if !UCONFIG_NO_FORMATTING */