1 /********************************************************************
3 * Copyright (c) 2002-2012, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
11 #include "unicode/utypes.h"
12 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
17 typedef struct UText UText
;
19 class RegexTest
: public IntlTest
{
25 virtual void runIndexedTest(int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
27 // The following are test functions that are visible from the intltest test framework.
28 virtual void API_Match();
29 virtual void API_Pattern();
30 virtual void API_Replace();
32 virtual void Extended();
33 virtual void Errors();
34 virtual void PerlTests();
35 virtual void Bug6149();
36 virtual void Callbacks();
37 virtual void FindProgressCallbacks();
38 virtual void UTextBasic();
39 virtual void API_Match_UTF8();
40 virtual void API_Pattern_UTF8();
41 virtual void API_Replace_UTF8();
42 virtual void PerlTestsUTF8();
43 virtual void PreAllocatedUTextCAPI();
44 virtual void Bug7651();
45 virtual void Bug7740();
46 virtual void Bug8479();
47 virtual void Bug7029();
48 virtual void Bug9283();
49 virtual void CheckInvBufSize();
51 // The following functions are internal to the regexp tests.
52 virtual void assertUText(const char *expected
, UText
*actual
, const char *file
, int line
);
53 virtual void assertUTextInvariant(const char *invariant
, UText
*actual
, const char *file
, int line
);
54 virtual UBool
doRegexLMTest(const char *pat
, const char *text
, UBool looking
, UBool match
, int32_t line
);
55 virtual UBool
doRegexLMTestUTF8(const char *pat
, const char *text
, UBool looking
, UBool match
, int32_t line
);
56 virtual void regex_find(const UnicodeString
&pat
, const UnicodeString
&flags
,
57 const UnicodeString
&input
, const char *srcPath
, int32_t line
);
58 virtual void regex_err(const char *pat
, int32_t errline
, int32_t errcol
,
59 UErrorCode expectedStatus
, int32_t line
);
60 virtual UChar
*ReadAndConvertFile(const char *fileName
, int32_t &len
, const char *charset
, UErrorCode
&status
);
61 virtual const char *getPath(char buffer
[2048], const char *filename
);
63 static const char* extractToAssertBuf(const UnicodeString
& message
);
67 #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS