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