2 //=============================================================================
4 * @file fixed_struct.cpp
6 * tests fixed sized structs
8 * @author Aniruddha Gokhale
10 //=============================================================================
14 #include "fixed_struct.h"
16 // ************************************************************************
18 // ************************************************************************
20 Test_Fixed_Struct::Test_Fixed_Struct ()
21 : opname_ (CORBA::string_dup ("test_fixed_struct"))
25 Test_Fixed_Struct::~Test_Fixed_Struct ()
27 CORBA::string_free (this->opname_
);
32 Test_Fixed_Struct::opname () const
38 Test_Fixed_Struct::dii_req_invoke (CORBA::Request
*req
)
40 req
->add_in_arg ("s1") <<= this->in_
;
41 req
->add_inout_arg ("s2") <<= this->inout_
;
42 req
->add_out_arg ("s3") <<= this->out_
;
43 req
->set_return_type (Param_Test::_tc_Fixed_Struct
);
47 const Param_Test::Fixed_Struct
*tmp
= 0;
48 req
->return_value () >>= tmp
;
51 CORBA::NamedValue_ptr arg2
=
52 req
->arguments ()->item (1);
53 *arg2
->value () >>= tmp
;
56 CORBA::NamedValue_ptr arg3
=
57 req
->arguments ()->item (2);
58 *arg3
->value () >>= tmp
;
63 Test_Fixed_Struct::init_parameters (Param_Test_ptr
/*objref*/
66 Generator
*gen
= GENERATOR::instance (); // value generator
68 //ACE_UNUSED_ARG (objref);
70 this->in_
= gen
->gen_fixed_struct ();
71 ACE_OS::memset (&this->inout_
,
73 sizeof (Param_Test::Fixed_Struct
));
78 Test_Fixed_Struct::reset_parameters ()
80 ACE_OS::memset (&this->inout_
,
82 sizeof (Param_Test::Fixed_Struct
));
84 ACE_OS::memset (&this->out_
,
86 sizeof (Param_Test::Fixed_Struct
));
88 ACE_OS::memset (&this->ret_
,
90 sizeof (Param_Test::Fixed_Struct
));
96 Test_Fixed_Struct::run_sii_test (Param_Test_ptr objref
)
100 this->ret_
= objref
->test_fixed_struct (this->in_
,
106 catch (const CORBA::Exception
& ex
)
108 ex
._tao_print_exception ("Test_Fixed_Struct::run_sii_test\n");
114 Test_Fixed_Struct::check_validity ()
116 if (this->in_
.l
== this->inout_
.l
&&
117 this->in_
.c
== this->inout_
.c
&&
118 this->in_
.s
== this->inout_
.s
&&
119 this->in_
.o
== this->inout_
.o
&&
120 ACE::is_equal (this->in_
.f
, this->inout_
.f
) &&
121 this->in_
.b
== this->inout_
.b
&&
122 ACE::is_equal (this->in_
.d
, this->inout_
.d
) &&
123 this->in_
.l
== this->out_
.l
&&
124 this->in_
.c
== this->out_
.c
&&
125 this->in_
.s
== this->out_
.s
&&
126 this->in_
.o
== this->out_
.o
&&
127 ACE::is_equal (this->in_
.f
, this->out_
.f
) &&
128 this->in_
.b
== this->out_
.b
&&
129 ACE::is_equal (this->in_
.d
, this->out_
.d
) &&
130 this->in_
.l
== this->ret_
.l
&&
131 this->in_
.c
== this->ret_
.c
&&
132 this->in_
.s
== this->ret_
.s
&&
133 this->in_
.o
== this->ret_
.o
&&
134 ACE::is_equal (this->in_
.f
, this->ret_
.f
) &&
135 this->in_
.b
== this->ret_
.b
&&
136 ACE::is_equal (this->in_
.d
, this->ret_
.d
))
143 Test_Fixed_Struct::check_validity (CORBA::Request_ptr
/*req*/)
145 //ACE_UNUSED_ARG (req);
146 return this->check_validity ();
150 Test_Fixed_Struct::print_values ()
152 ACE_DEBUG ((LM_DEBUG
,