]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/nccbtst.h
ICU-6.2.22.tar.gz
[apple/icu.git] / icuSources / test / cintltst / nccbtst.h
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 1997-2001, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /********************************************************************************
7 *
8 * File NCCBTST.H
9 *
10 * Modification History:
11 * Name Description
12 * Madhu Katragadda creation
13 *********************************************************************************
14 */
15 #ifndef _NCCBTST
16 #define _NCCBTST
17 /* C API TEST FOR CALL BACK ROUTINES OF CODESET CONVERSION COMPONENT */
18 #include "cintltst.h"
19 #include "unicode/utypes.h"
20
21
22 static void TestSkipCallBack(void);
23 static void TestStopCallBack(void);
24 static void TestSubCallBack(void);
25 static void TestSubWithValueCallBack(void);
26 static void TestLegalAndOtherCallBack(void);
27 static void TestSingleByteCallBack(void);
28
29
30 static void TestSkip(int32_t inputsize, int32_t outputsize);
31
32 static void TestStop(int32_t inputsize, int32_t outputsize);
33
34 static void TestSub(int32_t inputsize, int32_t outputsize);
35
36 static void TestSubWithValue(int32_t inputsize, int32_t outputsize);
37
38 static void TestLegalAndOthers(int32_t inputsize, int32_t outputsize);
39 static void TestSingleByte(int32_t inputsize, int32_t outputsize);
40 static void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize);
41
42 /* Following will return FALSE *only* on a mismach. They will return TRUE on any other error OR success, because
43 * the error would have been emitted to log_err separately. */
44
45 UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
46 const char *codepage, UConverterFromUCallback callback, const int32_t *expectOffsets,
47 const char *mySubChar, int8_t len);
48
49
50 UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
51 const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets,
52 const char *mySubChar, int8_t len);
53
54 UBool testConvertFromUnicodeWithContext(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
55 const char *codepage, UConverterFromUCallback callback , const int32_t *expectOffsets,
56 const char *mySubChar, int8_t len, const void* context, UErrorCode expectedError);
57
58 UBool testConvertToUnicodeWithContext( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
59 const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets,
60 const char *mySubChar, int8_t len, const void* context, UErrorCode expectedError);
61
62 static void printSeq(const uint8_t* a, int len);
63 static void printUSeq(const UChar* a, int len);
64 static void printSeqErr(const uint8_t* a, int len);
65 static void printUSeqErr(const UChar* a, int len);
66 static void setNuConvTestName(const char *codepage, const char *direction);
67
68
69 #endif