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