summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2008-10-06 14:40:17 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2008-10-06 14:40:17 +0000
commit7d0980ea31b076d725b1c49fce1e5ae765fc4a84 (patch)
tree5d99b96dbb877369ef9189ff416ecf68029f27c6
parent801dbbd3007263d53a8ddd266cc76e49931c974c (diff)
downloadATCD-7d0980ea31b076d725b1c49fce1e5ae765fc4a84.tar.gz
Mon Oct 6 14:38:45 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/ChangeLog18
-rw-r--r--TAO/tests/CollocationLockup/SimpleNamingService.cpp44
-rw-r--r--TAO/tests/Connection_Purging/client.cpp8
-rw-r--r--TAO/tests/NestedUpcall/MT_Client_Test/server.cpp4
-rw-r--r--TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp4
-rw-r--r--TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc2
6 files changed, 67 insertions, 13 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 615e4dfb043..61e59fc5ed4 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,21 @@
+Mon Oct 6 14:38:45 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tests/CollocationLockup/SimpleNamingService.cpp
+ * tests/Connection_Purging/client.cpp
+ ACE_TCHAR fixes
+
+ * tests/CollocationLockup/SimpleNamingService.cpp
+ Make it possible to specify the IOR file on the commandline
+
+ * tests/NestedUpcall/Triangle_Test/initiator.cpp:
+ Fixed invalid free
+
+ * tests/NestedUpcall/MT_Client_Test/server.cpp:
+ Changed scope of variable
+
+ * tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc:
+ Removed borland template type
+
Mon Oct 6 14:30:45 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Big_Reply/client.cpp
diff --git a/TAO/tests/CollocationLockup/SimpleNamingService.cpp b/TAO/tests/CollocationLockup/SimpleNamingService.cpp
index 725060fe6b6..a94dd3aa3e5 100644
--- a/TAO/tests/CollocationLockup/SimpleNamingService.cpp
+++ b/TAO/tests/CollocationLockup/SimpleNamingService.cpp
@@ -10,10 +10,11 @@
#include "ace/String_Base.h"
#include "ace/streams.h"
+#include "ace/Get_Opt.h"
namespace
{
- const char* iorFileName = "SimpleNamingService.ior";
+ const ACE_TCHAR* iorFileName = ACE_TEXT("SimpleNamingService.ior");
}
class SimpleNamingService_i : public virtual POA_SimpleNamingService
@@ -40,12 +41,42 @@ private:
};
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':
+ iorFileName = 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[])
{
try
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
CORBA::Object_var pPoaObj =
orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var poa =
@@ -58,9 +89,14 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
CORBA::Object_var obj = poa->id_to_reference (oid.in ());
CORBA::String_var str = orb->object_to_string (obj.in ());
- ofstream iorFile (iorFileName);
- iorFile << str.in () << endl;
- iorFile.close ();
+ FILE *output_file= ACE_OS::fopen (iorFileName, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s\n",
+ iorFileName),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
orb->run ();
}
diff --git a/TAO/tests/Connection_Purging/client.cpp b/TAO/tests/Connection_Purging/client.cpp
index 95331c7b583..a4657c52a7a 100644
--- a/TAO/tests/Connection_Purging/client.cpp
+++ b/TAO/tests/Connection_Purging/client.cpp
@@ -48,15 +48,15 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
test_var holder;
for(int i = 0; !done; i++)
{
- char number[64];
- ACE_CString iorfile(ior);
+ ACE_TCHAR number[64];
+ ACE_TString iorfile(ior);
- ACE_OS::sprintf (number, ".%d", i);
+ ACE_OS::sprintf (number, ACE_TEXT(".%d"), i);
iorfile += number;
if (ACE_OS::access(iorfile.c_str (), R_OK) == 0)
{
- iorfile = "file://" + iorfile;
+ iorfile = ACE_TEXT("file://") + iorfile;
CORBA::Object_var tmp =
orb->string_to_object(iorfile.c_str ());
diff --git a/TAO/tests/NestedUpcall/MT_Client_Test/server.cpp b/TAO/tests/NestedUpcall/MT_Client_Test/server.cpp
index 3c3acc77d85..6d3e576e1db 100644
--- a/TAO/tests/NestedUpcall/MT_Client_Test/server.cpp
+++ b/TAO/tests/NestedUpcall/MT_Client_Test/server.cpp
@@ -119,13 +119,13 @@ MT_Object_Server::~MT_Object_Server (void)
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
- MT_Object_Server MT_Object_Server;
-
ACE_DEBUG ((LM_DEBUG,
"\n \t NestedUpCalls.Triangle_Test: Object A Server \n \n"));
try
{
+ MT_Object_Server MT_Object_Server;
+
int r = MT_Object_Server.init (argc,argv);
if (r == -1)
diff --git a/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp b/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp
index 3ea8dcfcdf5..eb428b22f60 100644
--- a/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp
+++ b/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp
@@ -251,9 +251,9 @@ Initiator_Server::run (void)
Initiator_Server::~Initiator_Server (void)
{
if (this->object_A_key_ != 0)
- ACE_OS::free (this->object_A_key_);
+ ACE_Allocator::instance ()->free (this->object_A_key_);
if (this->object_B_key_ != 0)
- ACE_OS::free (this->object_B_key_);
+ ACE_Allocator::instance ()->free (this->object_B_key_);
try
{
diff --git a/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc b/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc
index 31824d238ea..d72fada0143 100644
--- a/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc
+++ b/TAO/tests/Nested_Upcall_Crash/Nested_Upcall_Crash.mpc
@@ -10,7 +10,7 @@ project(*idl): taoidldefaults {
project(*Server): taoserver, messaging {
after += *idl
- specific(bmake, borland, nmake, em3, vc6, vc71, vc8, vc9) {
+ specific(bmake, nmake, em3, vc6, vc71, vc8, vc9) {
// Use a roughly 16MB stack to avoid stack overflow in this test
StackReserveSize = 16000000
}