2 ***********************************************************************
3 * © 2016 and later: Unicode, Inc. and others.
4 * License & terms of use: http://www.unicode.org/copyright.html#License
5 ***********************************************************************
6 ***********************************************************************
7 * Copyright (c) 2010,International Business Machines
8 * Corporation and others. All Rights Reserved.
9 ***********************************************************************
10 ***********************************************************************
13 #include "dtfmtrtperf.h"
20 DateTimeRoundTripPerfTest::DateTimeRoundTripPerfTest(int32_t argc
, const char* argv
[], UErrorCode
& status
)
21 : UPerfTest(argc
,argv
,status
) { }
23 DateTimeRoundTripPerfTest::~DateTimeRoundTripPerfTest() { }
25 UPerfFunction
* DateTimeRoundTripPerfTest::runIndexedTest(int32_t index
, UBool exec
,const char* &name
, char* par
) {
29 TESTCASE(0,RoundTripLocale1
); // 1 locale
30 TESTCASE(1,RoundTripLocale10
); // 10 locales
31 TESTCASE(2,RoundTripLocale11
); // 11 locales
32 TESTCASE(3,RoundTripLocale21
); // 21 locales w/ reverse order
41 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale1(){
42 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(1);
46 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale10(){
47 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(10);
51 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale11(){
52 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(11);
56 UPerfFunction
* DateTimeRoundTripPerfTest::RoundTripLocale21(){
57 DateTimeRoundTripFunction
* func
= new DateTimeRoundTripFunction(21);
61 int main(int argc
, const char* argv
[]){
63 cout
<< "ICU version - " << U_ICU_VERSION
<< endl
;
65 UErrorCode status
= U_ZERO_ERROR
;
66 DateTimeRoundTripPerfTest
test(argc
, argv
, status
);
67 if(U_FAILURE(status
)){
68 cout
<< "initialization failed! " << status
<< endl
;
72 if(test
.run()==FALSE
){
73 cout
<< "run failed!" << endl
;
74 fprintf(stderr
,"FAILED: Tests could not be run please check the arguments.\n");
78 cout
<< "done!" << endl
;