Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / Param_Test / ulonglong.cpp
blobf605579e1838622abe38d280f8c2481196d8d31d
2 //=============================================================================
3 /**
4 * @file ulonglong.cpp
6 * tests 64 bit longs
8 * @author Aniruddha Gokhale
9 */
10 //=============================================================================
13 #include "helper.h"
14 #include "ulonglong.h"
16 Test_ULongLong::Test_ULongLong ()
17 : opname_ (CORBA::string_dup ("test_ulonglong"))
21 Test_ULongLong::~Test_ULongLong ()
23 CORBA::string_free (this->opname_);
24 this->opname_ = 0;
27 const char *
28 Test_ULongLong::opname () const
30 return this->opname_;
33 void
34 Test_ULongLong::dii_req_invoke (CORBA::Request *req)
36 req->add_in_arg ("s1") <<= this->in_;
37 req->add_inout_arg ("s2") <<= this->inout_;
38 req->add_out_arg ("s3") <<= this->out_;
40 req->set_return_type (CORBA::_tc_ulonglong);
42 req->invoke ();
44 req->return_value () >>= this->ret_;
46 CORBA::NamedValue_ptr o2 =
47 req->arguments ()->item (1);
48 *o2->value () >>= this->inout_;
50 CORBA::NamedValue_ptr o3 =
51 req->arguments ()->item (2);
52 *o3->value () >>= this->out_;
55 int
56 Test_ULongLong::init_parameters (Param_Test_ptr)
58 Generator *gen = GENERATOR::instance (); // value generator
60 this->in_ = gen->gen_long ();
61 this->inout_ = 0;
62 return 0;
65 int
66 Test_ULongLong::reset_parameters ()
68 this->inout_ = 0;
69 this->out_ = 0;
70 this->ret_ = 0;
71 return 0;
74 int
75 Test_ULongLong::run_sii_test (Param_Test_ptr objref)
77 try
79 this->ret_ = objref->test_ulonglong (this->in_,
80 this->inout_,
81 this->out_);
84 return 0;
86 catch (const CORBA::Exception& ex)
88 ex._tao_print_exception ("Test_ULongLong::run_sii_test\n");
90 return -1;
93 CORBA::Boolean
94 Test_ULongLong::check_validity ()
96 if (this->inout_ == this->in_ * 2 &&
97 this->out_ == this->in_ * 3 &&
98 this->ret_ == this->in_ * 4)
99 return 1; // success
100 else
101 return 0;
104 CORBA::Boolean
105 Test_ULongLong::check_validity (CORBA::Request_ptr )
107 return this->check_validity ();
110 void
111 Test_ULongLong::print_values ()
113 ACE_DEBUG ((LM_DEBUG,
114 "\n=*=*=*=*=*=*\n"
115 "in = %Q, "
116 "inout = %Q, "
117 "out = %Q, "
118 "ret = %Q\n"
119 "\n=*=*=*=*=*=*\n",
120 this->in_,
121 this->inout_,
122 this->out_,
123 this->ret_));