summaryrefslogtreecommitdiff
path: root/examples/Naming
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-09 00:28:46 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-02-09 00:28:46 +0000
commit3419635d86c26dc3df7cd0d8db9850ee8fc275c3 (patch)
treebd1cd26cf84b170e22285d28dd68d3286f0dca07 /examples/Naming
parent9f067df3aa353616017e57ddf5ced659d7aa1380 (diff)
downloadATCD-3419635d86c26dc3df7cd0d8db9850ee8fc275c3.tar.gz
replaced uses of cout with ACE_DEBUG
Diffstat (limited to 'examples/Naming')
-rw-r--r--examples/Naming/test_multiple_contexts.cpp34
-rw-r--r--examples/Naming/test_non_existent.cpp18
-rw-r--r--examples/Naming/test_writers.cpp23
3 files changed, 39 insertions, 36 deletions
diff --git a/examples/Naming/test_multiple_contexts.cpp b/examples/Naming/test_multiple_contexts.cpp
index 7abed212808..f98d6582c72 100644
--- a/examples/Naming/test_multiple_contexts.cpp
+++ b/examples/Naming/test_multiple_contexts.cpp
@@ -1,45 +1,47 @@
+// $Id$
+
#include "ace/Naming_Context.h"
int main (int, char *[])
{
- static u_long ACE_DEFAULT_BASE_ADDR_1 = (1 * 64 * 1024 * 1024);
+ static u_long ACE_DEFAULT_BASE_ADDR_1 = (1 * 64 * 1024 * 1024);
static u_long ACE_DEFAULT_BASE_ADDR_2 = (2 * 64 * 1024 * 1024);
int i;
-
+
ACE_Naming_Context * ns_ptr = new ACE_Naming_Context ();
ACE_Name_Options *name_options = ns_ptr->name_options ();
-
+
ACE_Naming_Context * ns_ptr1 = new ACE_Naming_Context ();
ACE_Name_Options *name_options1 = ns_ptr1->name_options ();
-
+
char address_arg1[BUFSIZ];
char address_arg2[BUFSIZ];
ACE_OS::sprintf (address_arg1, "-b%d", ACE_DEFAULT_BASE_ADDR_1);
char * m_argv[] = {"MyName1",
- "-cNODE_LOCAL",
- address_arg1,
- NULL};
+ "-cNODE_LOCAL",
+ address_arg1,
+ NULL};
int m_argc = sizeof (m_argv) / sizeof (char *) -1;
ACE_OS::sprintf (address_arg2, "-b%d", ACE_DEFAULT_BASE_ADDR_2);
char * n_argv[] = {"MyName2",
- "-cNODE_LOCAL",
- address_arg2,
- NULL};
+ "-cNODE_LOCAL",
+ address_arg2,
+ NULL};
int n_argc = sizeof (n_argv) / sizeof (char *) -1;
name_options->parse_args (m_argc, m_argv);
- i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
- cout << ACE_OS::getpid () << ": opened with " << i << endl;
+ i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
+ ACE_DEBUG ((LM_DEBUG, "(%P) opened with %d\n", i));
if (i != 0) return -1;
-
+
name_options1->parse_args (n_argc, n_argv);
- i = ns_ptr1->open (ACE_Naming_Context::NODE_LOCAL);
- cout << ACE_OS::getpid () << ": 1 opened with " << i << endl;
- if (i != 0) return -1;
+ i = ns_ptr1->open (ACE_Naming_Context::NODE_LOCAL);
+ ACE_DEBUG ((LM_DEBUG, "(%P) 1 opened with %d\n", i));
+ if (i != 0) return -1;
return 0;
}
diff --git a/examples/Naming/test_non_existent.cpp b/examples/Naming/test_non_existent.cpp
index a78bc26ab20..d476a0bf217 100644
--- a/examples/Naming/test_non_existent.cpp
+++ b/examples/Naming/test_non_existent.cpp
@@ -1,12 +1,14 @@
+// $Id$
+
#include "ace/Naming_Context.h"
int main (int, char *[])
{
int i;
-
+
ACE_Naming_Context * ns_ptr = new ACE_Naming_Context ();
ACE_Name_Options *name_options = ns_ptr->name_options ();
-
+
#if defined (ACE_WIN32)
char * m_argv[] = {"MyName",
"-cNODE_LOCAL" ,
@@ -21,14 +23,12 @@ int main (int, char *[])
int m_argc = sizeof (m_argv) / sizeof (char *) -1;
name_options->parse_args (m_argc,m_argv);
- i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
- cout << ACE_OS::getpid () << ": opened with " << i << endl;
+ i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
+ ACE_DEBUG ((LM_DEBUG, "(%P) opened with %d\n", i));
if (i != 0) return -1;
-
- i = ns_ptr->bind ("Key_Value","Val_Value","-");
- cout << ACE_OS::getpid () << ": bound with " << i << endl;
-
- return 0;
+ i = ns_ptr->bind ("Key_Value","Val_Value","-");
+ ACE_DEBUG ((LM_DEBUG, "(%P) bound with %d\n", i));
+ return 0;
}
diff --git a/examples/Naming/test_writers.cpp b/examples/Naming/test_writers.cpp
index 9ed87d4959f..00d90bc2f8a 100644
--- a/examples/Naming/test_writers.cpp
+++ b/examples/Naming/test_writers.cpp
@@ -1,39 +1,40 @@
+// $Id$
+
#include "ace/Naming_Context.h"
int main (int, char *[])
{
int i;
-
+
ACE_Naming_Context * ns_ptr = new ACE_Naming_Context ();
ACE_Name_Options *name_options = ns_ptr->name_options ();
-
- char * m_argv[] = {"MyName",
- "-cNODE_LOCAL",
+
+ char * m_argv[] = {"MyName",
+ "-cNODE_LOCAL",
NULL};
int m_argc = sizeof (m_argv) / sizeof (char *) -1;
name_options->parse_args (m_argc,m_argv);
- i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
- cout << ACE_OS::getpid () << ": opened with " << i << endl;
+ i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
+ ACE_DEBUG ((LM_DEBUG, "(%P) opened with %d\n", i));
if (i != 0) return -1;
char Key[128];
char Val[32];
char Type[2];
-
+
Type[0] = '-';
Type[1] = '\0';
-
+
for (int l = 1; l <= 1000 ; l++) {
ACE_OS::sprintf (Key, "K_%05d_%05d", ACE_OS::getpid(), l);
ACE_OS::sprintf (Val, "Val%05d", l);
- i = ns_ptr->bind (Key, Val, Type);
- cout << ACE_OS::getpid() << ": bind of " << Key << " :" << i << endl;
+ i = ns_ptr->bind (Key, Val, Type);
+ ACE_DEBUG ((LM_DEBUG, "(%P) bind of %s: %d\n", Key, i));
if (i != 0) {
return -1;
}
-
}
return 0;