164339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// Copyright (C) 2016 and later: Unicode, Inc. and others.
264339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// License & terms of use: http://www.unicode.org/copyright.html
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/*
4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *******************************************************************************
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *   Copyright (C) 2005, International Business Machines
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *   Corporation and others.  All Rights Reserved.
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *******************************************************************************
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *   created on: 2005jun15
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru *   created by: Raymond Yang
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef IDNA_CONF_TEST_H
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define IDNA_CONF_TEST_H
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "intltest.h"
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/ustring.h"
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass IdnaConfTest: public IntlTest {
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par=NULL);
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    IdnaConfTest();
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual ~IdnaConfTest();
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprivate:
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void Test(void);
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    // for test file handling
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UChar* base;
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    int len ;
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    int curOffset;
34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UBool  ReadAndConvertFile();
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    int isNewlineMark();
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UBool ReadOneLine(UnicodeString&);
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    // for parsing one test record
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeString id;   // for debug & error output
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeString namebase;
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeString namezone;
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    int type;     // 0 toascii,             1 tounicode
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    int option;   // 0 UseSTD3ASCIIRules,   1 ALLOW_UNASSIGNED
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    int passfail; // 0 pass,                1 fail
46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void ExplainCodePointTag(UnicodeString& buf);
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void Call();
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif /*IDNA_CONF_TEST_H*/
52