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
|
|
|
|
|
|
|
#include "intltest.h"
|
|
|
|
|
2002-03-01 17:00:29 +00:00
|
|
|
/** Helper function for TestUnicodeData */
|
|
|
|
U_CAPI void U_CALLCONV unicodeDataLineFn(void *context,
|
|
|
|
char *fields[][2], int32_t fieldCount,
|
|
|
|
UErrorCode *pErrorCode);
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
/**
|
|
|
|
* Test API and functionality of class Unicode
|
|
|
|
**/
|
|
|
|
class UnicodeTest: public IntlTest {
|
|
|
|
public:
|
|
|
|
UnicodeTest();
|
2000-12-09 03:17:45 +00:00
|
|
|
virtual ~UnicodeTest();
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* Test methods toUpperCase() and toLowerCase()
|
|
|
|
**/
|
|
|
|
void TestUpperLower(void);
|
|
|
|
/**
|
|
|
|
* Test methods isLetter() and isDigit()
|
|
|
|
**/
|
|
|
|
void TestLetterNumber(void);
|
|
|
|
/**
|
|
|
|
* Tests methods isControl() and isPrintable()
|
|
|
|
**/
|
|
|
|
void TestControlPrint(void);
|
|
|
|
/**
|
|
|
|
* Tests methods isJavaIdentifierStart(), isJavaIdentifierPart(),
|
|
|
|
* isUnicodeIdentifierStart() and isUnicodeIdentifierPart()
|
|
|
|
**/
|
|
|
|
void TestIdentifier(void);
|
|
|
|
/**
|
|
|
|
* Tests methods isDefined(), isBaseForm(), isSpaceChar() and getCellWidth()
|
|
|
|
**/
|
|
|
|
void TestMisc(void);
|
2001-01-23 23:52:49 +00:00
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
/**
|
|
|
|
* tests methods getType(), isTitleCase(), and toTitleCase()
|
|
|
|
* as well as characterDirection()
|
|
|
|
**/
|
|
|
|
void TestUnicodeData(void);
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
2000-05-04 17:27:16 +00:00
|
|
|
* tests methods isSingle(), isLead(), and isTrail()
|
|
|
|
**/
|
|
|
|
void TestCodeUnit(void);
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
2000-05-04 17:27:16 +00:00
|
|
|
* Tests for isSurrogate(), isUnicodeChar(), isError(), isValid()
|
2000-08-14 21:42:36 +00:00
|
|
|
**/
|
2000-05-04 17:27:16 +00:00
|
|
|
void TestCodePoint();
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
2000-05-04 17:27:16 +00:00
|
|
|
* Tests for needMultipleChar(), charLength()
|
2000-08-14 21:42:36 +00:00
|
|
|
**/
|
2000-05-04 17:27:16 +00:00
|
|
|
void TestCharLength();
|
2000-11-29 21:38:56 +00:00
|
|
|
/**
|
|
|
|
* Tests for getScript()
|
|
|
|
**/
|
|
|
|
void TestScript();
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* internal utility used by TestUnicodeData
|
|
|
|
**/
|
|
|
|
int32_t MakeProp(char* str);
|
|
|
|
/**
|
|
|
|
* internal utility used by TestUnicodeData
|
|
|
|
**/
|
|
|
|
int32_t MakeDir(char* str);
|
2002-03-01 17:00:29 +00:00
|
|
|
|
|
|
|
friend void U_CALLCONV unicodeDataLineFn(void *context,
|
|
|
|
char *fields[][2], int32_t fieldCount,
|
|
|
|
UErrorCode *pErrorCode);
|
1999-08-16 21:50:52 +00:00
|
|
|
};
|
|
|
|
|