1 /* This file is part of the yazpp toolkit.
2 * Copyright (C) 1998-2009 Index Data and Mike Taylor
3 * See the file LICENSE for details.
10 Zlint_test_init_06::Zlint_test_init_06()
14 Zlint_test_init_06::~Zlint_test_init_06()
18 Zlint_code Zlint_test_init_06::init(Zlint *z)
21 Z_APDU *apdu = z->create_Z_PDU(Z_APDU_initRequest);
22 Z_InitRequest *init = apdu->u.initRequest;
24 z->msg_check_for("for init options");
26 /* set all options.. see what target really supports .. */
27 ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
28 ODR_MASK_ZERO(init->options);
30 for (i = 0; i <= 24; i++)
31 ODR_MASK_SET(init->options, i);
33 int r = z->send_Z_PDU(apdu, &len);
36 z->msg_check_fail("unable to send init request");
42 Zlint_code Zlint_test_init_06::recv_gdu(Zlint *z, Z_GDU *gdu)
44 if (gdu->which == Z_GDU_Z3950 &&
45 gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse)
47 Z_InitResponse *init = gdu->u.z3950->u.initResponse;
54 for (i = 0; i <= 24; i++)
55 if (ODR_MASK_GET(init->options, i))
61 z->msg_check_fail("suspicuously few option bits set");
66 z->msg_check_fail("suspicuously many option bits set");
73 z->msg_check_fail("did not receive init response as expected");
81 * c-file-style: "Stroustrup"
82 * indent-tabs-mode: nil
84 * vim: shiftwidth=4 tabstop=8 expandtab