• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
4  * COPYRIGHT:
5  * Copyright (c) 2010-2012, International Business Machines Corporation and
6  * others. All Rights Reserved.
7  ********************************************************************/
8 
9 //
10 //   file:  dcfmtest.h
11 //
12 //   Data driven decimal formatter test.
13 //      Includes testing of both parsing and formatting.
14 //      Tests are in the text file dcfmtest.txt, in the source/test/testdata/ directory.
15 //
16 
17 #ifndef DCFMTEST_H
18 #define DCFMTEST_H
19 
20 #include "unicode/utypes.h"
21 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
22 
23 #include "intltest.h"
24 
25 
26 class DecimalFormatTest: public IntlTest {
27 public:
28 
29     DecimalFormatTest();
30     virtual ~DecimalFormatTest();
31 
32     virtual void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL ) override;
33 
34     // The following are test functions that are visible from the intltest test framework.
35     virtual void DataDrivenTests();
36 
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 private:
45     enum EFormatInputType {
46         kFormattable,
47         kStringPiece
48     };
49 
50 public:
51     virtual void execFormatTest(int32_t lineNum,
52                                const UnicodeString &pattern,
53                                const UnicodeString &round,
54                                const UnicodeString &input,
55                                const UnicodeString &expected,
56                                EFormatInputType inType,
57                                UErrorCode &status);
58 };
59 
60 #endif   // !UCONFIG_NO_REGULAR_EXPRESSIONS
61 #endif
62