1 // © 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html 3 /******************************************************************** 4 * Copyright (c) 1997-2016, International Business Machines Corporation and 5 * others. All Rights Reserved. 6 ********************************************************************/ 7 8 #include "unicode/uniset.h" 9 #include "intltest.h" 10 11 /** Helper function for TestUnicodeData */ 12 U_CFUNC void U_CALLCONV unicodeDataLineFn(void *context, 13 char *fields[][2], int32_t fieldCount, 14 UErrorCode *pErrorCode); 15 16 U_CFUNC void U_CALLCONV 17 derivedPropsLineFn(void *context, 18 char *fields[][2], int32_t fieldCount, 19 UErrorCode *pErrorCode); 20 21 U_NAMESPACE_BEGIN 22 23 class Hashtable; 24 25 U_NAMESPACE_END 26 27 /** 28 * Test API and functionality of class Unicode 29 **/ 30 class UnicodeTest: public IntlTest { 31 public: 32 UnicodeTest(); 33 virtual ~UnicodeTest(); 34 35 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = nullptr ) override; 36 37 void TestAdditionalProperties(); 38 void TestBinaryValues(); 39 void TestConsistency(); 40 void TestPatternProperties(); 41 void TestScriptMetadata(); 42 void TestBidiPairedBracketType(); 43 void TestEmojiProperties(); 44 void TestEmojiPropertiesOfStrings(); 45 void TestIndicPositionalCategory(); 46 void TestIndicSyllabicCategory(); 47 void TestVerticalOrientation(); 48 void TestDefaultScriptExtensions(); 49 void TestInvalidCodePointFolding(); 50 void TestBinaryCharacterProperties(); 51 void TestIntCharacterProperties(); 52 void TestPropertyNames(); 53 54 private: 55 56 friend void U_CALLCONV unicodeDataLineFn(void *context, 57 char *fields[][2], int32_t fieldCount, 58 UErrorCode *pErrorCode); 59 60 friend void U_CALLCONV 61 derivedPropsLineFn(void *context, 62 char *fields[][2], int32_t fieldCount, 63 UErrorCode *pErrorCode); 64 65 UnicodeSet derivedProps[30]; 66 U_NAMESPACE_QUALIFIER Hashtable *unknownPropertyNames; 67 68 UBool compareUSets(const UnicodeSet &a, const UnicodeSet &b, 69 const char *a_name, const char *b_name, 70 UBool diffIsError); 71 }; 72