summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 07:07:55 +0000
committermjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 07:07:55 +0000
commit22eb3abb0f44c51d4fbdfb9c696cffd997d43555 (patch)
tree6dadf4f3acfbaacbeeaf577ad6d464d6ea9632dc
parentc282414435e4755408ea5cedb9ec6b0798be4f8f (diff)
downloadATCD-22eb3abb0f44c51d4fbdfb9c696cffd997d43555.tar.gz
See Mon Nov 30 01:10:35 1998 Matt Braun <mjb2@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-98c8
-rw-r--r--TAO/tests/Param_Test/ub_any_seq.cpp277
2 files changed, 151 insertions, 134 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index c2ec040c6e5..6314b8693ed 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,11 @@
+Mon Nov 30 01:10:35 1998 Matt Braun <mjb2@cs.wustl.edu>
+
+ * tests/Param_Test/ub_any_seq.cpp: Added test for const char* and
+ changed sequence length from 1 to 5 because the "random" choice
+ of types was only pseudo-random and the various test types
+ wern't being tested. Currently, the test segfaults, but I
+ believe this to be indicative of a deeper problem.
+
Sun Nov 29 18:09:52 1998 Nanbor Wang <nanbor@cs.wustl.edu>
* tao/ORB.{h,cpp} (resolve_initial_references): Allows this
diff --git a/TAO/tests/Param_Test/ub_any_seq.cpp b/TAO/tests/Param_Test/ub_any_seq.cpp
index 1975c142d13..fc91c06ac4a 100644
--- a/TAO/tests/Param_Test/ub_any_seq.cpp
+++ b/TAO/tests/Param_Test/ub_any_seq.cpp
@@ -19,7 +19,7 @@
#include "helper.h"
#include "ub_any_seq.h"
-const CORBA::ULong TEST_SEQ_LENGTH = 1;
+const CORBA::ULong TEST_SEQ_LENGTH = 5;
ACE_RCSID(Param_Test, ub_any_seq, "$Id$")
@@ -59,56 +59,62 @@ Test_AnySeq::init_parameters (Param_Test_ptr objref,
for (CORBA::ULong i=0; i < this->in_->length (); i++)
{
- CORBA::ULong index = (CORBA::ULong) (gen->gen_long () % 3);
-
+ CORBA::ULong index = (CORBA::ULong) (gen->gen_short () % 4);
switch (index)
{
- case 0:
- {
- CORBA::Short s;
- s = gen->gen_short ();
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "setting short = %d\n", s));
- this->in_[i] <<= s;
- this->inout_[i] <<= 0; // different from in_
- }
- break;
- case 1:
- {
- char *str = gen->gen_string ();
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "setting string = %s\n", str));
- this->in_[i] <<= str;
- this->inout_[i] <<= 0; // different from in_
- }
- break;
- case 2:
- {
- TAO_TRY
- {
- // get access to a Coffee Object
- Coffee_var cobj = objref->make_coffee (TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // insert the coffee object into the Any
- this->in_[i] <<= cobj.in ();
- this->inout_[i] <<= 0; // different from in_
- }
- TAO_CATCH (CORBA::SystemException, sysex)
- {
- ACE_UNUSED_ARG (sysex);
- TAO_TRY_ENV.print_exception ("System Exception doing make_coffee");
- return -1;
- }
- TAO_ENDTRY;
- }
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
+ case 0:
+ {
+ CORBA::Short s;
+ s = gen->gen_short ();
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "setting short = %d\n", s));
+ this->in_[i] <<= s;
+ this->inout_[i] <<= 0; // different from in_
+ }
+ break;
+ case 1:
+ {
+ char *str = gen->gen_string ();
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "setting string = %s\n", str));
+ this->in_[i] <<= str;
+ this->inout_[i] <<= 0; // different from in_
+ }
+ break;
+ case 2:
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "setting coffee object \n" ));
+ TAO_TRY
+ {
+ // get access to a Coffee Object
+ Coffee_var cobj = objref->make_coffee (TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ // insert the coffee object into the Any
+ this->in_[i] <<= cobj.in ();
+ this->inout_[i] <<= 0; // different from in_
+ }
+ TAO_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_UNUSED_ARG (sysex);
+ TAO_TRY_ENV.print_exception
+ ("System Exception doing make_coffee");
+ return -1;
+ }
+ TAO_ENDTRY;
+ }
+ break;
+ case 3:
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "setting constant string \n" ));
+ this->in_[i] <<= "Const string";
+ this->inout_[i] <<= 0; // different from in_
+ break;
+ case 4:
+ break;
+ case 5:
+ break;
}
}
@@ -122,42 +128,45 @@ Test_AnySeq::reset_parameters (void)
for (CORBA::ULong i=0; i < this->in_->length (); i++)
{
- CORBA::ULong index = (CORBA::ULong) (gen->gen_long () % 3);
+ CORBA::ULong index = (CORBA::ULong) (gen->gen_long () % 4);
switch (index)
{
- case 0:
- {
- CORBA::Short s;
- s = gen->gen_short ();
- this->in_[i] <<= s;
- this->inout_[i] <<= s;
- }
- break;
- case 1:
- {
- char *str = gen->gen_string ();
- this->in_[i] <<= str;
- this->inout_[i] <<= str;
- }
- break;
- case 2:
- {
- this->inout_[i] = this->in_[i];
- }
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
+ case 0:
+ {
+ CORBA::Short s;
+ s = gen->gen_short ();
+ this->in_[i] <<= s;
+ this->inout_[i] <<= s;
+ }
+ break;
+ case 1:
+ {
+ char *str = gen->gen_string ();
+ this->in_[i] <<= str;
+ this->inout_[i] <<= str;
+ }
+ break;
+ case 2:
+ {
+ this->inout_[i] = this->in_[i];
+ }
+ break;
+ case 3:
+ this->in_[i] <<= "Const string";
+ this->inout_[i] <<= "Const string";
+ break;
+ case 4:
+ break;
+ case 5:
+ break;
}
}
return 0;
}
+
int
Test_AnySeq::run_sii_test (Param_Test_ptr objref,
CORBA::Environment &env)
@@ -205,10 +214,10 @@ Test_AnySeq::add_args (CORBA::NVList_ptr param_list,
// add return value type
retval->item (0, env)->value ()->replace (Param_Test::_tc_AnySeq,
- &this->ret_.inout (), // see above
- 0, // does not own
- env);
-
+ // see above
+ &this->ret_.inout (),
+ // does not own
+ 0, env);
return 0;
}
@@ -220,52 +229,52 @@ Test_AnySeq::check_validity (void)
Coffee_ptr obj_in, obj_inout, obj_out, obj_ret;
for (CORBA::ULong i=0; i < this->in_->length (); i++)
- {
- 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",
- short_in, short_inout, short_out, short_ret));
-
- if ((short_in == short_inout) &&
- (short_in == short_out) &&
- (short_in == short_ret))
- return 1;
- else
+ 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, "mismatch of short values\n"));
- return 0;
+ ACE_DEBUG ((LM_DEBUG, "Received shorts: in = %d, "
+ "inout = %d, out = %d, ret = %d\n",
+ short_in, short_inout, short_out, short_ret));
+
+ if ((short_in == short_inout) &&
+ (short_in == short_out) &&
+ (short_in == short_ret))
+ return 1;
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "mismatch of short values\n"));
+ return 0;
+ }
}
- }
- 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) &&
- !ACE_OS::strcmp (str_in, str_ret))
- return 1;
- else
+ else if ((this->in_[i] >>= str_in) &&
+ (this->inout_[i] >>= str_inout) &&
+ (this->out_[i] >>= str_out) &&
+ (this->ret_[i] >>= str_ret))
{
- ACE_DEBUG ((LM_DEBUG, "mismatch of string values\n"));
- return 0;
+ if (!ACE_OS::strcmp (str_in, str_inout) &&
+ !ACE_OS::strcmp (str_in, str_out) &&
+ !ACE_OS::strcmp (str_in, str_ret))
+ return 1;
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "mismatch of string values\n"));
+ return 0;
+ }
}
+ 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;
+ }
+ else
+ return 0;
}
- 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;
- }
- else
- return 0;
- }
// Should never reach this.
return 0;
@@ -309,18 +318,18 @@ Test_AnySeq::print_sequence (const Param_Test::AnySeq &s)
ACE_DEBUG ((LM_DEBUG, "Elements -\n"));
for (CORBA::ULong i=0; i < s.length (); i++)
{
- /* const CORBA::Any& vs = s[i];
-
- ACE_DEBUG ((LM_DEBUG,
- "Element #%d\n"
- "\tl = %d\n"
- "\tc = %c\n"
- "\ts = %d\n"
- "\to = %x\n"
- "\tf = %f\n"
- "\tb = %d\n"
- "\td = %f\n",
- i,
- vs.l, vs.c, vs.s, vs.o, vs.f, vs.b, vs.d));
-*/ }
+ /* const CORBA::Any& vs = s[i];
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Element #%d\n"
+ "\tl = %d\n"
+ "\tc = %c\n"
+ "\ts = %d\n"
+ "\to = %x\n"
+ "\tf = %f\n"
+ "\tb = %d\n"
+ "\td = %f\n",
+ i,
+ vs.l, vs.c, vs.s, vs.o, vs.f, vs.b, vs.d));
+ */ }
}