summaryrefslogtreecommitdiff
path: root/TAO/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2004-04-28 10:40:49 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2004-04-28 10:40:49 +0000
commit5bd547e82267f8905cd5a454140121880d9d8c29 (patch)
treee7163982222d96b827cacb62f3a23d96985e96d7 /TAO/tests
parentc46c18c05371fe5687b4670b25e5391dd82494a5 (diff)
downloadATCD-5bd547e82267f8905cd5a454140121880d9d8c29.tar.gz
ChangeLogTag: Wed Apr 28 10:40:11 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tests')
-rw-r--r--TAO/tests/AMH_Oneway/client.cpp26
-rw-r--r--TAO/tests/AMH_Oneway/server.cpp25
2 files changed, 48 insertions, 3 deletions
diff --git a/TAO/tests/AMH_Oneway/client.cpp b/TAO/tests/AMH_Oneway/client.cpp
index d2873e3738a..ec797de5978 100644
--- a/TAO/tests/AMH_Oneway/client.cpp
+++ b/TAO/tests/AMH_Oneway/client.cpp
@@ -1,9 +1,28 @@
// $Id$
+#include "ace/Get_Opt.h"
#include "TestC.h"
const char *ior = "file://test.ior";
-const int num_calls = 10;
+int num_calls = 10;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "n:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'n':
+ num_calls = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
int
main (int argc, char *argv[])
@@ -14,6 +33,9 @@ main (int argc, char *argv[])
CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
CORBA::Object_var object =
orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
@@ -37,7 +59,7 @@ main (int argc, char *argv[])
for (int i = 0; i < num_calls; i++)
{
roundtrip->test_method (time ACE_ENV_ARG_PARAMETER);
- ACE_DEBUG ((LM_DEBUG, "Sent call # %d \n", i));
+ ACE_DEBUG ((LM_DEBUG, "Sent call # %d \n", i));
ACE_TRY_CHECK;
}
}
diff --git a/TAO/tests/AMH_Oneway/server.cpp b/TAO/tests/AMH_Oneway/server.cpp
index 011f625fb0b..b0987da7bc4 100644
--- a/TAO/tests/AMH_Oneway/server.cpp
+++ b/TAO/tests/AMH_Oneway/server.cpp
@@ -2,14 +2,34 @@
// $Id$
#include "ace/OS_NS_stdio.h"
+#include "ace/Get_Opt.h"
#include "TestS.h"
-const int num_calls = 10; // total calls client si going to make
+int num_calls = 10; // total calls client is going to make
const int sleep_time = 1; // sleep for 1 sec on each call
// This should equal num_calls within 'sleep * num_calls' seconds
int calls_received = 0;
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "n:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'n':
+ num_calls = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+
/***************************/
/*** Servant Declaration ***/
@@ -230,6 +250,9 @@ ST_AMH_Server::write_ior_to_file (CORBA::String_var ior)
int
main (int argc, char *argv[])
{
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
ST_AMH_Server amh_server (&argc, argv);
amh_server.start_orb_and_poa ();