• 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) 1997-2001, International Business Machines Corporation and
6  * others. All Rights Reserved.
7  ********************************************************************/
8 
9 /**
10  * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
11  */
12 
13 #ifndef _INTLTESTFORMAT
14 #define _INTLTESTFORMAT
15 
16 #include "unicode/utypes.h"
17 
18 #if !UCONFIG_NO_FORMATTING
19 
20 #include "unicode/formattedvalue.h"
21 #include "intltest.h"
22 
23 
24 class IntlTestFormat: public IntlTest {
25     void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ) override;
26 };
27 
28 
29 typedef struct UFieldPositionWithCategory {
30     UFieldCategory category;
31     int32_t field;
32     int32_t beginIndex;
33     int32_t endIndex;
34 } UFieldPositionWithCategory;
35 
36 class IntlTestWithFieldPosition : public IntlTest {
37 public:
38     // Tests FormattedValue's toString, toTempString, and nextPosition methods.
39     //
40     // expectedCategory gets combined with expectedFieldPositions to call
41     // checkMixedFormattedValue.
42     void checkFormattedValue(
43         const char16_t* message,
44         const FormattedValue& fv,
45         UnicodeString expectedString,
46         UFieldCategory expectedCategory,
47         const UFieldPosition* expectedFieldPositions,
48         int32_t length);
49 
50     // Tests FormattedValue's toString, toTempString, and nextPosition methods.
51     void checkMixedFormattedValue(
52         const char16_t* message,
53         const FormattedValue& fv,
54         UnicodeString expectedString,
55         const UFieldPositionWithCategory* expectedFieldPositions,
56         int32_t length);
57 };
58 
59 
60 #endif /* #if !UCONFIG_NO_FORMATTING */
61 
62 #endif
63