1 /********************************************************************
3 * Copyright (c) 1997-2003, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
8 * Normalizer basic tests
14 #include "unicode/utypes.h"
16 #if !UCONFIG_NO_NORMALIZATION
18 #include "unicode/normlzr.h"
21 class BasicNormalizerTest
: public IntlTest
{
23 BasicNormalizerTest();
24 virtual ~BasicNormalizerTest();
26 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
28 void TestHangulCompose(void);
29 void TestHangulDecomp(void);
30 void TestPrevious(void);
31 void TestDecomp(void);
32 void TestCompatDecomp(void);
33 void TestCanonCompose(void);
34 void TestCompatCompose(void);
35 void TestTibetan(void);
36 void TestCompositionExclusion(void);
37 void TestZeroIndex(void);
38 void TestVerisign(void);
39 void TestPreviousNext(void);
40 void TestNormalizerAPI(void);
41 void TestConcatenate(void);
42 void TestCompare(void);
43 void FindFoldFCDExceptions();
47 UnicodeString canonTests
[24][3];
48 UnicodeString compatTests
[11][3];
49 UnicodeString hangulCanon
[2][3];
52 TestPreviousNext(const UChar
*src
, int32_t srcLength
,
53 const UChar32
*expext
, int32_t expectLength
,
54 const int32_t *expectIndex
, // its length=expectLength+1
55 int32_t srcMiddle
, int32_t expectMiddle
,
57 UNormalizationMode mode
,
60 int32_t countFoldFCDExceptions(uint32_t foldingOptions
);
62 //------------------------------------------------------------------------
65 void backAndForth(Normalizer
* iter
, const UnicodeString
& input
);
67 void staticTest(UNormalizationMode mode
, int options
,
68 UnicodeString tests
[][3], int length
, int outCol
);
70 void iterateTest(Normalizer
* iter
, UnicodeString tests
[][3], int length
, int outCol
);
72 void assertEqual(const UnicodeString
& input
,
73 const UnicodeString
& expected
,
75 const UnicodeString
& errPrefix
);
77 static UnicodeString
hex(UChar ch
);
78 static UnicodeString
hex(const UnicodeString
& str
);
82 #endif /* #if !UCONFIG_NO_NORMALIZATION */