]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/dcfmtest.h
ICU-64252.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / dcfmtest.h
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
729e4ab9
A
3/********************************************************************
4 * COPYRIGHT:
51004dcb 5 * Copyright (c) 2010-2012, International Business Machines Corporation and
729e4ab9
A
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
26class DecimalFormatTest: public IntlTest {
27public:
28
29 DecimalFormatTest();
30 virtual ~DecimalFormatTest();
31
32 virtual void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL );
33
34 // The following are test functions that are visible from the intltest test framework.
35 virtual void DataDrivenTests();
36
37 // The following functions are internal to the decimal format tests.
38 virtual UChar *ReadAndConvertFile(const char *fileName, int32_t &len, UErrorCode &status);
39 virtual const char *getPath(char buffer[2048], const char *filename);
40 virtual void execParseTest(int32_t lineNum,
41 const UnicodeString &inputText,
42 const UnicodeString &expectedType,
43 const UnicodeString &expectedDecimal,
44 UErrorCode &status);
45
51004dcb
A
46private:
47 enum EFormatInputType {
48 kFormattable,
49 kStringPiece
50 };
51
52public:
729e4ab9
A
53 virtual void execFormatTest(int32_t lineNum,
54 const UnicodeString &pattern,
55 const UnicodeString &round,
56 const UnicodeString &input,
57 const UnicodeString &expected,
51004dcb 58 EFormatInputType inType,
729e4ab9
A
59 UErrorCode &status);
60};
61
62#endif // !UCONFIG_NO_REGULAR_EXPRESSIONS
63#endif