• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /********************************************************************
2  * COPYRIGHT:
3  * Copyright (c) 2010, International Business Machines Corporation and
4  * others. All Rights Reserved.
5  ********************************************************************/
6 
7 //
8 //   file:  dcfmtest.h
9 //
10 //   Data driven decimal formatter test.
11 //      Includes testing of both parsing and formatting.
12 //      Tests are in the text file dcfmtest.txt, in the source/test/testdata/ directory.
13 //
14 
15 #ifndef DCFMTEST_H
16 #define DCFMTEST_H
17 
18 #include "unicode/utypes.h"
19 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
20 
21 #include "intltest.h"
22 
23 
24 class DecimalFormatTest: public IntlTest {
25 public:
26 
27     DecimalFormatTest();
28     virtual ~DecimalFormatTest();
29 
30     virtual void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL );
31 
32     // The following are test functions that are visible from the intltest test framework.
33     virtual void DataDrivenTests();
34 
35     // The following functions are internal to the decimal format tests.
36     virtual UChar *ReadAndConvertFile(const char *fileName, int32_t &len, UErrorCode &status);
37     virtual const char *getPath(char buffer[2048], const char *filename);
38     virtual void execParseTest(int32_t lineNum,
39                               const UnicodeString &inputText,
40                               const UnicodeString &expectedType,
41                               const UnicodeString &expectedDecimal,
42                               UErrorCode &status);
43 
44     virtual void execFormatTest(int32_t lineNum,
45                                const UnicodeString &pattern,
46                                const UnicodeString &round,
47                                const UnicodeString &input,
48                                const UnicodeString &expected,
49                                UErrorCode &status);
50 };
51 
52 #endif   // !UCONFIG_NO_REGULAR_EXPRESSIONS
53 #endif
54