1 /* This file is part of the yazpp toolkit.
2 * Copyright (C) 1998-2012 Index Data and Mike Taylor
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of Index Data nor the names of its contributors
13 * may be used to endorse or promote products derived from this
14 * software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include <yazpp/z-assoc.h>
30 using namespace yazpp_1;
41 class Zlint : public Z_Assoc {
43 Zlint(IPDU_Observable *the_PDU_Observable);
45 void add_test(Zlint_test *i);
46 void set_host(const char *cp);
47 int initResponseGetVersion(Z_InitResponse *init);
48 Z_ReferenceId *mk_refid(const char *buf, int len);
49 void msg_check_for(const char *fmt, ...);
51 void msg_check_fail(const char *fmt, ...);
52 void msg_check_info(const char *fmt, ...);
53 void msg_check_notapp();
54 void getDatabase(char ***db, int *num);
59 void recv_GDU(Z_GDU *apdu, int len);
60 IPDU_Observable *m_PDU_Observable;
61 IPDU_Observer *sessionNotify(IPDU_Observable *the_PDU_Observable, int fd);
66 void close_goto_next();
71 virtual Zlint_code init(Zlint *z) = 0;
72 virtual Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu) = 0;
73 virtual Zlint_code recv_fail(Zlint *z, int reason) = 0;
74 virtual ~Zlint_test();
77 class Zlint_test_simple : public Zlint_test {
79 virtual Zlint_code init(Zlint *z) = 0;
80 virtual Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu) = 0;
81 virtual Zlint_code recv_fail(Zlint *z, int reason);
84 class Zlint_test_init_01 : public Zlint_test_simple {
87 virtual ~Zlint_test_init_01();
88 Zlint_code init(Zlint *z);
89 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
92 class Zlint_test_init_02 : public Zlint_test_simple {
95 virtual ~Zlint_test_init_02();
96 Zlint_code init(Zlint *z);
97 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
100 class Zlint_test_init_03 : public Zlint_test_simple {
102 Zlint_test_init_03();
103 virtual ~Zlint_test_init_03();
104 Zlint_code init(Zlint *z);
105 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
108 class Zlint_test_init_04 : public Zlint_test_simple {
110 Zlint_test_init_04();
111 virtual ~Zlint_test_init_04();
112 Zlint_code init(Zlint *z);
113 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
116 class Zlint_test_init_05 : public Zlint_test_simple {
117 int m_init_response_no;
119 Zlint_test_init_05();
120 virtual ~Zlint_test_init_05();
121 Zlint_code init(Zlint *z);
122 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
125 class Zlint_test_init_06 : public Zlint_test_simple {
127 Zlint_test_init_06();
128 virtual ~Zlint_test_init_06();
129 Zlint_code init(Zlint *z);
130 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
133 class Zlint_test_init_07 : public Zlint_test_simple {
135 Zlint_test_init_07();
136 virtual ~Zlint_test_init_07();
137 Zlint_code init(Zlint *z);
138 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
141 class Zlint_test_init_08 : public Zlint_test {
144 Zlint_test_init_08();
145 virtual ~Zlint_test_init_08();
146 Zlint_code init(Zlint *z);
147 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
148 Zlint_code recv_fail(Zlint *z, int reason);
151 class Zlint_test_search_01 : public Zlint_test {
153 int m_got_result_set;
154 int m_record_syntax_no;
156 Zlint_code sendTest(Zlint *z);
158 Zlint_test_search_01();
159 virtual ~Zlint_test_search_01();
160 Zlint_code init(Zlint *z);
161 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
162 Zlint_code recv_fail(Zlint *z, int reason);
165 class Zlint_test_scan_01 : public Zlint_test {
167 Zlint_code sendTest(Zlint *z);
169 Zlint_test_scan_01();
170 virtual ~Zlint_test_scan_01();
171 Zlint_code init(Zlint *z);
172 Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
173 Zlint_code recv_fail(Zlint *z, int reason);
178 * c-file-style: "Stroustrup"
179 * indent-tabs-mode: nil
181 * vim: shiftwidth=4 tabstop=8 expandtab