2000-01-15 02:00:06 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2001-03-21 20:09:56 +00:00
|
|
|
* Copyright (c) 1997-2001, International Business Machines Corporation and
|
2000-01-15 02:00:06 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Normalizer basic tests
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _TSTNORM
|
|
|
|
#define _TSTNORM
|
|
|
|
|
|
|
|
#ifndef _UTYPES
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COLL
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/coll.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _NORMLZR
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/normlzr.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _INTLTEST
|
|
|
|
#include "intltest.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class BasicNormalizerTest : public IntlTest {
|
|
|
|
public:
|
|
|
|
BasicNormalizerTest();
|
2000-12-09 03:17:45 +00:00
|
|
|
virtual ~BasicNormalizerTest();
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
void TestHangulCompose(void);
|
|
|
|
void TestHangulDecomp(void);
|
|
|
|
void TestPrevious(void);
|
|
|
|
void TestDecomp(void);
|
|
|
|
void TestCompatDecomp(void);
|
|
|
|
void TestCanonCompose(void);
|
|
|
|
void TestCompatCompose(void);
|
2000-07-13 22:13:13 +00:00
|
|
|
void TestTibetan(void);
|
|
|
|
void TestCompositionExclusion(void);
|
2000-07-18 18:41:50 +00:00
|
|
|
void TestZeroIndex(void);
|
2000-08-01 20:29:40 +00:00
|
|
|
void TestComposedCharIter(void);
|
2001-04-02 19:29:50 +00:00
|
|
|
void TestVerisign(void);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static UnicodeString canonTests[][3];
|
|
|
|
static UnicodeString compatTests[][3];
|
|
|
|
static UnicodeString hangulCanon[][3];
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Internal utilities
|
|
|
|
//
|
|
|
|
void backAndForth(Normalizer* iter, const UnicodeString& input);
|
|
|
|
|
|
|
|
void staticTest(Normalizer::EMode mode, int options,
|
|
|
|
UnicodeString tests[][3], int length, int outCol);
|
|
|
|
|
|
|
|
void iterateTest(Normalizer* iter, UnicodeString tests[][3], int length, int outCol);
|
|
|
|
|
|
|
|
void assertEqual(const UnicodeString& input,
|
|
|
|
const UnicodeString& expected,
|
|
|
|
Normalizer* result,
|
|
|
|
const UnicodeString& errPrefix);
|
|
|
|
|
|
|
|
static UnicodeString hex(UChar ch);
|
|
|
|
static UnicodeString hex(const UnicodeString& str);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _TSTNORM
|