2 **********************************************************************
3 * Copyright (c) 2010,International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 **********************************************************************
9 #include "dtfmtrtperf.h"
16 DateTimeRoundTripPerfTest::DateTimeRoundTripPerfTest(int32_t argc
, const char* argv
[], UErrorCode
& status
)
17 : UPerfTest(argc
,argv
,status
) { }
19 DateTimeRoundTripPerfTest::~DateTimeRoundTripPerfTest() { }
21 UPerfFunction
* DateTimeRoundTripPerfTest::runIndexedTest(int32_t index
, UBool exec
,const char* &name
, char* par
) {
25 TESTCASE(0,RoundTripLocale1
); // 1 locale
26 TESTCASE(1,RoundTripLocale10
); // 10 locales
27 TESTCASE(2,RoundTripLocale11
); // 11 locales
28 TESTCASE(3,RoundTripLocale21
); // 21 locales w/ reverse order
37 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale1(){
38 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(1);
42 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale10(){
43 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(10);
47 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale11(){
48 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(11);
52 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale21(){
53 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(21);
57 int main(int argc
, const char* argv
[]){
59 cout
<< "ICU version - " << U_ICU_VERSION
<< endl
;
61 UErrorCode status
= U_ZERO_ERROR
;
62 DateTimeRoundTripPerfTest
test(argc
, argv
, status
);
63 if(U_FAILURE(status
)){
64 cout
<< "initialization failed! " << status
<< endl
;
68 if(test
.run()==FALSE
){
69 cout
<< "run failed!" << endl
;
70 fprintf(stderr
,"FAILED: Tests could not be run please check the arguments.\n");
74 cout
<< "done!" << endl
;