summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog16
-rw-r--r--TAO/bin/tao_orb_tests.lst5
-rw-r--r--TAO/tests/Bug_3766_Regression/client.cpp34
-rwxr-xr-x[-rw-r--r--]TAO/tests/Bug_3766_Regression/run_test.pl4
-rw-r--r--TAO/tests/Bug_3766_Regression/server.cpp34
-rw-r--r--TAO/tests/Bug_3790_Regression/server2.cpp2
-rw-r--r--TAO/tests/CodeSets/simple/client.cpp42
-rwxr-xr-xTAO/tests/CodeSets/simple/run_test.pl16
-rw-r--r--TAO/tests/CodeSets/simple/server.cpp35
9 files changed, 159 insertions, 29 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index f3101314407..4ff21acb08e 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,19 @@
+Wed Dec 23 11:56:42 UTC 2009 Vladimir Zykov <vladimir.zykov@prismtech.com>
+
+ * tests/CodeSets/simple/client.cpp:
+ * tests/CodeSets/simple/server.cpp:
+ * tests/CodeSets/simple/run_test.pl:
+ * tests/Bug_3766_Regression/client.cpp:
+ * tests/Bug_3766_Regression/server.cpp:
+ * tests/Bug_3766_Regression/run_test.pl:
+ Changed the tests so they accept IORs from command line.
+
+ * tests/Bug_3790_Regression/server2.cpp:
+ Fixed compile error on wchar builds.
+
+ * bin/tao_orb_tests.lst:
+ Disabled a test for bug#3542 on static builds.
+
Wed Dec 23 09:31:42 UTC 2009 Johnny Willemsen <jwillemsen {at} remedy.nl>
* TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp:
diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst
index 091010e6cd7..f250ad974b1 100644
--- a/TAO/bin/tao_orb_tests.lst
+++ b/TAO/bin/tao_orb_tests.lst
@@ -141,7 +141,7 @@ TAO/tests/Bug_3499_Regression/run_test.pl: !STATIC
TAO/tests/Bug_3506_Regression/run_test.pl:
TAO/tests/Bug_3524_Regression/run_test.pl: !CORBA_E_MICRO
TAO/tests/Bug_3531_Regression/run_test.pl: !ST !NO_MESSAGING !CORBA_E_MICRO !FIXED_BUGS_ONLY
-TAO/tests/Bug_3542_Regression/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO
+TAO/tests/Bug_3542_Regression/run_test.pl: !STATIC !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO
#TAO/tests/Bug_3543_Regression/run_test.pl: !ST
TAO/tests/Bug_3548_Regression/run_test.pl:
TAO/tests/Bug_3552_Regression/run_test.pl:
@@ -171,7 +171,6 @@ TAO/tests/Bug_3748_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MI
TAO/tests/Bug_3755_Regression/run_test.pl: !STATIC !CORBA_E_COMPACT !CORBA_E_MICRO !ST
TAO/tests/Bug_3766_Regression/run_test.pl:
TAO/tests/Bug_3790_Regression/run_test.pl:
-TAO/tests/Bug_3801_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO
TAO/tests/DIOP/run_test.pl: !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO
TAO/tests/DIOP/run_test_ipv6.pl: IPV6 !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO
TAO/tests/RTCORBA/Activate_Object_Multiple_ORBs/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST
@@ -241,7 +240,7 @@ TAO/tests/CallbackTest/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO
TAO/tests/CallbackTest/run_test_ipv6.pl: IPV6 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO
TAO/tests/CallbackTest/run_test_mixed_ip.pl: IPV6 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO
TAO/tests/Crashed_Callback/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !OpenVMS_IA64Crash
-# Disabled Crash On Write on Win32, see bugzilla 959 why !LabVIEW_RT
+# Disabled Crash On Write on Win32, see bugzilla 959 why !LabVIEW_RT !WinCE
TAO/tests/Crash_On_Write/run_test.pl: !ST !Win32
TAO/tests/Nested_Upcall_Crash/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !OpenVMS_IA64Crash !QUICK
TAO/tests/Nested_Upcall_Crash/run_test.pl -quick: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !OpenVMS_IA64Crash QUICK
diff --git a/TAO/tests/Bug_3766_Regression/client.cpp b/TAO/tests/Bug_3766_Regression/client.cpp
index 73862b53a1c..f573dbc00fb 100644
--- a/TAO/tests/Bug_3766_Regression/client.cpp
+++ b/TAO/tests/Bug_3766_Regression/client.cpp
@@ -2,8 +2,35 @@
#include "TestC.h"
#include "ace/OS.h"
+#include "ace/Get_Opt.h"
-using namespace std;
+const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
@@ -13,10 +40,13 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
CORBA::Object_var poa_object =
orb->resolve_initial_references("RootPOA");
- CORBA::Object_var object = orb->string_to_object("file://server.ior");
+ CORBA::Object_var object = orb->string_to_object(ior);
Test_var test = Test::_narrow (object.in ());
diff --git a/TAO/tests/Bug_3766_Regression/run_test.pl b/TAO/tests/Bug_3766_Regression/run_test.pl
index bf7eab9300d..f1063121bf1 100644..100755
--- a/TAO/tests/Bug_3766_Regression/run_test.pl
+++ b/TAO/tests/Bug_3766_Regression/run_test.pl
@@ -26,8 +26,8 @@ my $client_iorfile = $client->LocalFile ($iorbase);
$server->DeleteFile($iorbase);
$client->DeleteFile($iorbase);
-$SV = $server->CreateProcess ("server", "-ORBListenEndpoints iiop://:");
-$CL = $client->CreateProcess ("client", "");
+$SV = $server->CreateProcess ("server", "-o $server_iorfile -ORBListenEndpoints iiop://:");
+$CL = $client->CreateProcess ("client", "-k file://$client_iorfile");
$server_status = $SV->Spawn ();
if ($server_status != 0) {
diff --git a/TAO/tests/Bug_3766_Regression/server.cpp b/TAO/tests/Bug_3766_Regression/server.cpp
index 71aa0b50954..6ec659f344c 100644
--- a/TAO/tests/Bug_3766_Regression/server.cpp
+++ b/TAO/tests/Bug_3766_Regression/server.cpp
@@ -2,6 +2,35 @@
#include "TestI.h"
#include "ace/OS.h"
+#include "ace/Get_Opt.h"
+
+const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ 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
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
@@ -24,6 +53,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
PortableServer::POAManager_var poa_manager = root_poa->the_POAManager ();
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
Test_i *test_impl = new Test_i(orb.in());
PortableServer::ServantBase_var owner_transfer(test_impl);
@@ -38,7 +70,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
CORBA::String_var ior = orb->object_to_string (test.in());
// Output the IOR to the <ior_output_file>
- FILE* file = ACE_OS::fopen("server.ior", "w");
+ FILE* file = ACE_OS::fopen(ior_output_file, "w");
if (file == 0)
{
diff --git a/TAO/tests/Bug_3790_Regression/server2.cpp b/TAO/tests/Bug_3790_Regression/server2.cpp
index d95ae5663d6..1194bec7e52 100644
--- a/TAO/tests/Bug_3790_Regression/server2.cpp
+++ b/TAO/tests/Bug_3790_Regression/server2.cpp
@@ -8,7 +8,7 @@
#include "ace/Get_Opt.h"
#include "ace/Task.h"
-const char *testIOR = "corbaloc:iiop:localhost:15989/SIMPLE_TEST_KEY";
+const ACE_TCHAR *testIOR = ACE_TEXT ("corbaloc:iiop:localhost:15989/SIMPLE_TEST_KEY");
const ACE_TCHAR *anotherIOR = ACE_TEXT ("file://test.ior");
int
diff --git a/TAO/tests/CodeSets/simple/client.cpp b/TAO/tests/CodeSets/simple/client.cpp
index 36d0293e1e7..217c0237b86 100644
--- a/TAO/tests/CodeSets/simple/client.cpp
+++ b/TAO/tests/CodeSets/simple/client.cpp
@@ -25,6 +25,35 @@
#include "ace/OS_NS_string.h"
#include "ace/Log_Msg.h"
+#include "ace/Get_Opt.h"
+
+const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
wchar_t *
make_wstring (const char *str)
@@ -52,7 +81,6 @@ make_wstring (const char *str)
// ------------------------------------------------------------
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
- char buf[1000];
int error_count = 0;
try
@@ -61,18 +89,12 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
CORBA::ORB_var orb= CORBA::ORB_init (argc, argv);
// Get IOR from command line (or file)
- if (argc != 2)
- {
- ACE_OS::strcpy (buf, "file://server.ior");
- }
- else
- {
- ACE_OS::strcpy (buf, ACE_TEXT_ALWAYS_CHAR (argv[1]));
- }
+ if (parse_args (argc, argv) != 0)
+ return 1;
// The first arg should be the IOR
CORBA::Object_var object =
- orb->string_to_object (buf);
+ orb->string_to_object (ior);
// Get the server
simple_var server = simple::_narrow (object.in ());
diff --git a/TAO/tests/CodeSets/simple/run_test.pl b/TAO/tests/CodeSets/simple/run_test.pl
index a1f3951d23e..b12c6fec53c 100755
--- a/TAO/tests/CodeSets/simple/run_test.pl
+++ b/TAO/tests/CodeSets/simple/run_test.pl
@@ -25,8 +25,8 @@ $client->DeleteFile($iorbase);
my $client_conf = $client->LocalFile ("cs_test.conf");
my $server_conf = $server->LocalFile ("cs_test.conf");
-$SV = $server->CreateProcess ("server", " -ORBDottedDecimalAddresses 1");
-$CL = $client->CreateProcess ("client", " -ORBSvcConf $client_conf");
+$SV = $server->CreateProcess ("server", "-o $server_iorfile -ORBDottedDecimalAddresses 1");
+$CL = $client->CreateProcess ("client", "-k file://$client_iorfile -ORBSvcConf $client_conf");
$status = 0;
@@ -61,10 +61,10 @@ $client->DeleteFile($iorbase);
print STDOUT "\nServer using char translator\n\n";
-$SV2 = $server->CreateProcess ("server", " -ORBDottedDecimalAddresses 1 -ORBSvcConf $server_conf");
-$CL2 = $client->CreateProcess ("client");
+$SV->Arguments ("-o $server_iorfile -ORBDottedDecimalAddresses 1 -ORBSvcConf $server_conf");
+$CL->Arguments ("-k file://$client_iorfile");
-$server_status = $SV2->Spawn ();
+$server_status = $SV->Spawn ();
if ($server_status != 0) {
print STDERR "ERROR: Starting server 2 returned $server_status\n";
exit 1;
@@ -72,17 +72,17 @@ if ($server_status != 0) {
if ($server->WaitForFileTimed ($iorbase,
$server->ProcessStartWaitInterval()) == -1) {
print STDERR "ERROR: cannot find file <$server_iorfile>\n";
- $SV2->Kill (); $SV2->TimedWait (1);
+ $SV->Kill (); $SV->TimedWait (1);
exit 1;
}
-$client_status = $CL2->SpawnWaitKill ($client->ProcessStartWaitInterval ());
+$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
if ($client_status != 0) {
print STDERR "ERROR: client 2 returned $client_status\n";
$status = 1;
}
-$server_status = $SV2->WaitKill ($server->ProcessStopWaitInterval ());
+$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
if ($server_status != 0) {
print STDERR "ERROR: server 2 returned $server_status\n";
$status = 1;
diff --git a/TAO/tests/CodeSets/simple/server.cpp b/TAO/tests/CodeSets/simple/server.cpp
index 99c7b390ee9..e4861f12313 100644
--- a/TAO/tests/CodeSets/simple/server.cpp
+++ b/TAO/tests/CodeSets/simple/server.cpp
@@ -24,6 +24,35 @@
#include "ace/streams.h"
#include "ace/OS_NS_stdio.h"
+#include "ace/Get_Opt.h"
+
+const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ 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;
+}
// ------------------------------------------------------------
// Servant for associated CORBA object
@@ -80,7 +109,6 @@ private:
// ------------------------------------------------------------
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
-
try
{
// Init the orb
@@ -106,6 +134,9 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
PortableServer::POAManager_var poa_manager =
root_poa->the_POAManager ();
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
// Create a C++ implementation of CORBA object
SimpleImpl* my_impl = 0;
ACE_NEW_RETURN (my_impl,
@@ -123,7 +154,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Get the IOR for our object
CORBA::String_var ior = orb->object_to_string (server.in ());
- FILE *output_file= ACE_OS::fopen ("server.ior", "w");
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
if (output_file == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open output file for writing IOR: server.ior"),