summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-11-30 11:50:14 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-11-30 11:50:14 +0000
commit10c4f416635aa170b916766932e492f31515dc18 (patch)
tree9ef746e799364c89b9e5b9977e1f29abde12d0af
parentf323e358761e5421ea0bc6e95cade91e270c0943 (diff)
downloadATCD-10c4f416635aa170b916766932e492f31515dc18.tar.gz
ChangeLogTag: Fri Nov 30 11:50:00 UTC 2007 Simon Massey <sma@prismtech.com>
-rw-r--r--TAO/ChangeLog10
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc14
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt4
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl67
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl22
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp126
6 files changed, 243 insertions, 0 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 37a2868b9fd..cf68ee79b97 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,13 @@
+Fri Nov 30 11:50:00 UTC 2007 Simon Massey <sma@prismtech.com>
+
+ * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc:
+ * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt:
+ * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl:
+ * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl:
+ * orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp:
+
+ Removed new regression test (wrong place)
+
Fri Nov 30 11:43:00 UTC 2007 Simon Massey <sma@prismtech.com>
* tests/Bug_3155_Regression/Bug_3155_Regression.mpc:
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc
new file mode 100644
index 00000000000..30905c16208
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/Bug_3155_Regression.mpc
@@ -0,0 +1,14 @@
+// -*- MPC -*-
+// $Id$
+
+project(*test_idl): taoexe, ifr_client {
+ exename = test_idl
+ includes += $(TAO_ROOT)/include
+
+ Source_Files {
+ test_idl.cpp
+ }
+
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt
new file mode 100644
index 00000000000..84876c5d797
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/ReadMe.txt
@@ -0,0 +1,4 @@
+(tao573 Similar to tao567, but not with an abstract base valuetype)
+
+when the describe_ext_value() call is done, this produces
+BAD_PARAM exception incorrectly.
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl
new file mode 100755
index 00000000000..3bdde3f636b
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl
@@ -0,0 +1,67 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+
+$status = 0;
+my $exec_extn="";
+if ($^O eq "MSWin32") {
+ $exec_extn=".exe";
+}
+$ifr_service= "$ENV{ACE_ROOT}/bin/IFR_Service";
+if (! -e $ifr_service . $exec_extn ) {
+ $ifr_service= "$ENV{TAO_ROOT}/TAO/orbsvcs/IFR_Service/IFR_Service";
+ if (! -e $ifr_service . $exec_extn ) {
+ $ifr_service = "$ENV{TAO_ROOT}/TAO/orbsvcs/IFR_Service/Release/IFR_Service";
+ if (! -e $ifr_service . $exec_extn ) {
+ print STDERR "ERROR: IFR_Service not found.\n";
+ exit 1;
+ }
+ }
+}
+$iorfile = PerlACE::LocalFile ("ifr.ior");
+unlink $iorfile;
+
+print STDERR "\n\n==== Running Forward Declared ValueType Definition test\n";
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("$ifr_service", "-o $iorfile");
+}
+else {
+ $SV = new PerlACE::Process ("$ifr_service", "-o $iorfile");
+}
+
+print STDERR "Starting IFR Service\n";
+$SV->Spawn ();
+if (PerlACE::waitforfile_timed ($iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$LOADER = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/tao_ifr",
+ "-ORBInitRef InterfaceRepository=file://$iorfile test.idl");
+print STDERR "Loading test.idl into IFR service\n";
+$status = $LOADER->SpawnWaitKill (15);
+if ($status != 0) {
+ print STDERR "ERROR: IFR Loading returned $status\n";
+}
+
+print STDERR "Running test_idl\n";
+$TEST = new PerlACE::Process ("test_idl", "-i file://$iorfile -s IDL:M1/VT:1.0");
+$status = $TEST->SpawnWaitKill (15);
+if ($status != 0) {
+ print STDERR "ERROR: test_idl returned $status\n";
+}
+
+print STDERR "Stopping IFR\n";
+$SV->Kill(); $SV->TimedWait (1);
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl
new file mode 100644
index 00000000000..41d1acf9c89
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test.idl
@@ -0,0 +1,22 @@
+// $Id$
+
+module C1
+{
+ valuetype EB // NOT abstract
+ {
+ };
+};
+
+module M1
+{
+ valuetype VT; // Forward declare
+};
+
+module M1
+{
+ valuetype VT : // Full definition
+ ::C1::EB
+ {
+ public long id;
+ };
+};
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp
new file mode 100644
index 00000000000..d17ac410255
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/test_idl.cpp
@@ -0,0 +1,126 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "tao/ORB.h"
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+
+namespace
+{
+ const char *ifr_ior_file = 0;
+ const char *idl_value = 0;
+}
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "i:s:");
+ const unsigned char full_success = 0x03;
+ unsigned char success = 0;
+
+ while (true)
+ {
+ int c = get_opts ();
+ if (success == full_success)
+ {
+ break;
+ }
+
+ if (c == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " -i <ifr_ior>"
+ " -s <idl_valuetype>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ switch (c)
+ {
+ case 'i':
+ ifr_ior_file = get_opts.opt_arg ();
+ success |= 0x01;
+ break;
+ case 's':
+ idl_value = get_opts.opt_arg ();
+ success |= 0x02;
+ break;
+ }
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+
+int main (int argc, char** argv)
+{
+ // init orb
+ CORBA::ORB_var the_orb =
+ CORBA::ORB_init (argc, argv);
+
+ if (parse_args (argc, argv) == -1)
+ {
+ return -1;
+ }
+
+ // get IFR
+ CORBA::Object_var objref =
+ the_orb->string_to_object (ifr_ior_file);
+ if (objref.in () == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "The received objref is nil\n"),
+ -1);
+ }
+
+ CORBA::ComponentIR::Repository_var the_repo_ref;
+ try
+ {
+ the_repo_ref = CORBA::ComponentIR::Repository::_narrow (objref.in ());
+ }
+ catch (CORBA::Exception &ex)
+ {
+ ex._tao_print_exception ("Can't narrow the IFR:");
+ return 1;
+ }
+
+ // search in repository
+ CORBA::Contained_var current_contained =
+ the_repo_ref->lookup_id (idl_value);
+ if (CORBA::is_nil(current_contained.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Can't look up the valuetype\n"),
+ -1);
+ }
+
+ // get value type definition
+ CORBA::ExtValueDef_var value_def =
+ CORBA::ExtValueDef::_narrow (current_contained.in ());
+ CORBA::ExtValueDef::ExtFullValueDescription * value_descr;
+ try
+ {
+ value_descr = value_def->describe_ext_value ();
+ }
+ catch (CORBA::Exception &ex)
+ {
+ ex._tao_print_exception ("Can't describe_ext_value:");
+ return 1;
+ }
+
+ CORBA::ValueMemberSeq& the_value_members =
+ value_descr->members;
+ for (CORBA::ULong ct = 0; ct < the_value_members.length (); ++ct)
+ {
+ const CORBA::ValueMember& current_member =
+ the_value_members [ct];
+ ACE_DEBUG ((LM_DEBUG,
+ "value type member '%s'\n",
+ current_member.name.in ()));
+ }
+
+ return 0;
+}