diff options
author | jp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-09 05:44:31 +0000 |
---|---|---|
committer | jp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-09 05:44:31 +0000 |
commit | 704d07cc8694e12179a97d4c9e17193435820815 (patch) | |
tree | 3660ee3eb862ce9ed1596d91f5b45eadd00ac912 | |
parent | a79e69a8eb6d4bd460b5d73ccc3a992d97874986 (diff) | |
download | ATCD-704d07cc8694e12179a97d4c9e17193435820815.tar.gz |
*** empty log message ***
26 files changed, 437 insertions, 278 deletions
diff --git a/TAO/tests/Param_Test/any.cpp b/TAO/tests/Param_Test/any.cpp index b7231413263..ff3f00fdd78 100644 --- a/TAO/tests/Param_Test/any.cpp +++ b/TAO/tests/Param_Test/any.cpp @@ -179,17 +179,28 @@ Test_Any::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); CORBA::Any out_arg (CORBA::_tc_any, - &this->out_.inout (), + &this->out_.inout (), // .out () causes crash CORBA::B_FALSE); // add parameters - param_list->add_value ("o1", in_arg, CORBA::ARG_IN, env); - param_list->add_value ("o2", inout_arg, CORBA::ARG_INOUT, env); - param_list->add_value ("o3", out_arg, CORBA::ARG_OUT, env); + param_list->add_value ("o1", + in_arg, + CORBA::ARG_IN, + env); + + param_list->add_value ("o2", + inout_arg, + CORBA::ARG_INOUT, + env); + + param_list->add_value ("o3", + out_arg, + CORBA::ARG_OUT, + env); // add return value retval->item (0, env)->value ()->replace (CORBA::_tc_any, - &this->ret_.inout (), + &this->ret_.inout (), // see above CORBA::B_FALSE, // does not own env); return 0; @@ -198,7 +209,6 @@ Test_Any::add_args (CORBA::NVList_ptr param_list, CORBA::Boolean Test_Any::check_validity (void) { - CORBA::Environment env; CORBA::Short short_in, short_inout, short_out, short_ret; char *str_in, *str_inout, *str_out, *str_ret; Coffee_ptr obj_in, obj_inout, obj_out, obj_ret; diff --git a/TAO/tests/Param_Test/bd_long_seq.cpp b/TAO/tests/Param_Test/bd_long_seq.cpp index 0a94dadea55..03046ebf34a 100644 --- a/TAO/tests/Param_Test/bd_long_seq.cpp +++ b/TAO/tests/Param_Test/bd_long_seq.cpp @@ -61,7 +61,7 @@ Test_Bounded_Long_Sequence::init_parameters (Param_Test_ptr objref, for (CORBA::ULong i=0; i < this->in_->maximum (); i++) { this->in_[i] = i; - this->inout_[i] = i+1; + this->inout_[i] = i+1; // different from in_ } return 0; } @@ -105,9 +105,20 @@ Test_Bounded_Long_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_Long_Seq, diff --git a/TAO/tests/Param_Test/bd_short_seq.cpp b/TAO/tests/Param_Test/bd_short_seq.cpp index a7695f8e4cc..b3450ed743a 100644 --- a/TAO/tests/Param_Test/bd_short_seq.cpp +++ b/TAO/tests/Param_Test/bd_short_seq.cpp @@ -63,7 +63,7 @@ Test_Bounded_Short_Sequence::init_parameters (Param_Test_ptr objref, // generate some arbitrary string to be filled into the ith location in // the sequence this->in_[i] = i; - this->inout_[i] = i+1; + this->inout_[i] = i+1; // different from in_ } return 0; } @@ -107,9 +107,20 @@ Test_Bounded_Short_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_Short_Seq, diff --git a/TAO/tests/Param_Test/bd_str_seq.cpp b/TAO/tests/Param_Test/bd_str_seq.cpp index ebf27cbecb6..61a9c2e3f21 100644 --- a/TAO/tests/Param_Test/bd_str_seq.cpp +++ b/TAO/tests/Param_Test/bd_str_seq.cpp @@ -68,7 +68,7 @@ Test_Bounded_String_Sequence::init_parameters (Param_Test_ptr objref, for (CORBA::ULong i=0; i < this->in_->length (); i++) { this->in_[i] = choiceList[i%3]; - this->inout_[i] = choiceList[(i+1)%3]; + this->inout_[i] = choiceList[(i+1)%3]; // different from in_ } return 0; } @@ -112,9 +112,20 @@ Test_Bounded_String_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_StrSeq, diff --git a/TAO/tests/Param_Test/client.cpp b/TAO/tests/Param_Test/client.cpp index 53586310706..5e660c973f1 100644 --- a/TAO/tests/Param_Test/client.cpp +++ b/TAO/tests/Param_Test/client.cpp @@ -52,10 +52,6 @@ Param_Test_Client<T>::run_sii_test (void) CORBA::Environment env; // to track errors Options *opt = OPTIONS::instance (); // get the options const char *opname = this->test_object_->opname (); // operation - - ACE_DEBUG ((LM_DEBUG, - "********** %s SII *********\n", - opname)); // Initialize call count and error count. this->results_.call_count (0); @@ -68,7 +64,6 @@ Param_Test_Client<T>::run_sii_test (void) "(%N:%l) client.cpp - run_sii_test:" "init_parameters failed for opname - %s", opname), -1); - // Make the calls in a loop. for (i = 0; i < opt->loop_count (); i++) { @@ -112,25 +107,13 @@ Param_Test_Client<T>::run_sii_test (void) // reset parameters for the test. if (this->test_object_->reset_parameters () == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) client.cpp - run_sii_test:" + "(%N:%l) client.cpp - run_dii_test:" "init_parameters failed for opname - %s", opname), -1); } // print statistics - this->results_.print_stats (); - if (this->results_.error_count () != 0) - { - ACE_DEBUG ((LM_DEBUG, - "********** Error running %s SII *********\n", - opname)); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "********** Finished running %s SII *********\n", - opname)); - } + this->results_.print_stats (/*this->test_object_->opname ()*/); return this->results_.error_count ()? -1:0; } @@ -142,15 +125,12 @@ Param_Test_Client<T>::run_dii_test (void) Options *opt = OPTIONS::instance (); CORBA::Environment env; // environment - ACE_DEBUG ((LM_DEBUG, - "********** %s DII *********\n", - opname)); - // initialize call count and error count this->results_.call_count (0); this->results_.error_count (0); this->results_.iterations (opt->loop_count ()); + // initialize parameters for the test if (this->test_object_->init_parameters (this->param_test_, env) == -1) ACE_ERROR_RETURN ((LM_ERROR, @@ -242,19 +222,7 @@ Param_Test_Client<T>::run_dii_test (void) } // for loop // print statistics - this->results_.print_stats (); - if (this->results_.error_count () != 0) - { - ACE_DEBUG ((LM_DEBUG, - "********** Error running %s DII *********\n", - opname)); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "********** Finished running %s DII *********\n", - opname)); - } + this->results_.print_stats (/*opname*/); return this->results_.error_count ()? -1:0; } diff --git a/TAO/tests/Param_Test/client.dsp b/TAO/tests/Param_Test/client.dsp index 82b72739b8c..be2c9bf7c3b 100644 --- a/TAO/tests/Param_Test/client.dsp +++ b/TAO/tests/Param_Test/client.dsp @@ -64,7 +64,7 @@ LINK32=link.exe # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
+# PROP Intermediate_Dir "Debug\client"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@@ -226,6 +226,10 @@ SOURCE=.\bd_str_seq.h # End Source File
# Begin Source File
+SOURCE=.\bd_string.h
+# End Source File
+# Begin Source File
+
SOURCE=.\bd_struct_seq.h
# End Source File
# Begin Source File
diff --git a/TAO/tests/Param_Test/driver.cpp b/TAO/tests/Param_Test/driver.cpp index 8756f1b90e3..ac1efbf064b 100644 --- a/TAO/tests/Param_Test/driver.cpp +++ b/TAO/tests/Param_Test/driver.cpp @@ -16,10 +16,6 @@ // // ============================================================================ -#include "options.h" -#include "results.h" -#include "client.h" -#include "tests.h" #include "driver.h" ACE_RCSID(Param_Test, driver, "$Id$") diff --git a/TAO/tests/Param_Test/driver.h b/TAO/tests/Param_Test/driver.h index 11456c125ab..c8a782230d8 100644 --- a/TAO/tests/Param_Test/driver.h +++ b/TAO/tests/Param_Test/driver.h @@ -20,6 +20,10 @@ #if !defined (DRIVER_H) #define DRIVER_H +#include "options.h" +#include "results.h" +#include "client.h" +#include "tests.h" #include "ace/Get_Opt.h" class Driver diff --git a/TAO/tests/Param_Test/fixed_array.cpp b/TAO/tests/Param_Test/fixed_array.cpp index 54c3d3fa91e..6b6ece8f27a 100644 --- a/TAO/tests/Param_Test/fixed_array.cpp +++ b/TAO/tests/Param_Test/fixed_array.cpp @@ -106,9 +106,20 @@ Test_Fixed_Array::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - param_list->add_value ("l1", in_arg, CORBA::ARG_IN, env); - param_list->add_value ("l2", inout_arg, CORBA::ARG_INOUT, env); - param_list->add_value ("l3", out_arg, CORBA::ARG_OUT, env); + param_list->add_value ("l1", + in_arg, + CORBA::ARG_IN, + env); + + param_list->add_value ("l2", + inout_arg, + CORBA::ARG_INOUT, + env); + + param_list->add_value ("l3", + out_arg, + CORBA::ARG_OUT, + env); // add return value type retval->item (0, env)->value ()->replace (Param_Test::_tc_Fixed_Array, diff --git a/TAO/tests/Param_Test/fixed_struct.cpp b/TAO/tests/Param_Test/fixed_struct.cpp index e69c68b0b7e..68d534b3602 100644 --- a/TAO/tests/Param_Test/fixed_struct.cpp +++ b/TAO/tests/Param_Test/fixed_struct.cpp @@ -16,8 +16,6 @@ // // ============================================================================ -#include "helper.h" - #include "fixed_struct.h" ACE_RCSID(Param_Test, fixed_struct, "$Id$") @@ -53,16 +51,27 @@ Test_Fixed_Struct::init_parameters (Param_Test_ptr objref, ACE_UNUSED_ARG (env); this->in_ = gen->gen_fixed_struct (); - ACE_OS::memset (&this->inout_, 0, sizeof (Param_Test::Fixed_Struct)); + ACE_OS::memset (&this->inout_, + 0, + sizeof (Param_Test::Fixed_Struct)); return 0; } int Test_Fixed_Struct::reset_parameters (void) { - ACE_OS::memset (&this->inout_, 0, sizeof (Param_Test::Fixed_Struct)); - ACE_OS::memset (&this->out_, 0, sizeof (Param_Test::Fixed_Struct)); - ACE_OS::memset (&this->ret_, 0, sizeof (Param_Test::Fixed_Struct)); + ACE_OS::memset (&this->inout_, + 0, + sizeof (Param_Test::Fixed_Struct)); + + ACE_OS::memset (&this->out_, + 0, + sizeof (Param_Test::Fixed_Struct)); + + ACE_OS::memset (&this->ret_, + 0, + sizeof (Param_Test::Fixed_Struct)); + return 0; } @@ -70,7 +79,9 @@ int Test_Fixed_Struct::run_sii_test (Param_Test_ptr objref, CORBA::Environment &env) { - this->ret_ = objref->test_fixed_struct (this->in_, this->inout_, this->out_, + this->ret_ = objref->test_fixed_struct (this->in_, + this->inout_, + this->out_, env); return (env.exception () ? -1:0); } @@ -82,20 +93,39 @@ Test_Fixed_Struct::add_args (CORBA::NVList_ptr param_list, { // We provide the top level memory // the Any does not own any of these - CORBA::Any in_arg (Param_Test::_tc_Fixed_Struct, &this->in_, 0); - CORBA::Any inout_arg (Param_Test::_tc_Fixed_Struct, &this->inout_, 0); - CORBA::Any out_arg (Param_Test::_tc_Fixed_Struct, &this->out_, 0); + CORBA::Any in_arg (Param_Test::_tc_Fixed_Struct, + &this->in_, + CORBA::B_FALSE); + + CORBA::Any inout_arg (Param_Test::_tc_Fixed_Struct, + &this->inout_, + CORBA::B_FALSE); + + CORBA::Any out_arg (Param_Test::_tc_Fixed_Struct, + &this->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_Fixed_Struct, - 0, // let the ORB allocate - 0, // does not own - env); + retval->item (0, env)->value ()->replace (Param_Test::_tc_Fixed_Struct, + &this->ret_, + CORBA::B_FALSE, // does not own + env); return 0; } @@ -131,13 +161,7 @@ Test_Fixed_Struct::check_validity (void) CORBA::Boolean Test_Fixed_Struct::check_validity (CORBA::Request_ptr req) { - CORBA::Environment env; - - // we have forced the ORB to allocate memory for the return value so that we - // can test the >>= operator - Param_Test::Fixed_Struct *ret; - *req->result ()->value () >>= ret; - this->ret_ = *ret; + ACE_UNUSED_ARG (req); return this->check_validity (); } diff --git a/TAO/tests/Param_Test/nested_struct.cpp b/TAO/tests/Param_Test/nested_struct.cpp index f1ce9ed7324..e563e04f2d3 100644 --- a/TAO/tests/Param_Test/nested_struct.cpp +++ b/TAO/tests/Param_Test/nested_struct.cpp @@ -82,7 +82,7 @@ Test_Nested_Struct::reset_parameters (void) int Test_Nested_Struct::run_sii_test (Param_Test_ptr objref, - CORBA::Environment &env) + CORBA::Environment &env) { Param_Test::Nested_Struct_out out (this->out_.out ()); this->ret_ = objref->test_nested_struct (this->in_, @@ -110,9 +110,20 @@ Test_Nested_Struct::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Nested_Struct, diff --git a/TAO/tests/Param_Test/objref.cpp b/TAO/tests/Param_Test/objref.cpp index 279d013a185..12f8c1c67aa 100644 --- a/TAO/tests/Param_Test/objref.cpp +++ b/TAO/tests/Param_Test/objref.cpp @@ -16,8 +16,6 @@ // // ============================================================================ -#include "helper.h" - #include "objref.h" ACE_RCSID(Param_Test, objref, "$Id$") @@ -121,20 +119,39 @@ Test_ObjRef::add_args (CORBA::NVList_ptr param_list, CORBA::NVList_ptr retval, CORBA::Environment &env) { - CORBA::Any in_arg (_tc_Coffee, &this->in_, 0); - CORBA::Any inout_arg (_tc_Coffee, &this->inout_, 0); - CORBA::Any out_arg (_tc_Coffee, &this->out_, 0); + CORBA::Any in_arg (_tc_Coffee, + &this->in_, + CORBA::B_FALSE); + + CORBA::Any inout_arg (_tc_Coffee, + &this->inout_, + CORBA::B_FALSE); + + CORBA::Any out_arg (_tc_Coffee, + &this->out_, + CORBA::B_FALSE); // add parameters - (void)param_list->add_value ("o1", in_arg, CORBA::ARG_IN, env); - (void)param_list->add_value ("o2", inout_arg, CORBA::ARG_INOUT, env); - (void)param_list->add_value ("o3", out_arg, CORBA::ARG_OUT, env); + param_list->add_value ("o1", + in_arg, + CORBA::ARG_IN, + env); + + param_list->add_value ("o2", + inout_arg, + CORBA::ARG_INOUT, + env); + + param_list->add_value ("o3", + out_arg, + CORBA::ARG_OUT, + env); // add return value - (void)retval->item (0, env)->value ()->replace (_tc_Coffee, - &this->ret_, - 0, // does not own - env); + retval->item (0, env)->value ()->replace (_tc_Coffee, + &this->ret_, + CORBA::B_FALSE, // does not own + env); return 0; } diff --git a/TAO/tests/Param_Test/short.cpp b/TAO/tests/Param_Test/short.cpp index 3a537788bb4..b5db4682a1d 100644 --- a/TAO/tests/Param_Test/short.cpp +++ b/TAO/tests/Param_Test/short.cpp @@ -16,8 +16,6 @@ // // ============================================================================ -#include "helper.h" - #include "short.h" ACE_RCSID(Param_Test, short, "$Id$") @@ -70,7 +68,11 @@ int Test_Short::run_sii_test (Param_Test_ptr objref, CORBA::Environment &env) { - this->ret_ = objref->test_short (this->in_, this->inout_, this->out_, env); + this->ret_ = objref->test_short (this->in_, + this->inout_, + this->out_, + env); + return (env.exception () ? -1:0); } @@ -80,30 +82,49 @@ Test_Short::add_args (CORBA::NVList_ptr param_list, CORBA::Environment &env) { // we provide top level memory to the ORB to retrieve the data - CORBA::Any in_arg (CORBA::_tc_short, &this->in_, 0); - CORBA::Any inout_arg (CORBA::_tc_short, &this->inout_, 0); - CORBA::Any out_arg (CORBA::_tc_short, &this->out_, 0); + CORBA::Any in_arg (CORBA::_tc_short, + &this->in_, + CORBA::B_FALSE); + + CORBA::Any inout_arg (CORBA::_tc_short, + &this->inout_, + CORBA::B_FALSE); + + CORBA::Any out_arg (CORBA::_tc_short, + &this->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. Let the ORB allocate storage. We simply tell the ORB // what type we are expecting. - (void)retval->item (0, env)->value ()->replace (CORBA::_tc_short, - 0, // no value - 0, // does not own - env); + retval->item (0, env)->value ()->replace (CORBA::_tc_short, + &this->ret_, + CORBA::B_FALSE, // does not own + env); return 0; } CORBA::Boolean Test_Short::check_validity (void) { - if (this->inout_ == this->in_*2 && - this->out_ == this->in_*3 && - this->ret_ == this->in_*4) + if (this->inout_ == this->in_ * 2 && + this->out_ == this->in_ * 3 && + this->ret_ == this->in_ * 4) return 1; // success else return 0; @@ -112,16 +133,7 @@ Test_Short::check_validity (void) CORBA::Boolean Test_Short::check_validity (CORBA::Request_ptr req) { - CORBA::Environment env; -#if 0 - // commented out since we really don't need to this as we have provided the - // ORB with the memory - *req->arguments ()->item (1, env)->value () >>= this->inout_; - *req->arguments ()->item (2, env)->value () >>= this->out_; -#endif - // we must retrieve the return value since we aske dthe ORB to allocate the - // memory. - *req->result ()->value () >>= this->ret_; + ACE_UNUSED_ARG (req); return this->check_validity (); } diff --git a/TAO/tests/Param_Test/short.h b/TAO/tests/Param_Test/short.h index 409bd805177..89f047ad702 100644 --- a/TAO/tests/Param_Test/short.h +++ b/TAO/tests/Param_Test/short.h @@ -19,6 +19,7 @@ #if !defined (PARAM_TEST_SHORT_H) #define PARAM_TEST_SHORT_H +#include "helper.h" #include "param_testC.h" // =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* @@ -41,12 +42,16 @@ public: CORBA::NVList_ptr retval, CORBA::Environment &env); // add args to NVList for DII - +/* + int add_args (CORBA::Request_ptr &req, + CORBA::Environment &env); + // add args to DII request using << operator +*/ const char *opname (void) const; // return operation name int init_parameters (Param_Test_ptr objref, - CORBA::Environment &env); + CORBA::Environment &env); // set values for parameters int reset_parameters (void); diff --git a/TAO/tests/Param_Test/typecode.cpp b/TAO/tests/Param_Test/typecode.cpp index 2e664d7d922..a15d0a9220e 100644 --- a/TAO/tests/Param_Test/typecode.cpp +++ b/TAO/tests/Param_Test/typecode.cpp @@ -60,7 +60,7 @@ Test_TypeCode::init_parameters (Param_Test_ptr objref, Generator *gen = GENERATOR::instance (); // value generator CORBA::ULong index = - (CORBA::ULong) (gen->gen_long () % sizeof (tc_table) / sizeof (CORBA::TypeCode_ptr)); + (CORBA::ULong) (gen->gen_long () % sizeof(tc_table)/sizeof(CORBA::TypeCode_ptr)); this->tc_holder_ = CORBA::TypeCode::_duplicate (tc_table [index]); this->in_ = this->tc_holder_; @@ -111,9 +111,20 @@ Test_TypeCode::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (CORBA::_tc_TypeCode, diff --git a/TAO/tests/Param_Test/ub_any_seq.cpp b/TAO/tests/Param_Test/ub_any_seq.cpp index e067097868c..af114941f9e 100644 --- a/TAO/tests/Param_Test/ub_any_seq.cpp +++ b/TAO/tests/Param_Test/ub_any_seq.cpp @@ -16,7 +16,6 @@ // // ============================================================================ -#include "helper.h" #include "ub_any_seq.h" const CORBA::ULong TEST_SEQ_LENGTH = 1; @@ -31,8 +30,8 @@ Test_AnySeq::Test_AnySeq (void) : opname_ (CORBA::string_dup ("test_anyseq")), in_ (new Param_Test::AnySeq (TEST_SEQ_LENGTH)), inout_ (new Param_Test::AnySeq (TEST_SEQ_LENGTH)), - out_ (0), - ret_ (0) + out_ (new Param_Test::AnySeq), + ret_ (new Param_Test::AnySeq) { } @@ -69,7 +68,7 @@ Test_AnySeq::init_parameters (Param_Test_ptr objref, s = gen->gen_short (); ACE_DEBUG ((LM_DEBUG, "setting short = %d\n", s)); this->in_[i] <<= s; - this->inout_[i] <<= 0; + this->inout_[i] <<= 0; // different from in_ } break; case 1: @@ -77,7 +76,7 @@ Test_AnySeq::init_parameters (Param_Test_ptr objref, char *str = gen->gen_string (); ACE_DEBUG ((LM_DEBUG, "setting string = %s\n", str)); this->in_[i] <<= str; - this->inout_[i] <<= 0; + this->inout_[i] <<= 0; // different from in_ } break; case 2: @@ -90,7 +89,7 @@ Test_AnySeq::init_parameters (Param_Test_ptr objref, // insert the coffee object into the Any this->in_[i] <<= cobj.in (); - this->inout_[i] <<= 0; + this->inout_[i] <<= 0; // different from in_ } TAO_CATCH (CORBA::SystemException, sysex) { @@ -178,21 +177,32 @@ Test_AnySeq::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); CORBA::Any inout_arg (Param_Test::_tc_AnySeq, - (void *) &this->inout_.in (), + &this->inout_.inout (), CORBA::B_FALSE); CORBA::Any out_arg (Param_Test::_tc_AnySeq, - &this->dii_out_, + &this->out_.inout (), // .out () causes crash CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_AnySeq, - &this->dii_ret_, + &this->ret_.inout (), // see above CORBA::B_FALSE, // does not own env); @@ -202,38 +212,16 @@ Test_AnySeq::add_args (CORBA::NVList_ptr param_list, CORBA::Boolean Test_AnySeq::check_validity (void) { - return this->check_validity_engine (this->in_, - this->inout_, - this->out_, - this->ret_); -} - -CORBA::Boolean -Test_AnySeq::check_validity (CORBA::Request_ptr req) -{ - return this->check_validity_engine (this->in_, - this->inout_, - this->dii_out_, - this->dii_ret_); -} - -CORBA::Boolean -Test_AnySeq::check_validity_engine (const Param_Test::AnySeq &the_in, - const Param_Test::AnySeq &the_inout, - const Param_Test::AnySeq &the_out, - const Param_Test::AnySeq &the_ret) -{ - CORBA::Environment env; CORBA::Short short_in, short_inout, short_out, short_ret; char *str_in, *str_inout, *str_out, *str_ret; Coffee_ptr obj_in, obj_inout, obj_out, obj_ret; - for (CORBA::ULong i=0; i < the_in.length (); i++) + for (CORBA::ULong i=0; i < this->in_->length (); i++) { - if ((the_in[i] >>= short_in) && - (the_inout[i] >>= short_inout) && - (the_out[i] >>= short_out) && - (the_ret[i] >>= short_ret)) + if ((this->in_[i] >>= short_in) && + (this->inout_[i] >>= short_inout) && + (this->out_[i] >>= short_out) && + (this->ret_[i] >>= short_ret)) { ACE_DEBUG ((LM_DEBUG, "Received shorts: in = %d, " "inout = %d, out = %d, ret = %d\n", @@ -249,10 +237,10 @@ Test_AnySeq::check_validity_engine (const Param_Test::AnySeq &the_in, return 0; } } - else if ((the_in[i] >>= str_in) && - (the_inout[i] >>= str_inout) && - (the_out[i] >>= str_out) && - (the_ret[i] >>= str_ret)) + else if ((this->in_[i] >>= str_in) && + (this->inout_[i] >>= str_inout) && + (this->out_[i] >>= str_out) && + (this->ret_[i] >>= str_ret)) { if (!ACE_OS::strcmp (str_in, str_inout) && !ACE_OS::strcmp (str_in, str_out) && @@ -264,10 +252,10 @@ Test_AnySeq::check_validity_engine (const Param_Test::AnySeq &the_in, return 0; } } - else if ((the_in[i] >>= obj_in) && - (the_inout[i] >>= obj_inout) && - (the_out[i] >>= obj_out) && - (the_ret[i] >>= obj_ret)) + else if ((this->in_[i] >>= obj_in) && + (this->inout_[i] >>= obj_inout) && + (this->out_[i] >>= obj_out) && + (this->ret_[i] >>= obj_ret)) { // all the >>= operators returned true so we are OK. return 1; @@ -280,6 +268,12 @@ Test_AnySeq::check_validity_engine (const Param_Test::AnySeq &the_in, return 0; } +CORBA::Boolean +Test_AnySeq::check_validity (CORBA::Request_ptr req) +{ + return this->check_validity (); +} + void Test_AnySeq::print_values (void) { diff --git a/TAO/tests/Param_Test/ub_any_seq.h b/TAO/tests/Param_Test/ub_any_seq.h index c9b4cf726e4..410aa946c9f 100644 --- a/TAO/tests/Param_Test/ub_any_seq.h +++ b/TAO/tests/Param_Test/ub_any_seq.h @@ -19,6 +19,7 @@ #if !defined (PARAM_TEST_UNBOUNDED_ANY_SEQUENCE_H) #define PARAM_TEST_UNBOUNDED_ANY_SEQUENCE_H +#include "helper.h" #include "param_testC.h" // =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* @@ -70,13 +71,6 @@ protected: // print individual sequence private: - // called by the 2 public versions of check_validity - CORBA::Boolean - Test_AnySeq::check_validity_engine (const Param_Test::AnySeq &the_in, - const Param_Test::AnySeq &the_inout, - const Param_Test::AnySeq &the_out, - const Param_Test::AnySeq &the_ret); - char *opname_; // operation name @@ -91,12 +85,6 @@ private: Param_Test::AnySeq_var ret_; // return value - - Param_Test::AnySeq dii_out_; - // DII out parameter - - Param_Test::AnySeq dii_ret_; - // DII return value }; #endif /* PARAM_TEST_UNBOUNDED_ANY_SEQUENCE_H */ diff --git a/TAO/tests/Param_Test/ub_long_seq.cpp b/TAO/tests/Param_Test/ub_long_seq.cpp index d4cfb40d325..a94bb571584 100644 --- a/TAO/tests/Param_Test/ub_long_seq.cpp +++ b/TAO/tests/Param_Test/ub_long_seq.cpp @@ -108,9 +108,20 @@ Test_Long_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Long_Seq, diff --git a/TAO/tests/Param_Test/ub_objref_seq.cpp b/TAO/tests/Param_Test/ub_objref_seq.cpp index 2972386d5f6..3ace427cbfc 100644 --- a/TAO/tests/Param_Test/ub_objref_seq.cpp +++ b/TAO/tests/Param_Test/ub_objref_seq.cpp @@ -16,8 +16,6 @@ // // ============================================================================ -#include "helper.h" - #include "ub_objref_seq.h" ACE_RCSID(Param_Test, ub_objref_seq, "$Id$") @@ -38,14 +36,15 @@ static const char *Coffee_Flavor [] = { Test_ObjRef_Sequence::Test_ObjRef_Sequence (void) : opname_ (CORBA::string_dup ("test_objref_sequence")), inout_ (new Param_Test::Coffee_Mix), - out_ (0), - ret_ (0) + out_ (new Param_Test::Coffee_Mix), + ret_ (new Param_Test::Coffee_Mix) { } Test_ObjRef_Sequence::~Test_ObjRef_Sequence (void) { CORBA::string_free (this->opname_); + this->opname_ = 0; // the other data members will be freed as they are "_var"s and objects // (rather than pointers to objects) } @@ -58,7 +57,7 @@ Test_ObjRef_Sequence::opname (void) const int Test_ObjRef_Sequence::init_parameters (Param_Test_ptr objref, - CORBA::Environment &env) + CORBA::Environment &env) { Coffee::Desc desc; Generator *gen = GENERATOR::instance (); // value generator @@ -75,15 +74,14 @@ Test_ObjRef_Sequence::init_parameters (Param_Test_ptr objref, // the sequence this->in_[i] = objref->make_coffee (env); if (env.exception ()) - { - env.print_exception ("make_coffee"); - return -1; - } - // get some sequence length (not more than 10) + { + env.print_exception ("make_coffee"); + return -1; + } + // select a Coffee flavor at random CORBA::ULong index = (CORBA::ULong) (gen->gen_long () % 6); desc.name = Coffee_Flavor [index]; - // set the attribute of the object -// this->in_[i]->description (desc, env); // set the attribute for the in object + // set the attribute for the in object Coffee_ptr tmp = this->in_[i]; tmp->description (desc, env); @@ -99,9 +97,9 @@ Test_ObjRef_Sequence::init_parameters (Param_Test_ptr objref, int Test_ObjRef_Sequence::reset_parameters (void) { - this->inout_ = new Param_Test::Coffee_Mix; // delete the previous one - this->out_ = 0; - this->ret_ = 0; + this->inout_ = new Param_Test::Coffee_Mix; // delete the previous ones + this->out_ = new Param_Test::Coffee_Mix; + this->ret_ = new Param_Test::Coffee_Mix; return 0; } @@ -122,20 +120,39 @@ Test_ObjRef_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::NVList_ptr retval, CORBA::Environment &env) { - CORBA::Any in_arg (Param_Test::_tc_Coffee_Mix, (void *) &this->in_, 0); - CORBA::Any inout_arg (Param_Test::_tc_Coffee_Mix, &this->inout_.inout (), 0); - CORBA::Any out_arg (Param_Test::_tc_Coffee_Mix, this->out_.out (), 0); + CORBA::Any in_arg (Param_Test::_tc_Coffee_Mix, + (void *) &this->in_, + CORBA::B_FALSE); + + CORBA::Any inout_arg (Param_Test::_tc_Coffee_Mix, + &this->inout_.inout (), + CORBA::B_FALSE); + + CORBA::Any out_arg (Param_Test::_tc_Coffee_Mix, + this->out_.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 - (void)retval->item (0, env)->value ()->replace (Param_Test::_tc_Coffee_Mix, - &this->ret_, - 0, // does not own - env); + retval->item (0, env)->value ()->replace (Param_Test::_tc_Coffee_Mix, + &this->ret_, + CORBA::B_FALSE, // does not own + env); return 0; } @@ -143,26 +160,32 @@ CORBA::Boolean Test_ObjRef_Sequence::check_validity (void) { TAO_TRY - { - if (this->compare (this->in_, this->inout_.in (), TAO_TRY_ENV)) { - TAO_CHECK_ENV; - if (this->compare (this->in_, this->out_.in (), TAO_TRY_ENV)) - { - TAO_CHECK_ENV; - if (this->compare (this->in_, this->ret_.in (), TAO_TRY_ENV)) + if (this->compare (this->in_, + this->inout_.in () + TAO_TRY_ENV)) { TAO_CHECK_ENV; - return 1; + if (this->compare (this->in_, + this->out_.in (), + TAO_TRY_ENV)) + { + TAO_CHECK_ENV; + if (this->compare (this->in_, + this->ret_.in (), + TAO_TRY_ENV)) + { + TAO_CHECK_ENV; + return 1; + } + } } - } + return 0; } - return 0; - } TAO_CATCHANY; - { - return 0; - } + { + return 0; + } TAO_ENDTRY; } diff --git a/TAO/tests/Param_Test/ub_objref_seq.h b/TAO/tests/Param_Test/ub_objref_seq.h index 43b572a551b..5a23812e543 100644 --- a/TAO/tests/Param_Test/ub_objref_seq.h +++ b/TAO/tests/Param_Test/ub_objref_seq.h @@ -19,6 +19,7 @@ #if !defined (PARAM_TEST_UNBOUNDED_OBJREF_SEQUENCE_H) #define PARAM_TEST_UNBOUNDED_OBJREF_SEQUENCE_H +#include "helper.h" #include "param_testC.h" // =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* diff --git a/TAO/tests/Param_Test/ub_short_seq.cpp b/TAO/tests/Param_Test/ub_short_seq.cpp index 8896a75bbb2..d5f9d97e2cf 100644 --- a/TAO/tests/Param_Test/ub_short_seq.cpp +++ b/TAO/tests/Param_Test/ub_short_seq.cpp @@ -110,9 +110,20 @@ Test_Short_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Short_Seq, diff --git a/TAO/tests/Param_Test/ub_str_seq.cpp b/TAO/tests/Param_Test/ub_str_seq.cpp index 333d893e812..f4ab7879b7c 100644 --- a/TAO/tests/Param_Test/ub_str_seq.cpp +++ b/TAO/tests/Param_Test/ub_str_seq.cpp @@ -114,9 +114,20 @@ Test_String_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_StrSeq, diff --git a/TAO/tests/Param_Test/ub_string.cpp b/TAO/tests/Param_Test/ub_string.cpp index 49c3cf28bc0..3ffb1c40074 100644 --- a/TAO/tests/Param_Test/ub_string.cpp +++ b/TAO/tests/Param_Test/ub_string.cpp @@ -16,8 +16,6 @@ // // ============================================================================ -#include "helper.h" - #include "ub_string.h" ACE_RCSID(Param_Test, ub_string, "$Id$") @@ -92,10 +90,12 @@ Test_Unbounded_String::reset_parameters (void) int Test_Unbounded_String::run_sii_test (Param_Test_ptr objref, - CORBA::Environment &env) + CORBA::Environment &env) { CORBA::String_out str_out (this->out_); - this->ret_ = objref->test_unbounded_string (this->in_, this->inout_, str_out, + this->ret_ = objref->test_unbounded_string (this->in_, + this->inout_, + str_out, env); return (env.exception () ? -1:0); } @@ -142,25 +142,6 @@ Test_Unbounded_String::add_args (CORBA::NVList_ptr param_list, return 0; } -// Implementation coming soon -/* -int -Test_Unbounded_String::add_args (CORBA::Request_ptr &req, - CORBA::Environment &env) -{ - *req << this->in_ - << CORBA::ARG_INOUT << this->inout_ - << CORBA::ARG_OUT << this->out_; - - req->result ()->value ()->replace (CORBA::_tc_string, - &this->ret_, - CORBA::B_TRUE, - env); - - return 0; -} -*/ - CORBA::Boolean Test_Unbounded_String::check_validity (void) { @@ -179,9 +160,9 @@ Test_Unbounded_String::check_validity (void) CORBA::Boolean Test_Unbounded_String::check_validity (CORBA::Request_ptr req) { - CORBA::Environment env; // No need to retrieve anything because, for all the args and // the return, we provided the memory and we own it. + ACE_UNUSED_ARG (req); return this->check_validity (); } diff --git a/TAO/tests/Param_Test/ub_struct_seq.cpp b/TAO/tests/Param_Test/ub_struct_seq.cpp index 009b78f66e0..933bef95a7e 100644 --- a/TAO/tests/Param_Test/ub_struct_seq.cpp +++ b/TAO/tests/Param_Test/ub_struct_seq.cpp @@ -111,9 +111,20 @@ Test_Struct_Sequence::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_StructSeq, diff --git a/TAO/tests/Param_Test/var_array.cpp b/TAO/tests/Param_Test/var_array.cpp index c56e7cdea2b..431d7f3236d 100644 --- a/TAO/tests/Param_Test/var_array.cpp +++ b/TAO/tests/Param_Test/var_array.cpp @@ -55,7 +55,7 @@ Test_Var_Array::init_parameters (Param_Test_ptr objref, // fill the in_ array for (CORBA::ULong i=0; i < Param_Test::DIM2; i++) { - this->in_ [i] = gen->gen_string (); + this->in_[i] = gen->gen_string (); } return 0; @@ -74,7 +74,7 @@ Test_Var_Array::reset_parameters (void) int Test_Var_Array::run_sii_test (Param_Test_ptr objref, - CORBA::Environment &env) + CORBA::Environment &env) { Param_Test::Var_Array_out out_arr (this->out_.out ()); this->ret_ = objref->test_var_array (this->in_, @@ -104,9 +104,20 @@ Test_Var_Array::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - param_list->add_value ("v1", in_arg, CORBA::ARG_IN, env); - param_list->add_value ("v2", inout_arg, CORBA::ARG_INOUT, env); - param_list->add_value ("v3", out_arg, CORBA::ARG_OUT, env); + param_list->add_value ("v1", + in_arg, + CORBA::ARG_IN, + env); + + param_list->add_value ("v2", + inout_arg, + CORBA::ARG_INOUT, + env); + + param_list->add_value ("v3", + out_arg, + CORBA::ARG_OUT, + env); // add return value type retval->item (0, env)->value ()->replace (Param_Test::_tc_Var_Array, diff --git a/TAO/tests/Param_Test/var_struct.cpp b/TAO/tests/Param_Test/var_struct.cpp index a70184391cf..bf8f0561899 100644 --- a/TAO/tests/Param_Test/var_struct.cpp +++ b/TAO/tests/Param_Test/var_struct.cpp @@ -84,7 +84,7 @@ Test_Var_Struct::reset_parameters (void) int Test_Var_Struct::run_sii_test (Param_Test_ptr objref, - CORBA::Environment &env) + CORBA::Environment &env) { Param_Test::Var_Struct_out out (this->out_.out ()); this->ret_ = objref->test_var_struct (this->in_, @@ -112,9 +112,20 @@ Test_Var_Struct::add_args (CORBA::NVList_ptr param_list, CORBA::B_FALSE); // add parameters - 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); + 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 retval->item (0, env)->value ()->replace (Param_Test::_tc_Var_Struct, |