1 /****************************************************************************
3 * Copyright (c) 2001-2008, International Business Machines Corporation and others
5 ***************************************************************************/
10 #include "unicode/utypes.h"
12 #if !UCONFIG_NO_COLLATION
14 #include "unicode/tblcoll.h"
15 #include "unicode/brkiter.h"
17 #include "unicode/usearch.h"
20 typedef struct SearchData SearchData
;
22 class StringSearchTest
: public IntlTest
26 virtual ~StringSearchTest();
28 void runIndexedTest(int32_t index
, UBool exec
, const char* &name
,
30 #if !UCONFIG_NO_BREAK_ITERATION
32 RuleBasedCollator
*m_en_us_
;
33 RuleBasedCollator
*m_fr_fr_
;
34 RuleBasedCollator
*m_de_
;
35 RuleBasedCollator
*m_es_
;
36 BreakIterator
*m_en_wordbreaker_
;
37 BreakIterator
*m_en_characterbreaker_
;
39 RuleBasedCollator
* getCollator(const char *collator
);
40 BreakIterator
* getBreakIterator(const char *breaker
);
41 char * toCharString(const UnicodeString
&text
);
42 Collator::ECollationStrength
getECollationStrength(
43 const UCollationStrength
&strength
) const;
44 UBool
assertEqualWithStringSearch( StringSearch
*strsrch
,
45 const SearchData
*search
);
46 UBool
assertEqual(const SearchData
*search
);
47 UBool
assertCanonicalEqual(const SearchData
*search
);
48 UBool
assertEqualWithAttribute(const SearchData
*search
,
49 USearchAttributeValue canonical
,
50 USearchAttributeValue overlap
);
52 void TestInitialization();
56 #if !UCONFIG_NO_BREAK_ITERATION
57 void TestBreakIterator();
64 void TestCompositeBoundaries();
65 void TestGetSetOffset();
66 void TestGetSetAttribute();
70 void TestSupplementary();
71 void TestContraction();
74 void TestNormCanonical();
75 void TestStrengthCanonical();
76 #if !UCONFIG_NO_BREAK_ITERATION
77 void TestBreakIteratorCanonical();
79 void TestVariableCanonical();
80 void TestOverlapCanonical();
81 void TestCollatorCanonical();
82 void TestPatternCanonical();
83 void TestTextCanonical();
84 void TestCompositeBoundariesCanonical();
85 void TestGetSetOffsetCanonical();
86 void TestSupplementaryCanonical();
87 void TestContractionCanonical();
91 void TestDiacriticMatch();
95 #endif /* #if !UCONFIG_NO_COLLATION */