summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmcqueen <smcqueen@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-11-01 09:46:37 +0000
committersmcqueen <smcqueen@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-11-01 09:46:37 +0000
commitba543f6c239d9dc01cce172ba40f62040f5ba842 (patch)
treed5f69d51ac0b6ae9726266c57c58df60cb4aa51c
parentcc706492c49b992ced77bd03ccb8c315428cc8c5 (diff)
downloadATCD-ba543f6c239d9dc01cce172ba40f62040f5ba842.tar.gz
ChangeLogTag: Tue Nov 1 09:35:36 2005 Simon McQueen <sm@prismtech.com>
-rw-r--r--TAO/ChangeLog24
-rw-r--r--TAO/tests/Bug_2289_Regression/Bug_2289_Regression.mpc36
-rw-r--r--TAO/tests/Bug_2289_Regression/MyInterfaceImpl.cpp17
-rw-r--r--TAO/tests/Bug_2289_Regression/MyInterfaceImpl.h19
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStruct.idl7
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructC.cpp174
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructC.h116
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructC.inl27
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructS.cpp61
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructS.h52
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructS.inl27
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructS_T.cpp41
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructS_T.h52
-rw-r--r--TAO/tests/Bug_2289_Regression/MyStructS_T.inl28
-rw-r--r--TAO/tests/Bug_2289_Regression/README75
-rw-r--r--TAO/tests/Bug_2289_Regression/Test.idl8
-rw-r--r--TAO/tests/Bug_2289_Regression/client.cpp136
-rwxr-xr-xTAO/tests/Bug_2289_Regression/run_test.pl50
-rw-r--r--TAO/tests/Bug_2289_Regression/server.cpp142
19 files changed, 1092 insertions, 0 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 9c970fb012c..9e129c36694 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,27 @@
+Tue Nov 1 09:35:36 2005 Simon McQueen <sm@prismtech.com>
+
+ * tests/Bug_2289_Regression/Bug_2289_Regression.mpc:
+ * tests/Bug_2289_Regression/MyInterfaceImpl.cpp:
+ * tests/Bug_2289_Regression/MyInterfaceImpl.h:
+ * tests/Bug_2289_Regression/MyStruct.idl:
+ * tests/Bug_2289_Regression/MyStructC.cpp:
+ * tests/Bug_2289_Regression/MyStructC.h:
+ * tests/Bug_2289_Regression/MyStructC.inl:
+ * tests/Bug_2289_Regression/MyStructS.cpp:
+ * tests/Bug_2289_Regression/MyStructS.h:
+ * tests/Bug_2289_Regression/MyStructS.inl:
+ * tests/Bug_2289_Regression/MyStructS_T.cpp:
+ * tests/Bug_2289_Regression/MyStructS_T.h:
+ * tests/Bug_2289_Regression/MyStructS_T.inl:
+ * tests/Bug_2289_Regression/README:
+ * tests/Bug_2289_Regression/Test.idl:
+ * tests/Bug_2289_Regression/client.cpp:
+ * tests/Bug_2289_Regression/run_test.pl:
+ * tests/Bug_2289_Regression/server.cpp:
+
+ Added regression test for this bug. Bug is not yet fixed so it
+ *will* fail.
+
Mon Oct 31 15:19:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Sequence_Unit_Tests/mock_reference.hpp:
diff --git a/TAO/tests/Bug_2289_Regression/Bug_2289_Regression.mpc b/TAO/tests/Bug_2289_Regression/Bug_2289_Regression.mpc
new file mode 100644
index 00000000000..cf9def9773a
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/Bug_2289_Regression.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Server): taoserver, iortable {
+ exename = server
+ idlflags += -Gp -Gd
+ libpaths += $(TAO_ROOT)/tao/Strategies $(TAO_ROOT)/tao $(ACE_ROOT)/ace $(TAO_ROOT)/orbsvcs/orbsvcs $(TAO_ROOT)/orbsvcs/orbsvcs/ETCL $(TAO_ROOT)/tao/IORManipulation $(TAO_ROOT)/tao/ObjRefTemplate $(TAO_ROOT)/tao/IORInterceptor $(TAO_ROOT)/tao/IORTable $(TAO_ROOT)/tao/PortableServer $(TAO_ROOT)/tao/DynamicAny $(TAO_ROOT)/tao/Messaging $(TAO_ROOT)/tao/Valuetype
+ Source_Files {
+ server.cpp
+ MyInterfaceImpl.cpp
+ MyStructC.cpp
+ MyStructS.cpp
+ }
+
+ IDL_Files {
+ Test.idl
+ }
+}
+
+project(*Client): taoserver, iortable {
+ exename = client
+ includes += $(TAO_ROOT)
+ idlflags += -Gp -Gd
+ after += *Server
+ libpaths += $(TAO_ROOT)/tao $(ACE_ROOT)/ace $(TAO_ROOT)/orbsvcs/orbsvcs $(TAO_ROOT)/orbsvcs/orbsvcs/ETCL $(TAO_ROOT)/tao/IORManipulation $(TAO_ROOT)/tao/ObjRefTemplate $(TAO_ROOT)/tao/IORInterceptor $(TAO_ROOT)/tao/IORTable $(TAO_ROOT)/tao/PortableServer $(TAO_ROOT)/tao/DynamicAny $(TAO_ROOT)/tao/Messaging $(TAO_ROOT)/tao/Valuetype
+ Source_Files {
+ client.cpp
+ MyInterfaceImpl.cpp
+ MyStructC.cpp
+ MyStructS.cpp
+ }
+
+ IDL_Files {
+ Test.idl
+ }
+}
diff --git a/TAO/tests/Bug_2289_Regression/MyInterfaceImpl.cpp b/TAO/tests/Bug_2289_Regression/MyInterfaceImpl.cpp
new file mode 100644
index 00000000000..76657deb427
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyInterfaceImpl.cpp
@@ -0,0 +1,17 @@
+//
+// $Id$
+//
+
+#include "MyInterfaceImpl.h"
+
+MyInterfaceImpl::MyInterfaceImpl (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+void
+MyInterfaceImpl::myMethod (const MyStruct & ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/tests/Bug_2289_Regression/MyInterfaceImpl.h b/TAO/tests/Bug_2289_Regression/MyInterfaceImpl.h
new file mode 100644
index 00000000000..5c8cc0591b7
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyInterfaceImpl.h
@@ -0,0 +1,19 @@
+//
+// $Id$
+//
+
+#include "TestS.h"
+
+class MyInterfaceImpl
+ : public virtual POA_MyInterface, public virtual PortableServer::RefCountServantBase
+{
+ public:
+ MyInterfaceImpl (CORBA::ORB_ptr orb);
+
+ // = The skeleton methods
+ virtual void myMethod (const MyStruct & structParam ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+};
diff --git a/TAO/tests/Bug_2289_Regression/MyStruct.idl b/TAO/tests/Bug_2289_Regression/MyStruct.idl
new file mode 100644
index 00000000000..679a3c6ac43
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStruct.idl
@@ -0,0 +1,7 @@
+// $Id$
+
+struct MyStruct
+{
+ string myString;
+};
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructC.cpp b/TAO/tests/Bug_2289_Regression/MyStructC.cpp
new file mode 100644
index 00000000000..f74814bdba9
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructC.cpp
@@ -0,0 +1,174 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:277
+
+
+#include "MyStructC.h"
+#include "tao/AnyTypeCode/Null_RefCount_Policy.h"
+#include "tao/AnyTypeCode/TypeCode_Constants.h"
+#include "tao/AnyTypeCode/Alias_TypeCode_Static.h"
+#include "tao/AnyTypeCode/String_TypeCode_Static.h"
+#include "tao/AnyTypeCode/Struct_TypeCode_Static.h"
+#include "tao/AnyTypeCode/TypeCode_Struct_Field.h"
+#include "tao/CDR.h"
+#include "tao/AnyTypeCode/Any_Dual_Impl_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "MyStructC.inl"
+#endif /* !defined INLINE */
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:70
+
+// Arg traits specializations.
+namespace TAO
+{
+}
+
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/struct_typecode.cpp:89
+
+static TAO::TypeCode::Struct_Field<char const *, ::CORBA::TypeCode_ptr const *> const _tao_fields_MyStruct[] =
+ {
+ { "myString", &CORBA::_tc_string }
+
+ };
+static TAO::TypeCode::Struct<char const *,
+ ::CORBA::TypeCode_ptr const *,
+ TAO::TypeCode::Struct_Field<char const *, ::CORBA::TypeCode_ptr const *> const *,
+ TAO::Null_RefCount_Policy>
+ _tao_tc_MyStruct (
+ ::CORBA::tk_struct,
+ "IDL:MyStruct:1.0",
+ "MyStruct",
+ _tao_fields_MyStruct,
+ 1);
+
+::CORBA::TypeCode_ptr const _tc_MyStruct =
+ &_tao_tc_MyStruct;
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/structure_cs.cpp:66
+
+void
+MyStruct::_tao_any_destructor (
+ void *_tao_void_pointer
+ )
+{
+ MyStruct *_tao_tmp_pointer =
+ static_cast<MyStruct *> (_tao_void_pointer);
+ delete _tao_tmp_pointer;
+}
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/any_op_cs.cpp:54
+
+// Copying insertion.
+void operator<<= (
+ ::CORBA::Any &_tao_any,
+ const MyStruct &_tao_elem
+ )
+{
+ if (0 == &_tao_elem) // Trying to de-reference NULL object
+ _tao_any <<= static_cast<MyStruct *>( 0 ); // Use non-copying insertion of a NULL
+ else
+ TAO::Any_Dual_Impl_T<MyStruct>::insert_copy (
+ _tao_any,
+ MyStruct::_tao_any_destructor,
+ _tc_MyStruct,
+ _tao_elem
+ );
+}
+
+// Non-copying insertion.
+void operator<<= (
+ ::CORBA::Any &_tao_any,
+ MyStruct *_tao_elem
+ )
+{
+ TAO::Any_Dual_Impl_T<MyStruct>::insert (
+ _tao_any,
+ MyStruct::_tao_any_destructor,
+ _tc_MyStruct,
+ _tao_elem
+ );
+}
+
+// Extraction to non-const pointer (deprecated).
+::CORBA::Boolean operator>>= (
+ const ::CORBA::Any &_tao_any,
+ MyStruct *&_tao_elem
+ )
+{
+ return _tao_any >>= const_cast<
+ const MyStruct *&> (
+ _tao_elem
+ );
+}
+
+// Extraction to const pointer.
+::CORBA::Boolean operator>>= (
+ const ::CORBA::Any &_tao_any,
+ const MyStruct *&_tao_elem
+ )
+{
+ return
+ TAO::Any_Dual_Impl_T<MyStruct>::extract (
+ _tao_any,
+ MyStruct::_tao_any_destructor,
+ _tc_MyStruct,
+ _tao_elem
+ );
+}
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/cdr_op_cs.cpp:61
+
+::CORBA::Boolean operator<< (
+ TAO_OutputCDR &,
+ const MyStruct &
+ )
+{
+ ACE_DEBUG ((LM_ERROR, "Test Failed - attempt to marshal a MyStruct - optimisation is not working !!\n"));
+ return 0;
+// return
+// (strm << _tao_aggregate.myString.in ());
+}
+
+::CORBA::Boolean operator>> (
+ TAO_InputCDR &,
+ MyStruct &
+ )
+{
+ ACE_DEBUG ((LM_ERROR, "Test Failed - attempt to demarshal a MyStruct - optimisation is not working !!\n"));
+ return 0;
+// return
+// (strm >> _tao_aggregate.myString.out ());
+}
diff --git a/TAO/tests/Bug_2289_Regression/MyStructC.h b/TAO/tests/Bug_2289_Regression/MyStructC.h
new file mode 100644
index 00000000000..7726d049371
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructC.h
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:154
+
+#ifndef _TAO_IDL_MYSTRUCTC_H_
+#define _TAO_IDL_MYSTRUCTC_H_
+
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/AnyTypeCode/AnyTypeCode_methods.h"
+#include "tao/ORB.h"
+#include "tao/Environment.h"
+#include "tao/VarOut_T.h"
+
+#if defined (TAO_EXPORT_MACRO)
+#undef TAO_EXPORT_MACRO
+#endif
+#define TAO_EXPORT_MACRO
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_type.cpp:258
+
+struct MyStruct;
+
+typedef
+ TAO_Var_Var_T<
+ MyStruct
+ >
+ MyStruct_var;
+
+typedef
+ TAO_Out_T<
+ MyStruct,
+ MyStruct_var
+ >
+ MyStruct_out;
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/structure_ch.cpp:57
+
+struct MyStruct
+{
+ typedef MyStruct_var _var_type;
+
+ static void _tao_any_destructor (void *);
+ TAO_String_Manager myString;
+};
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:49
+
+extern ::CORBA::TypeCode_ptr const _tc_MyStruct;
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_traits.cpp:61
+
+// Traits specializations.
+namespace TAO
+{
+}
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/any_op_ch.cpp:53
+
+ void operator<<= (::CORBA::Any &, const MyStruct &); // copying version
+ void operator<<= (::CORBA::Any &, MyStruct*); // noncopying version
+ ::CORBA::Boolean operator>>= (const ::CORBA::Any &, MyStruct *&); // deprecated
+ ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const MyStruct *&);
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/cdr_op_ch.cpp:54
+
+ ::CORBA::Boolean operator<< (TAO_OutputCDR &, const MyStruct &);
+ ::CORBA::Boolean operator>> (TAO_InputCDR &, MyStruct &);
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:1040
+
+#if defined (__ACE_INLINE__)
+#include "MyStructC.inl"
+#endif /* defined INLINE */
+
+#endif /* ifndef */
+
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructC.inl b/TAO/tests/Bug_2289_Regression/MyStructC.inl
new file mode 100644
index 00000000000..c944d806c1f
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructC.inl
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructS.cpp b/TAO/tests/Bug_2289_Regression/MyStructS.cpp
new file mode 100644
index 00000000000..d01ee5bdb40
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructS.cpp
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:553
+
+#ifndef _TAO_IDL_MYSTRUCTS_CPP_
+#define _TAO_IDL_MYSTRUCTS_CPP_
+
+
+#include "MyStructS.h"
+
+#if !defined (__ACE_INLINE__)
+#include "MyStructS.inl"
+#endif /* !defined INLINE */
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:70
+
+// Arg traits specializations.
+namespace TAO
+{
+}
+
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:70
+
+// Arg traits specializations.
+namespace TAO
+{
+}
+
+
+#endif /* ifndef */
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructS.h b/TAO/tests/Bug_2289_Regression/MyStructS.h
new file mode 100644
index 00000000000..e89d2a3893e
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructS.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:373
+
+#ifndef _TAO_IDL_MYSTRUCTS_H_
+#define _TAO_IDL_MYSTRUCTS_H_
+
+
+#include "MyStructC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:1072
+
+#include "MyStructS_T.h"
+
+#if defined (__ACE_INLINE__)
+#include "MyStructS.inl"
+#endif /* defined INLINE */
+
+#endif /* ifndef */
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructS.inl b/TAO/tests/Bug_2289_Regression/MyStructS.inl
new file mode 100644
index 00000000000..c944d806c1f
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructS.inl
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructS_T.cpp b/TAO/tests/Bug_2289_Regression/MyStructS_T.cpp
new file mode 100644
index 00000000000..e2e46dcf1c5
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructS_T.cpp
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:627
+
+#ifndef _TAO_IDL_MYSTRUCTS_T_CPP_
+#define _TAO_IDL_MYSTRUCTS_T_CPP_
+
+#include "MyStructS_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "MyStructS_T.inl"
+#endif /* !defined INLINE */
+
+
+#endif /* ifndef */
diff --git a/TAO/tests/Bug_2289_Regression/MyStructS_T.h b/TAO/tests/Bug_2289_Regression/MyStructS_T.h
new file mode 100644
index 00000000000..de1fbb4af85
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructS_T.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:501
+
+#ifndef _TAO_IDL_MYSTRUCTS_T_H_
+#define _TAO_IDL_MYSTRUCTS_T_H_
+
+
+
+// TAO_IDL - Generated from
+// E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:1165
+
+#if defined (__ACE_INLINE__)
+#include "MyStructS_T.inl"
+#endif /* defined INLINE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "MyStructS_T.cpp"
+#endif /* defined REQUIRED SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("MyStructS_T.cpp")
+#endif /* defined REQUIRED PRAGMA */
+
+#endif /* ifndef */
+
diff --git a/TAO/tests/Bug_2289_Regression/MyStructS_T.inl b/TAO/tests/Bug_2289_Regression/MyStructS_T.inl
new file mode 100644
index 00000000000..38aa32569ba
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/MyStructS_T.inl
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
diff --git a/TAO/tests/Bug_2289_Regression/README b/TAO/tests/Bug_2289_Regression/README
new file mode 100644
index 00000000000..c8b93300967
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/README
@@ -0,0 +1,75 @@
+// $Id$
+
+This test checks that collocation optimisation takes effect after a location forward is received to an in process servant.
+
+It comprises:
+1/ A trivial IDL interface (Test.idl) with a single method that passes a struct, this interface is implemented with a No-op servant (MyInterfaceImpl).
+2/ A definition of the struct (MyStruct.idl). The stub / skel code for this has been pre-generated and altered such that it will fail to marshal to / from a CDR stream (see MyStructC.cpp).
+3/ A server which initialises a listener and binds a file:// type IOR for the client's servant into its IORTable against a name.
+4/ A client which initialises an in process MyInterfaceImpl servant.
+
+The client uses a corbaloc based on the server's endpoint and the name that its (the client's) reference is bound against in the server IORTable.
+
+Narrowing this results in a remote is_a which causes the server ORB to send a locate_forward to the client directing it to the 'in process' servant.
+
+If the fix is present the client ORB will pass the MyStruct object by reference - if the fix is not present it will attempt to marshal it and the hand-broken stub code will fail, causing the test to fail.
+
+N.B. If this test starts to fail to compile the most likely culprit is that the IDL compiler generated code has changed substantially. If this happens the MyStruct.idl will have to be used to generate some up to date code stub/skel which will then have to be 'broken' and committed.
+
+To generate the code do:
+
+tao_idl -Ge 1 -I$(TAO_ROOT) -Gp -Gd MyStruct.idl
+
+To break the stub demarshalling code do something like:
+
+$ diff -u MyStructC.cpp.orig MyStructC.cpp
+--- MyStructC.cpp.orig 2005-10-31 15:50:22.000000000 +0000
++++ MyStructC.cpp 2005-10-31 15:53:16.000000000 +0000
+@@ -152,19 +152,23 @@
+ // E:\doc_cvs\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_structure/cdr_op_cs.cpp:61
+
+ ::CORBA::Boolean operator<< (
+- TAO_OutputCDR &strm,
+- const MyStruct &_tao_aggregate
++ TAO_OutputCDR &,
++ const MyStruct &
+ )
+ {
+- return
+- (strm << _tao_aggregate.myString.in ());
++ ACE_DEBUG ((LM_ERROR, "Test Failed - attempt to marshal a MyStruct - optimisation is not working !!\n"));
++ return 0;
++// return
++// (strm << _tao_aggregate.myString.in ());
+ }
+
+ ::CORBA::Boolean operator>> (
+- TAO_InputCDR &strm,
+- MyStruct &_tao_aggregate
++ TAO_InputCDR &,
++ MyStruct &
+ )
+ {
+- return
+- (strm >> _tao_aggregate.myString.out ());
++ ACE_DEBUG ((LM_ERROR, "Test Failed - attempt to demarshal a MyStruct - optimisation is not working !!\n"));
++ return 0;
++// return
++// (strm >> _tao_aggregate.myString.out ());
+ }
+
+__Regression Output__
+
+E:\doc_cvs\ACE_wrappers\TAO\tests\Bug_nnnn_Regression>run_test.pl
+Test Failed - attempt to marshal a MyStruct - optimisation is not working !!
+(2468|2960) EXCEPTION, Exception caught:
+system exception, ID 'IDL:omg.org/CORBA/MARSHAL:1.0'
+Unknown vendor minor code id (0), minor code = 0, completed = NO
+
+ERROR: Bug #TAO135 Regression failed. Non zero result from client.
+
+__Successful Output__
+
+E:\doc_cvs\ACE_wrappers\TAO\tests\Bug_nnnn_Regression>run_test.pl
+Test succeeded
+INFO: E:\doc_cvs\ACE_wrappers\TAO\tests\Bug_nnnn_Regression\server being killed.
diff --git a/TAO/tests/Bug_2289_Regression/Test.idl b/TAO/tests/Bug_2289_Regression/Test.idl
new file mode 100644
index 00000000000..8709e0827be
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/Test.idl
@@ -0,0 +1,8 @@
+// $Id$
+
+#include "MyStruct.idl"
+
+interface MyInterface
+{
+ void myMethod (in MyStruct structParam);
+};
diff --git a/TAO/tests/Bug_2289_Regression/client.cpp b/TAO/tests/Bug_2289_Regression/client.cpp
new file mode 100644
index 00000000000..5ea766b66a2
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/client.cpp
@@ -0,0 +1,136 @@
+//
+// $Id$
+//
+#include "TestS.h"
+#include "MyInterfaceImpl.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+
+const char *server_ior = "";
+
+const char *ior_output_file = "client.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ server_ior = get_opts.opt_arg ();
+ break;
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ MyInterfaceImpl *test_impl;
+ ACE_NEW_RETURN (test_impl,
+ MyInterfaceImpl (orb.in ()),
+ 1);
+
+ PortableServer::ServantBase_var owner_transfer(test_impl);
+
+ MyInterface_var test_ref =
+ test_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (test_ref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file != 0)
+ {
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(server_ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ MyInterface_var server =
+ MyInterface::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil server reference <%s>\n",
+ ior.in()),
+ 1);
+ }
+ MyStruct myStruct;
+
+ server->myMethod (myStruct ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Test succeeded\n"));
+
+ //hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ //ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/tests/Bug_2289_Regression/run_test.pl b/TAO/tests/Bug_2289_Regression/run_test.pl
new file mode 100755
index 00000000000..e04cfc9b313
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/run_test.pl
@@ -0,0 +1,50 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+
+# -*- perl -*-
+
+use lib '../../../bin';
+use PerlACE::Run_Test;
+
+# The server IOR file
+$server_ior_file = PerlACE::LocalFile ("server.ior");
+$client_ior_file = PerlACE::LocalFile ("client.ior");
+unlink $server_ior_file;
+unlink $client_ior_file;
+
+# The client and server processes
+$SERVER = new PerlACE::Process(PerlACE::LocalFile("server"));
+$CLIENT = new PerlACE::Process(PerlACE::LocalFile("client"));
+
+# We want the server to run on a fixed port
+$port = PerlACE::uniqueid () + 10001; # This can't be 10000 for Chorus 4.0
+
+$SERVER->Arguments("-ORBEndpoint iiop://:$port -ORBDottedDecimalAddresses 1");
+
+# Fire up the server
+$SERVER->Spawn();
+
+# We can wait on the IOR file
+if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
+{
+ print STDERR "ERROR: cannot find $server_ior_file\n";
+ $SERVER->Kill();
+ exit 1;
+}
+
+$CLIENT->Arguments("-k corbaloc::127.0.0.1:$port/collocated_ior_bound_in_remote_iortable -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa");
+if ($CLIENT->SpawnWaitKill (60) != 0)
+{
+ print STDERR "ERROR: Bug #TAO135 Regression failed. Non zero result from client.\n";
+ $SERVER->Kill();
+ exit 1;
+}
+
+# Clean up and return
+$SERVER->TerminateWaitKill (5);
+unlink $server_ior_file;
+unlink $client_ior_file;
+exit 0;
diff --git a/TAO/tests/Bug_2289_Regression/server.cpp b/TAO/tests/Bug_2289_Regression/server.cpp
new file mode 100644
index 00000000000..47f749d99bd
--- /dev/null
+++ b/TAO/tests/Bug_2289_Regression/server.cpp
@@ -0,0 +1,142 @@
+//
+// $Id$
+//
+
+#include "MyInterfaceImpl.h"
+#include "TestS.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/IORTable/IORTable.h"
+
+ACE_RCSID (Hello,
+ server,
+ "server.cpp,v 1.6 2003/11/01 11:15:11 dhinton Exp")
+
+const char *ior_output_file = "server.ior";
+
+const char *client_ior = "file://client.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ client_ior = get_opts.opt_arg ();
+ break;
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ MyInterfaceImpl *test_impl;
+ ACE_NEW_RETURN (test_impl,
+ MyInterfaceImpl (orb.in ()),
+ 1);
+
+ PortableServer::ServantBase_var owner_transfer(test_impl);
+
+ MyInterface_var test_ref =
+ test_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (test_ref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file != 0)
+ {
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Nil IORTable\n"));
+ }
+ else
+ {
+ adapter->bind ("collocated_ior_bound_in_remote_iortable", client_ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}