diff options
Diffstat (limited to 'TAO/tests/Param_Test/bd_long_seq.cpp')
-rw-r--r-- | TAO/tests/Param_Test/bd_long_seq.cpp | 72 |
1 files changed, 45 insertions, 27 deletions
diff --git a/TAO/tests/Param_Test/bd_long_seq.cpp b/TAO/tests/Param_Test/bd_long_seq.cpp index 164ebec106d..7b2f584feaa 100644 --- a/TAO/tests/Param_Test/bd_long_seq.cpp +++ b/TAO/tests/Param_Test/bd_long_seq.cpp @@ -88,42 +88,53 @@ Test_Bounded_Long_Sequence::run_sii_test (Param_Test_ptr objref, int Test_Bounded_Long_Sequence::add_args (CORBA::NVList_ptr param_list, - CORBA::NVList_ptr retval, - CORBA::Environment &env) + CORBA::NVList_ptr retval, + CORBA::Environment &env) { - CORBA::Any in_arg (Param_Test::_tc_Bounded_Long_Seq, (void *) &this->in_.in (), 0); - CORBA::Any inout_arg (Param_Test::_tc_Bounded_Long_Seq, &this->inout_.inout (), 0); - // ORB will allocate - CORBA::Any out_arg (Param_Test::_tc_Bounded_Long_Seq, 0, 0); + CORBA::Any in_arg (Param_Test::_tc_Bounded_Long_Seq, + (void *) &this->in_.in (), + CORBA::B_FALSE); + + CORBA::Any inout_arg (Param_Test::_tc_Bounded_Long_Seq, + &this->inout_.inout (), + CORBA::B_FALSE); + + CORBA::Any out_arg (Param_Test::_tc_Bounded_Long_Seq, + &this->dii_out_, + CORBA::B_FALSE); // add parameters - (void)param_list->add_value ("s1", in_arg, CORBA::ARG_IN, env); - (void)param_list->add_value ("s2", inout_arg, CORBA::ARG_INOUT, env); - (void)param_list->add_value ("s3", out_arg, CORBA::ARG_OUT, env); + param_list->add_value ("s1", in_arg, CORBA::ARG_IN, env); + param_list->add_value ("s2", inout_arg, CORBA::ARG_INOUT, env); + param_list->add_value ("s3", out_arg, CORBA::ARG_OUT, env); // add return value type - (void)retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_Long_Seq, - 0, - 0, // does not own - env); + retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_Long_Seq, + &this->dii_ret_, + CORBA::B_FALSE, // does not own + env); return 0; } CORBA::Boolean -Test_Bounded_Long_Sequence::check_validity (void) +Test_Bounded_Long_Sequence::check_validity_engine + (const Param_Test::Bounded_Long_Seq &the_in, + const Param_Test::Bounded_Long_Seq &the_inout, + const Param_Test::Bounded_Long_Seq &the_out, + const Param_Test::Bounded_Long_Seq &the_ret) { CORBA::Boolean flag = 0; - if ((this->in_->length () == this->inout_->length ()) && - (this->in_->length () == this->out_->length ()) && - (this->in_->length () == this->ret_->length ())) + if ((the_in.length () == the_inout.length ()) && + (the_in.length () == the_out.length ()) && + (the_in.length () == the_ret.length ())) { flag = 1; // assume all are equal // lengths are same. Now compare the contents - for (CORBA::ULong i=0; i < this->in_->length () && flag; i++) + for (CORBA::ULong i=0; i < the_in.length () && flag; i++) { - if ((this->in_[i] != this->inout_[i]) || - (this->in_[i] != this->out_[i]) || - (this->in_[i] != this->ret_[i])) + if ((the_in[i] != the_inout[i]) || + (the_in[i] != the_out[i]) || + (the_in[i] != the_ret[i])) // not equal flag = 0; } @@ -132,14 +143,21 @@ Test_Bounded_Long_Sequence::check_validity (void) } CORBA::Boolean -Test_Bounded_Long_Sequence::check_validity (CORBA::Request_ptr req) +Test_Bounded_Long_Sequence::check_validity (void) { - CORBA::Environment env; - - *req->arguments ()->item (2, env)->value () >>= this->out_.out (); - *req->result ()->value () >>= this->ret_.out (); + return this->check_validity_engine (this->in_.in (), + this->inout_.in (), + this->out_.in (), + this->ret_.in ()); +} - return this->check_validity (); +CORBA::Boolean +Test_Bounded_Long_Sequence::check_validity (CORBA::Request_ptr req) +{ + return this->check_validity_engine (this->in_.in (), + this->inout_.in (), + this->dii_out_, + this->dii_ret_); } void |