From 2831b2dd49171c20d86451ced9392ca6520125df Mon Sep 17 00:00:00 2001 From: parsons Date: Fri, 7 May 2010 19:50:17 +0000 Subject: ChangeLogTag: Fri May 7 19:44:31 UTC 2010 Jeff Parsons --- modules/TAO/ChangeLog | 21 ++++++++++++++ .../TAO_IDL/be/be_visitor_operation/operation.cpp | 8 +++++- .../TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp | 5 +--- .../TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp | 6 +--- modules/TAO/tests/Alt_Mapping/ub_struct_seq.cpp | 33 +++++++++++++++------- 5 files changed, 53 insertions(+), 20 deletions(-) diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog index e470f38f86b..b5c7865c135 100644 --- a/modules/TAO/ChangeLog +++ b/modules/TAO/ChangeLog @@ -1,3 +1,24 @@ +Fri May 7 19:44:31 UTC 2010 Jeff Parsons + + * TAO_IDL/be/be_visitor_operation/operation.cpp: + + Added a check to generate the SArg_Trait parameter for + the repo id arg to _is_a() as char* instead of std::string. + We would have to regenerate ORB code for that to work, + and it may be a choice later on to do that. + + * TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp: + * TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp: + + To set the length of a sequence, changed the call to the + underlying vector from capacity() to resize() - capacity() + wasn't behaving as expected. + + * tests/Alt_Mapping/ub_struct_seq.cpp: + + Cosmetic changes, and other changes in parameter init + and results checking to make debugging easier. + Mon May 3 22:21:33 UTC 2010 Jeff Parsons * tests/Param_Test/param_testC.cpp: diff --git a/modules/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/modules/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index 3c178c8b11c..9b3ce96287c 100644 --- a/modules/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/modules/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -529,11 +529,17 @@ be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope, *os << "::"; } + /// For now, keep a list of system operation or arg names + /// that may not be remapped. May decide later to regnerate + /// ORB code for alt mapping as well. + ACE_CString repo_id (scope->repoID ()); + bool sys_val = (repo_id == "IDL:repository_id:1.0"); + // For types other than the 4 above, don't unalias the type name // in case it is a sequence or array. if (nt == AST_Decl::NT_string && bound == 0) { - if (be_global->alt_mapping ()) + if (be_global->alt_mapping () && !sys_val) { *os << "std::string"; } diff --git a/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp index 28b175540b6..d3ac96b671a 100644 --- a/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -15,10 +15,6 @@ // // ============================================================================ -ACE_RCSID (be_visitor_sequence, - cdr_op_cs, - "$Id$") - // *************************************************************************** // Sequence visitor for generating CDR operator declarations in the client // stubs file. @@ -166,6 +162,7 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) << "{" << be_idt_nl << "return false;" << be_uidt_nl << "}" << be_uidt_nl << be_nl + << "_tao_vector.resize (length);" << be_nl << be_nl << "for ( ::CORBA::ULong i = 0UL; i < length; ++i)" << be_idt_nl << "{" << be_idt_nl diff --git a/modules/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/modules/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp index e1eba02246b..8123084e5df 100644 --- a/modules/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/modules/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -18,10 +18,6 @@ // // ============================================================================ -ACE_RCSID (be_visitor_sequence, - sequence_cs, - "$Id$") - // ************************************************************ // Root visitor for client stub class // ************************************************************ @@ -192,7 +188,7 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) << node->name () << "::length ( ::CORBA::ULong length)" << be_nl << "{" << be_idt_nl - << "this->reserve (length);" << be_uidt_nl + << "this->resize (length);" << be_uidt_nl << "}"; *os << be_nl << be_nl diff --git a/modules/TAO/tests/Alt_Mapping/ub_struct_seq.cpp b/modules/TAO/tests/Alt_Mapping/ub_struct_seq.cpp index 6e4777726ef..14d9796aba4 100644 --- a/modules/TAO/tests/Alt_Mapping/ub_struct_seq.cpp +++ b/modules/TAO/tests/Alt_Mapping/ub_struct_seq.cpp @@ -49,20 +49,22 @@ Test_Unbounded_Struct_Sequence::init_parameters (Alt_Mapping_ptr) { Generator *gen = GENERATOR::instance (); // value generator - // get some sequence length (not more than 10) + // Get some sequence length (not more than 10). CORBA::ULong len = (CORBA::ULong) (gen->gen_long () % 10) + 1; // set the length of the sequence this->in_.length (len); this->inout_.length (len); - // now set each individual element + + // Now set each individual element. for (CORBA::ULong i = 0; i < this->in_.length (); i++) { - // generate some arbitrary struct to be filled into the ith location in - // the sequence + // Generate some arbitrary struct to be filled into the ith location in + // the sequence. this->in_[i] = gen->gen_fixed_struct (); this->inout_[i] = gen->gen_fixed_struct (); } + return 0; } @@ -130,10 +132,21 @@ Test_Unbounded_Struct_Sequence::compare ( const Alt_Mapping::StructSeq &s1, const Alt_Mapping::StructSeq &s2) { - if (s1.maximum () != s2.maximum ()) - return 0; - if (s1.length () != s2.length ()) - return 0; + ACE_CDR::ULong s1v = s1.maximum (); + ACE_CDR::ULong s2v = s2.maximum (); + + if (s1v != s2v) + { + return false; + } + + s1v = s1.length (); + s2v = s2.length (); + + if (s1v != s2v) + { + return false; + } for (CORBA::ULong i=0; i < s1.length (); i++) { @@ -147,10 +160,10 @@ Test_Unbounded_Struct_Sequence::compare ( || vs1.f != vs2.f || vs1.b != vs2.b || vs1.d != vs2.d ) - return 0; + return false; } - return 1; // success + return true; // success } void -- cgit v1.2.1