summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-04 00:32:49 +0000
committerjp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-04 00:32:49 +0000
commit4ee3ef6d54a4d73a01db5e266c9d5d9290bbdea9 (patch)
treebce4eccf819f9597254a7eab7fe7c4ef3acf0bcd
parente261ef3d4b39b17cbf8bf46d9b12c96e2e226e78 (diff)
downloadATCD-4ee3ef6d54a4d73a01db5e266c9d5d9290bbdea9.tar.gz
*** empty log message ***
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp4
-rw-r--r--TAO/tao/Sequence_T.i2
-rw-r--r--TAO/tests/Param_Test/bd_long_seq.cpp72
-rw-r--r--TAO/tests/Param_Test/bd_long_seq.h14
-rw-r--r--TAO/tests/Param_Test/bd_short_seq.cpp75
-rw-r--r--TAO/tests/Param_Test/bd_short_seq.h14
-rw-r--r--TAO/tests/Param_Test/bd_str_seq.cpp74
-rw-r--r--TAO/tests/Param_Test/bd_str_seq.h14
8 files changed, 183 insertions, 86 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp
index b6eb33c3de5..0ec5a889a3e 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp
@@ -75,9 +75,9 @@ be_visitor_sequence_ch::gen_bounded_sequence (be_sequence *node)
// Constructor
*os << class_name << " (void)" << be_nl
<< "// Default constructor." << be_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", 0, 0, CORBA::B_FALSE)" << be_nl
+ << " : TAO_Bounded_Base_Sequence (" << node->max_size ()
+ << ", 0, allocbuf (" << node->max_size () << "), CORBA::B_FALSE)" << be_nl
<< "{" << be_nl
- << " this->_allocate_buffer (" << node->max_size () << ");" << be_nl
<< "}" << be_nl
<< be_nl;
diff --git a/TAO/tao/Sequence_T.i b/TAO/tao/Sequence_T.i
index 1a8c6443870..eaca5865c42 100644
--- a/TAO/tao/Sequence_T.i
+++ b/TAO/tao/Sequence_T.i
@@ -135,8 +135,8 @@ TAO_Bounded_Sequence<T, MAX>::freebuf (T *buffer)
template <class T, CORBA::ULong MAX> ACE_INLINE
TAO_Bounded_Sequence<T, MAX>::TAO_Bounded_Sequence (void)
+ : TAO_Bounded_Base_Sequence (MAX, 0, allocbuf (MAX), CORBA::B_FALSE)
{
- this->_allocate_buffer (MAX);
}
template <class T, CORBA::ULong MAX> ACE_INLINE
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
diff --git a/TAO/tests/Param_Test/bd_long_seq.h b/TAO/tests/Param_Test/bd_long_seq.h
index 560e06385c7..cac07515199 100644
--- a/TAO/tests/Param_Test/bd_long_seq.h
+++ b/TAO/tests/Param_Test/bd_long_seq.h
@@ -63,6 +63,14 @@ public:
// print all the values
private:
+ // called by the 2 public versions of check_validity
+ CORBA::Boolean
+ 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);
+
char *opname_;
// operation name
@@ -77,6 +85,12 @@ private:
Param_Test::Bounded_Long_Seq_var ret_;
// return value
+
+ Param_Test::Bounded_Long_Seq dii_out_;
+ // DII out parameter
+
+ Param_Test::Bounded_Long_Seq dii_ret_;
+ // DII return value
};
#endif /* PARAM_TEST_BOUNDED_LONG_SEQUENCE_H */
diff --git a/TAO/tests/Param_Test/bd_short_seq.cpp b/TAO/tests/Param_Test/bd_short_seq.cpp
index 09572ac89b9..b1b9e648a4b 100644
--- a/TAO/tests/Param_Test/bd_short_seq.cpp
+++ b/TAO/tests/Param_Test/bd_short_seq.cpp
@@ -37,6 +37,7 @@ Test_Bounded_Short_Sequence::Test_Bounded_Short_Sequence (void)
Test_Bounded_Short_Sequence::~Test_Bounded_Short_Sequence (void)
{
+ CORBA::string_free (this->opname_);
}
const char *
@@ -47,12 +48,12 @@ Test_Bounded_Short_Sequence::opname (void) const
int
Test_Bounded_Short_Sequence::init_parameters (Param_Test_ptr objref,
- CORBA::Environment &env)
+ CORBA::Environment &env)
{
ACE_UNUSED_ARG (objref);
ACE_UNUSED_ARG (env);
- // get some sequence length (not more than 10)
+ // get some sequence length (not more than 32)
CORBA::ULong len = this->in_->maximum ();
// set the length of the sequence
@@ -85,7 +86,7 @@ Test_Bounded_Short_Sequence::run_sii_test (Param_Test_ptr objref,
this->ret_ = objref->test_bounded_short_sequence (this->in_.in (),
this->inout_.inout (),
out,
- env);
+ env);
return (env.exception () ? -1:0);
}
@@ -94,39 +95,50 @@ Test_Bounded_Short_Sequence::add_args (CORBA::NVList_ptr param_list,
CORBA::NVList_ptr retval,
CORBA::Environment &env)
{
- CORBA::Any in_arg (Param_Test::_tc_Bounded_Short_Seq, (void *) &this->in_.in (), 0);
- CORBA::Any inout_arg (Param_Test::_tc_Bounded_Short_Seq, &this->inout_.inout (), 0);
- // ORB will allocate
- CORBA::Any out_arg (Param_Test::_tc_Bounded_Short_Seq, 0, 0);
+ CORBA::Any in_arg (Param_Test::_tc_Bounded_Short_Seq,
+ (void *) &this->in_.in (),
+ CORBA::B_FALSE);
+
+ CORBA::Any inout_arg (Param_Test::_tc_Bounded_Short_Seq,
+ &this->inout_.inout (),
+ CORBA::B_FALSE);
+
+ CORBA::Any out_arg (Param_Test::_tc_Bounded_Short_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_Short_Seq,
- 0,
- 0, // does not own
- env);
+ retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_Short_Seq,
+ &this->dii_ret_,
+ CORBA::B_FALSE, // does not own
+ env);
return 0;
}
CORBA::Boolean
-Test_Bounded_Short_Sequence::check_validity (void)
+Test_Bounded_Short_Sequence::check_validity_engine
+ (const Param_Test::Bounded_Short_Seq &the_in,
+ const Param_Test::Bounded_Short_Seq &the_inout,
+ const Param_Test::Bounded_Short_Seq &the_out,
+ const Param_Test::Bounded_Short_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;
}
@@ -135,14 +147,21 @@ Test_Bounded_Short_Sequence::check_validity (void)
}
CORBA::Boolean
-Test_Bounded_Short_Sequence::check_validity (CORBA::Request_ptr req)
+Test_Bounded_Short_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_Short_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
diff --git a/TAO/tests/Param_Test/bd_short_seq.h b/TAO/tests/Param_Test/bd_short_seq.h
index 10e45316593..6809e45eab3 100644
--- a/TAO/tests/Param_Test/bd_short_seq.h
+++ b/TAO/tests/Param_Test/bd_short_seq.h
@@ -63,6 +63,14 @@ public:
// print all the values
private:
+ // called by the 2 public versions of check_validity
+ CORBA::Boolean
+ Test_Bounded_Short_Sequence::check_validity_engine
+ (const Param_Test::Bounded_Short_Seq &the_in,
+ const Param_Test::Bounded_Short_Seq &the_inout,
+ const Param_Test::Bounded_Short_Seq &the_out,
+ const Param_Test::Bounded_Short_Seq &the_ret);
+
char *opname_;
// operation name
@@ -77,6 +85,12 @@ private:
Param_Test::Bounded_Short_Seq_var ret_;
// return value
+
+ Param_Test::Bounded_Short_Seq dii_out_;
+ // DII out parameter
+
+ Param_Test::Bounded_Short_Seq dii_ret_;
+ // DII return value
};
#endif /* PARAM_TEST_BOUNDED_SHORT_SEQUENCE_H */
diff --git a/TAO/tests/Param_Test/bd_str_seq.cpp b/TAO/tests/Param_Test/bd_str_seq.cpp
index 524636c9df2..6e9338650d1 100644
--- a/TAO/tests/Param_Test/bd_str_seq.cpp
+++ b/TAO/tests/Param_Test/bd_str_seq.cpp
@@ -89,7 +89,7 @@ Test_Bounded_String_Sequence::reset_parameters (void)
int
Test_Bounded_String_Sequence::run_sii_test (Param_Test_ptr objref,
- CORBA::Environment &env)
+ CORBA::Environment &env)
{
Param_Test::Bounded_StrSeq_out out (this->out_.out ());
this->ret_ = objref->test_bounded_strseq (this->in_.in (),
@@ -101,42 +101,53 @@ Test_Bounded_String_Sequence::run_sii_test (Param_Test_ptr objref,
int
Test_Bounded_String_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_StrSeq, (void *) &this->in_.in (), 0);
- CORBA::Any inout_arg (Param_Test::_tc_Bounded_StrSeq, &this->inout_.inout (), 0);
- // ORB will allocate
- CORBA::Any out_arg (Param_Test::_tc_Bounded_StrSeq, 0, 0);
+ CORBA::Any in_arg (Param_Test::_tc_Bounded_StrSeq,
+ (void *) &this->in_.in (),
+ CORBA::B_FALSE);
+
+ CORBA::Any inout_arg (Param_Test::_tc_Bounded_StrSeq,
+ &this->inout_.inout (),
+ CORBA::B_FALSE);
+
+ CORBA::Any out_arg (Param_Test::_tc_Bounded_StrSeq,
+ &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_StrSeq,
- 0,
- 0, // does not own
- env);
+ retval->item (0, env)->value ()->replace (Param_Test::_tc_Bounded_StrSeq,
+ &this->dii_ret_,
+ CORBA::B_FALSE, // does not own
+ env);
return 0;
}
CORBA::Boolean
-Test_Bounded_String_Sequence::check_validity (void)
+Test_Bounded_String_Sequence::check_validity_engine
+ (const Param_Test::Bounded_StrSeq &the_in,
+ const Param_Test::Bounded_StrSeq &the_inout,
+ const Param_Test::Bounded_StrSeq &the_out,
+ const Param_Test::Bounded_StrSeq &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 (ACE_OS::strcmp (this->in_[i], this->inout_[i]) ||
- ACE_OS::strcmp (this->in_[i], this->out_[i]) ||
- ACE_OS::strcmp (this->in_[i], this->ret_[i]))
+ if (ACE_OS::strcmp(the_in[i], the_inout[i]) ||
+ ACE_OS::strcmp(the_in[i], the_out[i]) ||
+ ACE_OS::strcmp(the_in[i], the_ret[i]))
// not equal
flag = 0;
}
@@ -145,14 +156,21 @@ Test_Bounded_String_Sequence::check_validity (void)
}
CORBA::Boolean
-Test_Bounded_String_Sequence::check_validity (CORBA::Request_ptr req)
+Test_Bounded_String_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_String_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
diff --git a/TAO/tests/Param_Test/bd_str_seq.h b/TAO/tests/Param_Test/bd_str_seq.h
index 5e0c614dea6..c3ba7cb7b3a 100644
--- a/TAO/tests/Param_Test/bd_str_seq.h
+++ b/TAO/tests/Param_Test/bd_str_seq.h
@@ -63,6 +63,14 @@ public:
// print all the values
private:
+ // called by the 2 public versions of check_validity
+ CORBA::Boolean
+ Test_Bounded_String_Sequence::check_validity_engine
+ (const Param_Test::Bounded_StrSeq &the_in,
+ const Param_Test::Bounded_StrSeq &the_inout,
+ const Param_Test::Bounded_StrSeq &the_out,
+ const Param_Test::Bounded_StrSeq &the_ret);
+
char *opname_;
// operation name
@@ -77,6 +85,12 @@ private:
Param_Test::Bounded_StrSeq_var ret_;
// return value
+
+ Param_Test::Bounded_StrSeq dii_out_;
+ // DII out parameter
+
+ Param_Test::Bounded_StrSeq dii_ret_;
+ // DII return value
};
#endif /* PARAM_TEST_BOUNDED_STRING_SEQUENCE_H */