summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-12-08 00:19:28 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-12-08 00:19:28 +0000
commit226b5e6f4bbab7ad04af93578b8acc498ca065e5 (patch)
tree47323e05dda5e3e2872e58e2a17d96679b1ece32 /TAO/orbsvcs/tests
parentf7b726055d41d7730e80595f7072bafc3ee10595 (diff)
downloadATCD-226b5e6f4bbab7ad04af93578b8acc498ca065e5.tar.gz
ChangeLogTag: Tue Dec 7 18:16:14 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/orbsvcs/tests')
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp140
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h5
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp4
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp6
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp6
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp68
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl3
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl15
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp2145
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp15
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp158
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h4
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp3
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp85
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl2
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp4
16 files changed, 1516 insertions, 1147 deletions
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp
index 43b2507bcbd..ebde4c059c6 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp
@@ -12,7 +12,8 @@ IFR_DII_Client::IFR_DII_Client (void)
: namespace_name (CORBA::string_dup ("warehouse")),
interface_name (CORBA::string_dup ("inventory")),
op_name (CORBA::string_dup ("getCDinfo")),
- lookup_by_name_ (0)
+ lookup_by_name_ (false),
+ debug_ (false)
{
}
@@ -44,9 +45,10 @@ IFR_DII_Client::init (int argc,
if (CORBA::is_nil (this->target_.in ()))
{
- ACE_ERROR_RETURN ((LM_ERROR,
- "Unable to find interface repository in: file://iorfile\n"),
- -1);
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ "Unable to find interface repository in: file://iorfile\n"),
+ -1);
}
if (this->parse_args (argc, argv) == -1)
@@ -60,20 +62,27 @@ IFR_DII_Client::init (int argc,
int
IFR_DII_Client::run (ACE_ENV_SINGLE_ARG_DECL)
{
+ int result = 0;
+
if (this->lookup_by_name_)
{
- if (this->lookup_interface_def (ACE_ENV_SINGLE_ARG_PARAMETER) == -1)
- {
- return -1;
- }
+ result = this->lookup_interface_def (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
+
+ if (result == -1)
+ {
+ return -1;
+ }
}
else
{
- if (this->find_interface_def (ACE_ENV_SINGLE_ARG_PARAMETER))
- return (-1);
-
+ result = this->find_interface_def (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
+
+ if (result == -1)
+ {
+ return (-1);
+ }
}
this->get_operation_def (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -92,23 +101,26 @@ int
IFR_DII_Client::parse_args (int argc,
char *argv[])
{
- ACE_Get_Opt opts (argc, argv, "n");
+ ACE_Get_Opt opts (argc, argv, "dn");
int c;
while ((c = opts ()) != -1)
switch (c)
{
- case 'n': // Select lookup by name.
- this->lookup_by_name_ = 1;
- break;
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s"
- " [-n]"
- "\n",
- argv [0]),
- -1);
+ case 'd':
+ this->debug_ = true;
+ break;
+ case 'n': // Select lookup by name.
+ this->lookup_by_name_ = true;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-n]"
+ "\n",
+ argv [0]),
+ -1);
}
return 0;
@@ -122,11 +134,11 @@ IFR_DII_Client::find_interface_def (ACE_ENV_SINGLE_ARG_DECL)
if (CORBA::is_nil (this->target_def_.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Unable to find interface def\n"),
- -1);
- }
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to find interface def\n"),
+ -1);
+ }
return 0;
}
@@ -147,9 +159,9 @@ IFR_DII_Client::lookup_interface_def (ACE_ENV_SINGLE_ARG_DECL)
// repository called "warehouse"?
CORBA::ContainedSeq_var candidates =
this->repo_->lookup_name (this->namespace_name.in (),
- -1, // Unlimited level recursion.
- CORBA::dk_all, // Any type of contained object.
- 1 // Exclude parents of interfaces.
+ -1, // Unlimited level recursion.
+ CORBA::dk_all, // Any type of contained object.
+ 1 // Exclude parents of interfaces.
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN(-1);
@@ -259,7 +271,8 @@ IFR_DII_Client::create_dii_request (ACE_ENV_SINGLE_ARG_DECL)
this->req_->set_return_type (this->result_.in ());
- CORBA::ParDescriptionSeq_var params = this->op_->params (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::ParDescriptionSeq_var params =
+ this->op_->params (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::ULong length = params->length ();
@@ -327,38 +340,55 @@ IFR_DII_Client::invoke_and_display (ACE_ENV_SINGLE_ARG_DECL)
CORBA::NVList_ptr args = this->req_->arguments ();
const char *artist = 0;
- *args->item (0)->value () >>= artist;
+ ACE_ASSERT ((*args->item (0)->value () >>= artist) == TRUE);
+
+ ACE_ASSERT (ACE_OS::strcmp (artist, "the Beatles") == 0);
const char *title = 0;
- *args->item (1)->value () >>= title;
+ ACE_ASSERT ((*args->item (1)->value () >>= title) == TRUE);
+
+ const char *correct = "Sgt. Pepper's Lonely Hearts Club Band";
+ ACE_ASSERT (ACE_OS::strcmp (title, correct) == 0);
CORBA::Float price = 0.0f;
- *args->item (2)->value () >>= price;
-
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s:\t%s\n")
- ACE_TEXT ("%s:\t%s\n")
- ACE_TEXT ("%s:\t$%2.2f\n"),
- args->item (0)->name (),
- artist,
- args->item (1)->name (),
- title,
- args->item (2)->name (),
- price));
-
- CORBA::Boolean in_stock = 0;
-
- this->req_->return_value () >>= CORBA::Any::to_boolean (in_stock);
+ ACE_ASSERT ((*args->item (2)->value () >>= price) == TRUE);
+
+ ACE_ASSERT (price == 13.49f);
- if (in_stock)
+ if (this->debug_)
{
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("status: in stock\n")));
+ ACE_TEXT ("%s:\t%s\n")
+ ACE_TEXT ("%s:\t%s\n")
+ ACE_TEXT ("%s:\t$%2.2f\n"),
+ args->item (0)->name (),
+ artist,
+ args->item (1)->name (),
+ title,
+ args->item (2)->name (),
+ price));
}
- else
+
+ CORBA::Boolean in_stock = 0;
+
+ CORBA::Boolean ret_status =
+ this->req_->return_value () >>= CORBA::Any::to_boolean (in_stock);
+
+ ACE_ASSERT (ret_status == TRUE);
+ ACE_ASSERT (in_stock == TRUE);
+
+ if (this->debug_)
{
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("status: out of stock\n")));
+ if (in_stock)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("status: in stock\n")));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("status: out of stock\n")));
+ }
}
}
}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h
index 8e8bf1ee3be..a362e0053cc 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h
@@ -73,10 +73,13 @@ private:
CORBA::String_var op_name;
// Things that we will be searching for in the repository.
- CORBA::Boolean lookup_by_name_;
+ bool lookup_by_name_;
// Are we looking up info on the target object by querying the
// IFR directly with the target's name, or indirectly
// by calling _get_interface() on the target object?
+
+ bool debug_;
+ // Display results and debugging info?
};
#endif /* IFR_DII_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp
index 3bfc171f83a..7cfe8d9c287 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp
@@ -87,10 +87,6 @@ main (int argc, char *argv[])
-1);
}
- ACE_DEBUG ((LM_DEBUG,
- "IOR is: <%s>\n",
- ior.in ()));
-
orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp
index a8e20d8c503..21998fdc4ac 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp
@@ -3,7 +3,9 @@
#include "test_i.h"
-ACE_RCSID(Application_Test, test_i, "$Id$")
+ACE_RCSID (Application_Test,
+ test_i,
+ "$Id$")
CORBA::Boolean
inventory_i::getCDinfo (const char * artist,
@@ -29,7 +31,7 @@ inventory_i::getCDinfo (const char * artist,
price = 13.49f;
- in_stock = 1;
+ in_stock = TRUE;
}
else
{
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp
index 9233999a0e6..410ad1fd4f3 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp
@@ -26,12 +26,6 @@ main (int argc, char *argv[])
int status = client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- const char *result_string = status ? "test failed" : "test ok";
-
- ACE_DEBUG ((LM_DEBUG,
- "%s\n",
- result_string));
-
if (status == -1)
{
return 1;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
index 10187bcdc7b..c291082e7a4 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
@@ -822,8 +822,39 @@ IDL3_Client::component_inheritance_test (
ACE_ENV_ARG_DECL
)
{
+ CORBA::ComponentIR::ComponentDef_var comp_base =
+ comp_def->base_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (comp_base.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_inheritance_test: "
+ "base component is null\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = comp_base->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), COMP_BASE_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_inheritance_test: "
+ "bad id on base component\n"));
+ }
+
+ return -1;
+ }
+
CORBA::InterfaceDefSeq_var supported =
- comp_def->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ comp_base->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
CORBA::ULong length = supported->length ();
@@ -840,8 +871,6 @@ IDL3_Client::component_inheritance_test (
return -1;
}
- CORBA::String_var str;
-
for (CORBA::ULong i = 0; i < length; ++i)
{
str = supported[i].in ()->id (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -862,37 +891,6 @@ IDL3_Client::component_inheritance_test (
}
}
- CORBA::ComponentIR::ComponentDef_var comp_base =
- comp_def->base_component (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
-
- if (CORBA::is_nil (comp_base.in ()))
- {
- if (this->debug_)
- {
- ACE_DEBUG ((LM_DEBUG,
- "component_inheritance_test: "
- "base component is null\n"));
- }
-
- return -1;
- }
-
- str = comp_base->id (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
-
- if (str.in () == 0 || ACE_OS::strcmp (str.in (), COMP_BASE_ID) != 0)
- {
- if (this->debug_)
- {
- ACE_DEBUG ((LM_DEBUG,
- "component_inheritance_test: "
- "bad id on base component\n"));
- }
-
- return -1;
- }
-
return 0;
}
@@ -1657,7 +1655,7 @@ IDL3_Client::home_inheritance_test (CORBA::ComponentIR::HomeDef_var &hd
}
CORBA::InterfaceDefSeq_var supported =
- hd->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ bhd->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
CORBA::ULong length = supported->length ();
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl
index 9f1c56c3e03..80fb6ba003c 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl
@@ -12,6 +12,7 @@ $status = 0;
$ifr_iorfile= "if_repo.ior";
$test_idl = PerlACE::LocalFile ("test.idl");
+$includes = "-I ../../../.. -I../../../../CIAO/ciao -I../../../../orbsvcs";
# find the tao_ifr executable.
# Its placement is dependent upon the OS and if MPC generated makefiles are used.
@@ -53,7 +54,7 @@ if (PerlACE::waitforfile_timed ($ifr_iorfile, 15) == -1) {
exit 1;
}
-$TAO_IFR->Arguments ("-ORBInitRef InterfaceRepository=file://$ifr_iorfile $test_idl");
+$TAO_IFR->Arguments ("-ORBInitRef InterfaceRepository=file://$ifr_iorfile $includes $test_idl");
$tresult = $TAO_IFR->SpawnWaitKill (30);
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
index be9a95c554d..d24e4b5bd13 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
@@ -1,6 +1,11 @@
// -*- C++ -*-
// $Id$
+#ifndef INTERFACEREPO_IDL3_TEST
+#define INTERFACEREPO_IDL3_TEST
+
+#include <Components.idl>
+
module help
{
exception doh {};
@@ -11,15 +16,15 @@ module help
{
interface c_supp1 {};
interface c_supp2 {};
- component c_base {};
+ component c_base supports c_supp1, c_supp2 {};
valuetype v_base_base {};
valuetype v_base : v_base_base {};
interface v_supp1 {};
abstract interface v_supp2 {};
- home h_base manages c_base {};
valuetype h_key {};
interface h_supp1 {};
interface h_supp2 {};
+ home h_base supports h_supp1, h_supp2 manages c_base {};
};
module help
@@ -34,8 +39,7 @@ module help
module mod
{
- component test_component
- : help::c_base supports help::c_supp1, help::c_supp2
+ component test_component : help::c_base
{
attribute long c_attr1
getraises (help::doh)
@@ -75,7 +79,7 @@ module mod
raises (help::whups, help::doh);
};
- home test_home : help::h_base supports help::h_supp1, help::h_supp2
+ home test_home : help::h_base
manages test_component primarykey help::h_key
{
factory create_tc (in string set_uid)
@@ -110,4 +114,5 @@ module mod
};
+#endif /* INTERFACEREPO_IDL3_TEST */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp
index 49d6ba3361a..2d220f23ad1 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp
@@ -133,7 +133,9 @@ Admin_Client::run (void)
{
for (CORBA::ULong j = 0; j < this->iterations_; ++j)
{
- (this->*test_array_[this->which_test_])(ACE_ENV_SINGLE_ARG_PARAMETER);
+ (this->*test_array_[this->which_test_])(
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
ACE_TRY_CHECK;
}
}
@@ -202,27 +204,33 @@ Admin_Client::parse_args (int argc,
void
Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== ARRAY TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== ARRAY TEST ==============\n\n")
+ ));
+ }
- CORBA::IDLType_var atype = this->repo_->create_string (7
- ACE_ENV_ARG_PARAMETER);
+ CORBA::IDLType_var atype =
+ this->repo_->create_string (7 ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::ArrayDef_var avar = this->repo_->create_array (5,
- atype.in ()
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ArrayDef_var avar =
+ this->repo_->create_array (5,
+ atype.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::ULong bound = avar->length (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ArrayDef::length: %d\n"),
- bound));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::length: %d\n"),
+ bound));
+ }
ACE_ASSERT (bound == 5);
@@ -233,9 +241,11 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ArrayDef::type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_array);
@@ -245,36 +255,44 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ArrayDef::element_type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_string);
- CORBA::IDLType_var tdef = avar->element_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::IDLType_var tdef =
+ avar->element_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::DefinitionKind dk = tdef->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("ArrayDef::element_type_def::def_kind: %d\n"),
- dk
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type_def::def_kind: %d\n"),
+ dk
+ ));
+ }
ACE_ASSERT (dk == CORBA::dk_String);
- CORBA::StringDef_var pvar = CORBA::StringDef::_narrow (tdef.in ()
- ACE_ENV_ARG_PARAMETER);
+ CORBA::StringDef_var pvar =
+ CORBA::StringDef::_narrow (tdef.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
bound = pvar->bound (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StringDef::bound: %d\n"),
- bound));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StringDef::bound: %d\n"),
+ bound));
+ }
ACE_ASSERT (bound == 7);
@@ -287,8 +305,10 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ArrayDef::element_type_def (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type_def (set)\n")));
+ }
tc = avar->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
@@ -296,9 +316,11 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ArrayDef::type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_array);
@@ -308,9 +330,11 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ArrayDef::element_type_def::def_kind: %d\n"),
- dk));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type_def::def_kind: %d\n"),
+ dk));
+ }
ACE_ASSERT (dk == CORBA::dk_Primitive);
@@ -322,9 +346,11 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("PrimitiveDef::kind: %d\n"),
- pkind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("PrimitiveDef::kind: %d\n"),
+ pkind));
+ }
ACE_ASSERT (pkind == CORBA::pk_short);
@@ -335,10 +361,13 @@ Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== ENUM TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== ENUM TEST ==============\n\n")
+ ));
+ }
CORBA::EnumMemberSeq members (4);
members.length (3);
@@ -347,72 +376,87 @@ Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
members[1] = CORBA::string_dup ("ONE");
members[2] = CORBA::string_dup ("TWO");
- CORBA::EnumDef_var evar = this->repo_->create_enum ("IDL:my_enum:1.0",
- "my_enum",
- "1.0",
- members
- ACE_ENV_ARG_PARAMETER);
+ CORBA::EnumDef_var evar =
+ this->repo_->create_enum ("IDL:my_enum:1.0",
+ "my_enum",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::String_var str = evar->id (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::id: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::id: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0") == 0);
str = evar->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_enum") == 0);
str = evar->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_enum") == 0);
str = evar->version (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::version: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::version: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.0") == 0);
- CORBA::DefinitionKind dkind = evar->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::DefinitionKind dkind =
+ evar->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::def_kind: %d\n\n"),
- dkind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::def_kind: %d\n\n"),
+ dkind));
+ }
ACE_ASSERT (dkind == CORBA::dk_Enum);
- CORBA::Contained::Description_var desc = evar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::Contained::Description_var desc =
+ evar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
dkind = desc->kind;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::kind: %d\n"),
- dkind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::kind: %d\n"),
+ dkind));
+ }
ACE_ASSERT (dkind == CORBA::dk_Enum);
@@ -420,40 +464,50 @@ Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
desc->value >>= td;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::name: %s\n"),
- td->name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::name: %s\n"),
+ td->name.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->name, "my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_enum") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::id: %s\n"),
- td->id.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::id: %s\n"),
+ td->id.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->id, "IDL:my_enum:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (td->id, "IDL:my_enum:1.0") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::defined_in: %s\n"),
- td->defined_in.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::defined_in: %s\n"),
+ td->defined_in.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->defined_in, ""));
+ ACE_ASSERT (ACE_OS::strcmp (td->defined_in, "") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::version: %s\n"),
- td->version.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::version: %s\n"),
+ td->version.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->version, "1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (td->version, "1.0") == 0);
CORBA::TCKind kind = td->type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_enum);
@@ -461,48 +515,56 @@ Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::type::id: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::id: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0") == 0);
str = td->type->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::type::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_enum") == 0);
CORBA::ULong count = td->type->member_count ();
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::type::member_count: %d\n\n"),
- count
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::member_count: %d\n\n"),
+ count
+ ));
+ }
ACE_ASSERT (count == 3);
CORBA::ULong i = 0;
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; ++i)
{
str = td->type->member_name (i ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::describe::value::type::")
- ACE_TEXT ("member_name[%d]: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::")
+ ACE_TEXT ("member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), members[i]));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), members[i]) == 0);
}
@@ -517,27 +579,32 @@ Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nEnumDef::members (set)\n\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::members (set)\n\n")));
+ }
- CORBA::EnumMemberSeq_var fellows = evar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::EnumMemberSeq_var fellows =
+ evar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
count = fellows->length ();
const char *tmp = 0;
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; ++i)
{
tmp = fellows[i];
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::")
- ACE_TEXT ("members[%d]: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::")
+ ACE_TEXT ("members[%d]: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (fellows[i], members[i]));
+ ACE_ASSERT (ACE_OS::strcmp (fellows[i], members[i]) == 0);
}
evar->name ("another_enum"
@@ -547,25 +614,31 @@ Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nEnumDef::name (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::name (set)\n")));
+ }
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "another_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "another_enum") == 0);
str = evar->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("EnumDef::absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::another_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::another_enum") == 0);
evar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
@@ -574,15 +647,18 @@ Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== ALIAS TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== ALIAS TEST ==============\n\n")
+ ));
+ }
// This test also tests WstringDef and SequenceDef.
- CORBA::IDLType_var sq_elem = this->repo_->create_wstring (7
- ACE_ENV_ARG_PARAMETER);
+ CORBA::IDLType_var sq_elem =
+ this->repo_->create_wstring (7 ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::SequenceDef_var sq_var =
@@ -603,45 +679,55 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::id: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::id: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "IDL:my_alias:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_alias:1.0") == 0);
str = a_var->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "my_alias"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_alias") == 0);
str = a_var->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_alias"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_alias") == 0);
str = a_var->version (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::version: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::version: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.0") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::version (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::version (set)\n")));
+ }
a_var->version ("1.1"
ACE_ENV_ARG_PARAMETER);
@@ -651,11 +737,13 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::version: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::version: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "1.1"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.1") == 0);
CORBA::TypeCode_var tc = a_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
@@ -664,32 +752,39 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nAliasDef::type::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nAliasDef::type::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "my_alias"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_alias") == 0);
CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_alias);
- CORBA::TypeCode_var ct = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::TypeCode_var ct =
+ tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
kind = ct->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::type::content_type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_sequence);
@@ -697,23 +792,28 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::type::content_type::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 5);
- CORBA::TypeCode_var ct2 = ct->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::TypeCode_var ct2 =
+ ct->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
kind = ct2->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::type::content_type::")
- ACE_TEXT ("content_type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::")
+ ACE_TEXT ("content_type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_wstring);
@@ -721,40 +821,49 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::type::content_type::")
- ACE_TEXT ("content_type::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::")
+ ACE_TEXT ("content_type::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 7);
- CORBA::Contained::Description_var desc = a_var->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::Contained::Description_var desc =
+ a_var->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::TypeDescription *td;
desc->value >>= td;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nAliasDef::describe::value::name: %s\n"),
- td->name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nAliasDef::describe::value::name: %s\n"),
+ td->name.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->name, "my_alias"));
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_alias") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::describe::value::version: %s\n"),
- td->version.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::version: %s\n"),
+ td->version.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->version, "1.1"));
+ ACE_ASSERT (ACE_OS::strcmp (td->version, "1.1") == 0);
kind = td->type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::describe::value::type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_alias);
@@ -762,23 +871,28 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::describe::value::type::id: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::type::id: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "IDL:my_alias:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_alias:1.0") == 0);
str = td->type->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::describe::value::type::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::type::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "my_alias"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_alias") == 0);
- CORBA::IDLType_var i_var = a_var->original_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::IDLType_var i_var =
+ a_var->original_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::SequenceDef_var seq_var =
@@ -790,9 +904,11 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("AliasDef::original_type_def::bound: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::original_type_def::bound: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 5);
@@ -803,10 +919,13 @@ Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::native_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== NATIVE TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== NATIVE TEST ==============\n\n")
+ ));
+ }
CORBA::NativeDef_var nvar =
this->repo_->create_native ("IDL:my_native:1.0",
@@ -819,49 +938,60 @@ Admin_Client::native_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("NativeDef::id: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::id: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "IDL:my_native:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_native:1.0") == 0);
str = nvar->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("NativeDef::name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "my_native"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_native") == 0);
str = nvar->version (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("NativeDef::version: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::version: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.0") == 0);
str = nvar->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("NativeDef::absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_native"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_native") == 0);
- CORBA::DefinitionKind kind = nvar->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::DefinitionKind kind =
+ nvar->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("NativeDef::def_kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::def_kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::dk_Native);
@@ -872,10 +1002,13 @@ Admin_Client::native_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== STRUCT TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== STRUCT TEST ==============\n\n")
+ ));
+ }
CORBA::StructMemberSeq members (3);
members.length (3);
@@ -926,27 +1059,31 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::type::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::type::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
CORBA::String_var str;
CORBA::ULong i = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = tc->member_name (i ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::type::member_name[%d]: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::type::member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), members[i].name));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), members[i].name) == 0);
}
CORBA::Contained::Description_var desc =
@@ -957,25 +1094,31 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
desc->value >>= td;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nStructDef::describe::value::name: %s\n"),
- td->name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::describe::value::name: %s\n"),
+ td->name.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->name, "my_struct"));
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_struct") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::describe::value::id: %s\n"),
- td->id.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::describe::value::id: %s\n"),
+ td->id.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->id, "IDL:my_struct:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (td->id, "IDL:my_struct:1.0") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::describe::value::version: %s\n"),
- td->version.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::describe::value::version: %s\n"),
+ td->version.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->version, "1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (td->version, "1.0") == 0);
members.length (2);
members[0].name = CORBA::string_dup ("long_mem");
@@ -997,8 +1140,10 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nStructDef::members (set)\n\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::members (set)\n\n")));
+ }
CORBA::EnumMemberSeq def_members (2);
def_members.length (2);
@@ -1013,23 +1158,35 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::StructMemberSeq_var out_members = svar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::StructMemberSeq_var out_members =
+ svar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
length = out_members->length ();
+ int cmp_result = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
- i,
- out_members[i].name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+ }
if (i == length - 1)
- ACE_ASSERT (!ACE_OS::strcmp (out_members[i].name, "my_enum"));
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, "my_enum");
+ ACE_ASSERT (cmp_result == 0);
+ }
else
- ACE_ASSERT (!ACE_OS::strcmp (out_members[i].name, members[i].name));
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, members[i].name);
+ ACE_ASSERT (cmp_result == 0);
+ }
}
CORBA::Contained_var fox = this->repo_->lookup ("::my_struct::my_enum"
@@ -1040,11 +1197,13 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::lookup::absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup::absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_struct::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct::my_enum") == 0);
fox = svar->lookup ("my_enum"
ACE_ENV_ARG_PARAMETER);
@@ -1054,40 +1213,48 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::lookup::absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::lookup::absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_struct::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct::my_enum") == 0);
CORBA::Container_var outer = fox->defined_in (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
- CORBA::Contained_var schizo = CORBA::Contained::_narrow (outer.in ()
- ACE_ENV_ARG_PARAMETER);
+ CORBA::Contained_var schizo =
+ CORBA::Contained::_narrow (outer.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
str = schizo->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::lookup::defined_in::")
- ACE_TEXT ("absolute_name: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::lookup::defined_in::")
+ ACE_TEXT ("absolute_name: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_struct"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct") == 0);
- CORBA::ContainedSeq_var contents = this->repo_->contents (CORBA::dk_all,
- 0
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ContainedSeq_var contents =
+ this->repo_->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
@@ -1099,9 +1266,11 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
@@ -1111,16 +1280,18 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
if (i == 0)
{
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_struct::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct::my_enum") == 0);
}
else
{
@@ -1138,24 +1309,28 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::lookup_name::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::lookup_name::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
// Can't use ACE_ASSERT here because we don't know the order
// of the results of the search.
@@ -1171,13 +1346,15 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
length = cont_desc->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::describe_contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::describe_contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
CORBA::TypeDescription *td;
cont_desc[i].value >>= td;
@@ -1186,36 +1363,22 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("Repository::describe_contents[%d]::id: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]::id: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
if (i == 0)
{
- if (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0"))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("struct_test::describe_contents -")
- ACE_TEXT ("incorrect repo id in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0") == 0);
}
else if (i == 1)
{
- if (ACE_OS::strcmp (str.in (), "IDL:my_struct:1.0"))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("struct_test::describe_contents -")
- ACE_TEXT ("incorrect repo id in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_struct:1.0") == 0);
}
}
@@ -1224,8 +1387,10 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nStructDef::name (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::name (set)\n")));
+ }
contents = svar->contents (CORBA::dk_all,
0
@@ -1235,32 +1400,36 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
const char *tmp = "::your_struct";
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
// Whatever the scoped name now is, it must begin
// with "::your_struct".
- ACE_ASSERT (!ACE_OS::strncmp (str.in (),
- tmp,
- ACE_OS::strlen (tmp)));
+ cmp_result =
+ ACE_OS::strncmp (str.in (), tmp, ACE_OS::strlen (tmp));
+ ACE_ASSERT (cmp_result == 0);
}
#if defined (ACE_NDEBUG)
@@ -1277,10 +1446,13 @@ Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== UNION TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== UNION TEST ==============\n\n")
+ ));
+ }
CORBA::EnumMemberSeq d_members (4);
d_members.length (4);
@@ -1301,8 +1473,9 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
CORBA::StructMemberSeq s_members (1);
s_members.length (1);
s_members[0].name = CORBA::string_dup ("string_in_struct");
- s_members[0].type_def = this->repo_->create_string (6
- ACE_ENV_ARG_PARAMETER);
+ s_members[0].type_def =
+ this->repo_->create_string (6
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
s_members[0].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
@@ -1318,8 +1491,9 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
u_members.length (4);
u_members[0].name = CORBA::string_dup ("longval");
- u_members[0].type_def = this->repo_->get_primitive (CORBA::pk_long
- ACE_ENV_ARG_PARAMETER);
+ u_members[0].type_def =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
u_members[0].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
CORBA::TypeCode_var d_type = d_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -1336,8 +1510,9 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
u_members[0].label = any2;
u_members[1].name = CORBA::string_dup ("longval");
- u_members[1].type_def = this->repo_->get_primitive (CORBA::pk_long
- ACE_ENV_ARG_PARAMETER);
+ u_members[1].type_def =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
u_members[1].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
TAO_OutputCDR maker0;
@@ -1367,8 +1542,9 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
u_members[2].label = any1;
u_members[3].name = CORBA::string_dup ("stringval");
- u_members[3].type_def = this->repo_->create_string (17
- ACE_ENV_ARG_PARAMETER);
+ u_members[3].type_def =
+ this->repo_->create_string (17
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
u_members[3].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
u_members[3].label <<= CORBA::Any::from_octet (0); // default case (ONE)
@@ -1382,18 +1558,22 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::TypeCode_var disc_tc = u_var->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::TypeCode_var disc_tc =
+ u_var->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
- CORBA::ULong length = disc_tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::ULong length =
+ disc_tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("UnionDef::discriminator_type::member_count: %d\n"),
- length
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("UnionDef::discriminator_type::member_count: %d\n"),
+ length
+ ));
+ }
ACE_ASSERT (length == 4);
@@ -1404,9 +1584,11 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::type::member_count: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::member_count: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
@@ -1414,29 +1596,33 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::type::default_index: %d\n\n"),
- slot));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::default_index: %d\n\n"),
+ slot));
+ }
ACE_ASSERT (slot == 2);
CORBA::String_var str;
const char *tmp = 0;
- for (CORBA::ULong i = 0; i < length; i++)
+ for (CORBA::ULong i = 0; i < length; ++i)
{
str = tc->member_name (i
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::type::member_name[%d]: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
// Multiple labels for first member shifts index by 1.
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), u_members[i + 1].name));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), u_members[i + 1].name) == 0);
CORBA::Any_var label = tc->member_label (i
ACE_ENV_ARG_PARAMETER);
@@ -1454,23 +1640,25 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
}
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::type::member_label[%d]: %s\n"),
- i,
- i == (CORBA::ULong) slot ? "default" : tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::member_label[%d]: %s\n"),
+ i,
+ i == (CORBA::ULong) slot ? "default" : tmp));
+ }
// Labels are not in order.
switch (i)
- {
- case 0:
- ACE_ASSERT (val == 3 || val == 2);
- break;
- case 1:
- ACE_ASSERT (val == 0);
- break;
- default:
- break;
- }
+ {
+ case 0:
+ ACE_ASSERT (val == 3 || val == 2);
+ break;
+ case 1:
+ ACE_ASSERT (val == 0);
+ break;
+ default:
+ break;
+ }
}
u_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -1484,10 +1672,13 @@ Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== EXCEPTION TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== EXCEPTION TEST ==============\n\n")
+ ));
+ }
CORBA::StructMemberSeq members (3);
members.length (3);
@@ -1496,7 +1687,8 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
members[0].type_def = this->repo_->get_primitive (CORBA::pk_string
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- members[0].type = members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ members[0].type =
+ members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
members[1].name = CORBA::string_dup ("bd_string");
@@ -1513,16 +1705,18 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
e_members[1] = CORBA::string_dup ("ONE");
members[2].name = CORBA::string_dup ("my_exception_enum");
- CORBA::EnumDef_var e_var = this->repo_->create_enum ("IDL:my_enum:1.0",
- "my_enum",
- "1.0",
- e_members
- ACE_ENV_ARG_PARAMETER);
+ CORBA::EnumDef_var e_var =
+ this->repo_->create_enum ("IDL:my_enum:1.0",
+ "my_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
members[2].type_def = CORBA::EnumDef::_duplicate (e_var.in ());
- members[2].type = members[2].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ members[2].type =
+ members[2].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::ExceptionDef_var exvar =
@@ -1540,69 +1734,83 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::type::member_count: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::type::member_count: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
CORBA::String_var str;
CORBA::ULong i = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = tc->member_name (i ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::type::member_name[%d]: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::type::member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), members[i].name));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), members[i].name) == 0);
}
- CORBA::Contained::Description_var desc = exvar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::Contained::Description_var desc =
+ exvar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::ExceptionDescription *ed;
desc->value >>= ed;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nExceptionDef::describe::value::name: %s\n"),
- ed->name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nExceptionDef::describe::value::name: %s\n"),
+ ed->name.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (ed->name, "my_exception"));
+ ACE_ASSERT (ACE_OS::strcmp (ed->name, "my_exception") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::describe::value::id: %s\n"),
- ed->id.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::describe::value::id: %s\n"),
+ ed->id.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (ed->id, "IDL:my_exception:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (ed->id, "IDL:my_exception:1.0") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::describe::value::defined_in: %s\n"),
- ed->defined_in.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::describe::value::defined_in: %s\n"),
+ ed->defined_in.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (ed->defined_in, ""));
+ ACE_ASSERT (ACE_OS::strcmp (ed->defined_in, "") == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::describe::value::version: %s\n"),
- ed->version.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::describe::value::version: %s\n"),
+ ed->version.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (ed->version, "1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (ed->version, "1.0") == 0);
members.length (2);
members[0].name = CORBA::string_dup ("long_mem");
members[0].type_def = this->repo_->get_primitive (CORBA::pk_long
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- members[0].type = members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ members[0].type =
+ members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
members[1].name = CORBA::string_dup ("array_mem");
@@ -1612,7 +1820,8 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
members[1].type_def = a_ptr;
- members[1].type = members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ members[1].type =
+ members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
exvar->members (members
@@ -1620,8 +1829,10 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nExceptionDef::members (set)\n\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nExceptionDef::members (set)\n\n")));
+ }
CORBA::EnumMemberSeq def_members (2);
def_members.length (2);
@@ -1636,11 +1847,14 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::StructMemberSeq_var out_members = exvar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::StructMemberSeq_var out_members =
+ exvar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
+
length = out_members->length ();
+ int cmp_result = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
if (this->debug_)
ACE_DEBUG ((LM_DEBUG,
@@ -1649,34 +1863,54 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
out_members[i].name.in ()));
if (i == 2)
- ACE_ASSERT (!ACE_OS::strcmp (out_members[i].name, "my_enum"));
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, "my_enum");
+ ACE_ASSERT (cmp_result == 0);
+ }
else
- ACE_ASSERT (!ACE_OS::strcmp (out_members[i].name, members[i].name));
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, members[i].name);
+ ACE_ASSERT (cmp_result == 0);
+ }
}
a_ptr->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nArrayDef::destroy\n\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nArrayDef::destroy\n\n")));
+ }
out_members = exvar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
length = out_members->length ();
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::members[%d]::name: %s\n"),
- i,
- out_members[i].name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+ }
if (i == 1)
- ACE_ASSERT (!ACE_OS::strcmp (out_members[i].name, "my_enum"));
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, "my_enum");
+ ACE_ASSERT (cmp_result == 0);
+ }
else
- ACE_ASSERT (!ACE_OS::strcmp (out_members[i].name, members[i].name));
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, members[i].name);
+ ACE_ASSERT (cmp_result == 0);
+ }
}
CORBA::Contained_var fox = this->repo_->lookup ("::my_exception::my_enum"
@@ -1687,11 +1921,13 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::lookup: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::lookup: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_exception::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_exception::my_enum") == 0);
fox = exvar->lookup ("my_enum"
ACE_ENV_ARG_PARAMETER);
@@ -1701,23 +1937,28 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::lookup: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::lookup: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_exception::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_exception::my_enum") == 0);
- CORBA::ContainedSeq_var contents = this->repo_->contents (CORBA::dk_all,
- 0
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ContainedSeq_var contents =
+ this->repo_->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
@@ -1729,27 +1970,31 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ExceptionDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("ExceptionDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
// Should be only the one member.
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::my_exception::my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_exception::my_enum") == 0);
}
contents = this->repo_->lookup_name ("my_enum",
@@ -1762,24 +2007,28 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::lookup_name::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::lookup_name::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
// Can't use ACE_ASSERT here - order of search results is unknown.
}
@@ -1794,16 +2043,20 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
length = cont_desc->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::describe_contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::describe_contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
CORBA::TypeDescription *td;
- for (i = 0; i < length; i++)
+
+ for (i = 0; i < length; ++i)
{
CORBA::DefinitionKind kind = cont_desc[i].kind;
+
if (kind == CORBA::dk_Exception)
{
cont_desc[i].value >>= ed;
@@ -1813,22 +2066,26 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::describe_contents[%d]")
- ACE_TEXT ("::value::type::member_count: %d\n"),
- i,
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::type::member_count: %d\n"),
+ i,
+ length));
+ }
ACE_ASSERT (length == 2);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::describe_contents[%d]")
- ACE_TEXT ("::value::name: %s\n"),
- i,
- ed->name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::name: %s\n"),
+ i,
+ ed->name.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (ed->name, "my_exception"));
+ ACE_ASSERT (ACE_OS::strcmp (ed->name, "my_exception") == 0);
}
else
{
@@ -1839,22 +2096,26 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::describe_contents[%d]")
- ACE_TEXT ("::value::type::member_count: %d\n"),
- i,
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::type::member_count: %d\n"),
+ i,
+ length));
+ }
ACE_ASSERT (length == 2);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::describe_contents[%d]")
- ACE_TEXT ("::value::name: %s\n"),
- i,
- td->name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::name: %s\n"),
+ i,
+ td->name.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (td->name, "my_enum"));
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_enum") == 0);
}
}
@@ -1863,8 +2124,10 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nExceptionDef::name (set)\n\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nExceptionDef::name (set)\n\n")));
+ }
contents = exvar->contents (CORBA::dk_all,
0
@@ -1874,20 +2137,22 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
const char *tmp = "::your_exception";
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("ExceptionDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
- ACE_ASSERT (!ACE_OS::strncmp (str.in (), tmp, ACE_OS::strlen (tmp)));
+ ACE_ASSERT (ACE_OS::strncmp (str.in (), tmp, ACE_OS::strlen (tmp)) == 0);
}
#if defined (ACE_NDEBUG)
@@ -1904,13 +2169,17 @@ Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== CONSTANT TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== CONSTANT TEST ==============\n\n")
+ ));
+ }
- CORBA::IDLType_var ivar = this->repo_->get_primitive (CORBA::pk_string
- ACE_ENV_ARG_PARAMETER);
+ CORBA::IDLType_var ivar =
+ this->repo_->get_primitive (CORBA::pk_string
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::Any any;
@@ -1932,21 +2201,27 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ConstantDef::type::kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::type::kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_string);
- CORBA::IDLType_var tdef = cvar->type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::IDLType_var tdef =
+ cvar->type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
- CORBA::DefinitionKind def_kind = tdef->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::DefinitionKind def_kind =
+ tdef->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ConstantDef::type_def::def_kind: %d\n"),
- def_kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::type_def::def_kind: %d\n"),
+ def_kind));
+ }
ACE_ASSERT (def_kind == CORBA::dk_Primitive);
@@ -1958,11 +2233,13 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
out_any >>= out_s;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ConstantDef::value (string): %s\n"),
- out_s));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (string): %s\n"),
+ out_s));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (out_s, s));
+ ACE_ASSERT (ACE_OS::strcmp (out_s, s) == 0);
ivar = this->repo_->get_primitive (CORBA::pk_double
ACE_ENV_ARG_PARAMETER);
@@ -1978,9 +2255,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nConstantDef::type_def (set)\n")
- ACE_TEXT ("ConstantDef::value (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
out_any = cvar->value (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
@@ -1989,9 +2268,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
out_any >>= out_double_val;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ConstantDef::value (double): %.5f\n"),
- out_double_val));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (double): %.5f\n"),
+ out_double_val));
+ }
ACE_ASSERT (out_double_val == double_val);
@@ -2001,9 +2282,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nConstantDef::type_def (set)\n")
- ACE_TEXT ("ConstantDef::value (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
CORBA::Short short_val = -65;
any <<= short_val;
@@ -2018,9 +2301,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
out_any >>= out_short_val;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ConstantDef::value (short): %hd\n"),
- out_short_val));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (short): %hd\n"),
+ out_short_val));
+ }
ACE_ASSERT (out_short_val == short_val);
@@ -2032,9 +2317,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nConstantDef::type_def (set)\n")
- ACE_TEXT ("ConstantDef::value (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
CORBA::Float float_val = 2.33f;
any <<= float_val;
@@ -2049,9 +2336,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
out_any >>= out_float_val;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ConstantDef::value (float): %.2f\n"),
- out_float_val));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (float): %.2f\n"),
+ out_float_val));
+ }
ACE_ASSERT (out_float_val == float_val);
@@ -2063,9 +2352,11 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nConstantDef::type_def (set)\n")
- ACE_TEXT ("ConstantDef::value (set)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
CORBA::ULongLong ull_val = 1234567890;
any <<= ull_val;
@@ -2101,10 +2392,13 @@ Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== INTERFACE TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== INTERFACE TEST ==============\n\n")
+ ));
+ }
CORBA::ULong i, length;
@@ -2144,8 +2438,8 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::StringDef_var p_string = this->repo_->create_string (5
- ACE_ENV_ARG_PARAMETER);
+ CORBA::StringDef_var p_string =
+ this->repo_->create_string (5 ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::AttributeDef_var p_attr =
@@ -2208,63 +2502,74 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::Contained::Description_var desc = p_op->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::Contained::Description_var desc =
+ p_op->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::OperationDescription *od;
desc->value >>= od;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("OperationDef::describe::value::")
- ACE_TEXT ("defined_in: %s\n"),
- od->defined_in.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::value::")
+ ACE_TEXT ("defined_in: %s\n"),
+ od->defined_in.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (od->defined_in, "IDL:p_iface:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (od->defined_in, "IDL:p_iface:1.0") == 0);
CORBA::TypeCode_var result = od->result;
CORBA::TCKind kind = result->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("OperationDef::describe::result::")
- ACE_TEXT ("kind: %d\n"),
- kind));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::result::")
+ ACE_TEXT ("kind: %d\n"),
+ kind));
+ }
ACE_ASSERT (kind == CORBA::tk_long);
length = od->parameters.length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nOperationDef::describe::parameters::")
- ACE_TEXT ("length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nOperationDef::describe::parameters::")
+ ACE_TEXT ("length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
const char *tmp = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
tmp = od->parameters[i].name;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("OperationDef::describe::parameters[%d]::")
- ACE_TEXT ("name: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::parameters[%d]::")
+ ACE_TEXT ("name: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, names[i]));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, names[i]) == 0);
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("OperationDef::describe::parameters[%d]::")
- ACE_TEXT ("mode: %d\n"),
- i,
- od->parameters[i].mode));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::parameters[%d]::")
+ ACE_TEXT ("mode: %d\n"),
+ i,
+ od->parameters[i].mode));
+ }
ACE_ASSERT (od->parameters[i].mode == modes[i]);
}
@@ -2274,9 +2579,11 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::is_a (same class): %hd\n"),
- is_it));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::is_a (same class): %hd\n"),
+ is_it));
+ }
ACE_ASSERT (is_it == 1);
@@ -2285,9 +2592,11 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::is_a (base class): %hd\n"),
- is_it));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::is_a (base class): %hd\n"),
+ is_it));
+ }
ACE_ASSERT (is_it == 1);
@@ -2296,9 +2605,11 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::is_a (derived class): %hd\n"),
- is_it));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::is_a (derived class): %hd\n"),
+ is_it));
+ }
ACE_ASSERT (is_it == 0);
@@ -2310,80 +2621,94 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::describe_interface::")
- ACE_TEXT ("type::id: %s\n"),
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("type::id: %s\n"),
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "IDL:p_iface:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:p_iface:1.0") == 0);
length = fifd->operations.length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::describe_interface::")
- ACE_TEXT ("operations::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("operations::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
length = fifd->operations[0].contexts.length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::describe_interface::")
- ACE_TEXT ("operations[3]::contexts::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("operations[3]::contexts::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
tmp = fifd->operations[0].contexts[i];
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::describe_interface::")
- ACE_TEXT ("operations[0]::contexts[%d]: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::describe_interface::")
+ ACE_TEXT ("operations[0]::contexts[%d]: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, contexts[i]));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, contexts[i]) == 0);
}
length = fifd->operations[0].exceptions.length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::describe_interface::")
- ACE_TEXT ("operations[0]::exceptions::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("operations[0]::exceptions::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
const char *tmp = fifd->operations[0].exceptions[i].name;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::describe::operations[3]::")
- ACE_TEXT ("contexts[%d]: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::describe::operations[3]::")
+ ACE_TEXT ("contexts[%d]: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, "if_exception"));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, "if_exception") == 0);
}
tmp = fifd->attributes[0].defined_in;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::describe_interface::")
- ACE_TEXT ("attributes::defined_in: %s\n"),
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("attributes::defined_in: %s\n"),
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, "IDL:gp_iface:1.0"));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, "IDL:gp_iface:1.0") == 0);
in_bases[0] = CORBA::InterfaceDef::_duplicate (p_ivar.in ());
@@ -2404,25 +2729,29 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
length = ifd->base_interfaces.length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::describe::")
- ACE_TEXT ("base_interfaces::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe::")
+ ACE_TEXT ("base_interfaces::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
const char *base_iface_id = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
base_iface_id = ifd->base_interfaces[i].in ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::describe::")
- ACE_TEXT ("base_interfaces[%d]: %s\n"),
- i,
- base_iface_id));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::describe::")
+ ACE_TEXT ("base_interfaces[%d]: %s\n"),
+ i,
+ base_iface_id));
+ }
}
CORBA::InterfaceDefSeq_var out_bases =
@@ -2432,24 +2761,28 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_bases->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::base_interfaces::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::base_interfaces::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = out_bases[i]->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("InterfaceDef::base_interfaces[%d]::name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::base_interfaces[%d]::name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
}
CORBA::ContainedSeq_var contents = ivar->contents (CORBA::dk_all,
@@ -2460,42 +2793,50 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = contents[i]->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::contents[%d]::name: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::contents[%d]::name: %s\n"),
+ i,
+ str.in ()));
+ }
- CORBA::Container_var cr = contents[i]->defined_in (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::Container_var cr =
+ contents[i]->defined_in (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
- CORBA::Contained_var cd = CORBA::Contained::_narrow (cr.in ()
- ACE_ENV_ARG_PARAMETER);
+ CORBA::Contained_var cd =
+ CORBA::Contained::_narrow (cr.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
str = cd->name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("InterfaceDef::contents[%d]::")
- ACE_TEXT ("defined_in::name: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::contents[%d]::")
+ ACE_TEXT ("defined_in::name: %s\n"),
+ i,
+ str.in ()));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "p_iface")
- || !ACE_OS::strcmp (str.in (), "gp_iface"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "p_iface") == 0
+ || ACE_OS::strcmp (str.in (), "gp_iface") == 0);
}
ex_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -2511,10 +2852,13 @@ Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== MOVE TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== MOVE TEST ==============\n\n")
+ ));
+ }
CORBA::EnumMemberSeq e_members (2);
e_members.length (2);
@@ -2522,21 +2866,23 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
e_members[0] = CORBA::string_dup ("ZERO");
e_members[1] = CORBA::string_dup ("ONE");
- CORBA::EnumDef_var e_var = this->repo_->create_enum ("IDL:o_enum:1.0",
- "o_enum",
- "1.0",
- e_members
- ACE_ENV_ARG_PARAMETER);
+ CORBA::EnumDef_var e_var =
+ this->repo_->create_enum ("IDL:o_enum:1.0",
+ "o_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
e_members[0] = CORBA::string_dup ("TEN");
e_members[1] = CORBA::string_dup ("ELEVEN");
- CORBA::EnumDef_var e_var2 = this->repo_->create_enum ("IDL:i_enum:1.0",
- "i_enum",
- "1.0",
- e_members
- ACE_ENV_ARG_PARAMETER);
+ CORBA::EnumDef_var e_var2 =
+ this->repo_->create_enum ("IDL:i_enum:1.0",
+ "i_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::StructMemberSeq s_members (2);
@@ -2545,15 +2891,18 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
const char *s_names[] = {"s_string", "s_enum"};
s_members[0].name = s_names[0];
- s_members[0].type_def = this->repo_->get_primitive (CORBA::pk_string
- ACE_ENV_ARG_PARAMETER);
+ s_members[0].type_def =
+ this->repo_->get_primitive (CORBA::pk_string
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- s_members[0].type = s_members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ s_members[0].type =
+ s_members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
s_members[1].name = s_names[1];
s_members[1].type_def = CORBA::EnumDef::_duplicate (e_var2.in ());
- s_members[1].type = s_members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ s_members[1].type =
+ s_members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::StructDef_var s_var =
@@ -2600,45 +2949,53 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::UnionMemberSeq_var out_u_members = u_var->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::UnionMemberSeq_var out_u_members =
+ u_var->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::ULong length = out_u_members->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::members::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
CORBA::ULong i = 0;
const char *tmp = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
tmp = out_u_members[i].name;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, u_members[i].name));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, u_members[i].name) == 0);
}
- CORBA::ContainedSeq_var out_contents = u_var->contents (CORBA::dk_all,
- 1
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ContainedSeq_var out_contents =
+ u_var->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
length = out_contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 0);
@@ -2649,8 +3006,10 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nEnumDef::move (into union)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::move (into union)\n")));
+ }
out_u_members = u_var->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
@@ -2658,45 +3017,33 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_u_members->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nUnionDef::members::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::members::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
tmp = out_u_members[i].name;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
if (i == 0)
{
- if (ACE_OS::strcmp (tmp, "u_enum"))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("move_test::name -")
- ACE_TEXT ("incorrect name in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (tmp, "u_enum") == 0);
}
else
{
- if (ACE_OS::strcmp (tmp, u_members[i].name))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("move_test::name -")
- ACE_TEXT ("incorrect name in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (tmp, u_members[i].name) == 0);
}
}
@@ -2708,36 +3055,34 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
CORBA::String_var str;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = out_contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("UnionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
if (i == 0)
{
- if (ACE_OS::strcmp (str.in (), "::the_union::u_enum"))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("move_test::contents -")
- ACE_TEXT ("incorrect scoped name in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::the_union::u_enum") == 0);
}
}
@@ -2754,9 +3099,11 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nEnumDef::move (into struct)\n")
- ACE_TEXT ("StructDef::move (into union)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::move (into struct)\n")
+ ACE_TEXT ("StructDef::move (into union)\n")));
+ }
out_contents = this->repo_->contents (CORBA::dk_all,
1
@@ -2766,9 +3113,11 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nRepository::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
@@ -2778,23 +3127,27 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_u_members->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nUnionDef::members::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::members::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
tmp = out_u_members[i].name;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, u_names[i]));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, u_names[i]) == 0);
}
out_contents = u_var->contents (CORBA::dk_all,
@@ -2805,28 +3158,35 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
ACE_CString scoped ("::the_union::");
CORBA::StructDef_var s_tmp;
+ int cmp_result = 0;
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = out_contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("UnionDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ cmp_result =
+ ACE_OS::strcmp (str.in (), (scoped + u_names[i]).c_str ());
- ACE_ASSERT (!ACE_OS::strcmp (str.in (),
- (scoped + u_names[i]).c_str ()));
+ ACE_ASSERT (cmp_result == 0);
if (i == 1)
{
@@ -2844,28 +3204,33 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
length = out_contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nStructDef::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
const char *base = "::the_union::u_struct";
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = out_contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
- i,
- str.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ cmp_result =
+ ACE_OS::strncmp (str.in (), base, ACE_OS::strlen (base));
- ACE_ASSERT (!ACE_OS::strncmp (str.in (),
- base,
- ACE_OS::strlen (base)));
+ ACE_ASSERT (cmp_result == 0);
}
#if defined (ACE_NDEBUG)
@@ -2873,29 +3238,34 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_UNUSED_ARG (base);
#endif /* ACE_NDEBUG */
- CORBA::StructMemberSeq_var out_s_members = s_tmp->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::StructMemberSeq_var out_s_members =
+ s_tmp->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
length = out_s_members->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nStructDef::members::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::members::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 2);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
tmp = out_s_members[i].name;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
- i,
- tmp));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (tmp, s_names[i]));
+ ACE_ASSERT (ACE_OS::strcmp (tmp, s_names[i]) == 0);
}
u_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
@@ -2905,27 +3275,33 @@ Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
void
Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== MODULE TEST ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== MODULE TEST ==============\n\n")
+ ));
+ }
- CORBA::ModuleDef_var outer = this->repo_->create_module ("IDL:outer:1.0",
- "outer",
- "1.0"
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ModuleDef_var outer =
+ this->repo_->create_module ("IDL:outer:1.0",
+ "outer",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::ModuleDef_var middle = outer->create_module ("IDL:outer/middle:1.0",
- "middle",
- "1.0"
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ModuleDef_var middle =
+ outer->create_module ("IDL:outer/middle:1.0",
+ "middle",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- CORBA::ModuleDef_var inner = middle->create_module ("IDL:outer/middle/inner:1.0",
- "inner",
- "1.0"
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ModuleDef_var inner =
+ middle->create_module ("IDL:outer/middle/inner:1.0",
+ "inner",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::InterfaceDefSeq in_bases (1);
@@ -3029,14 +3405,18 @@ Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("ModuleDef::lookup (absolute)::absolute_name: %s\n"),
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ModuleDef::lookup (absolute)::absolute_name: %s\n"),
+ str.in ()
+ ));
+ }
+
+ int cmp_result =
+ ACE_OS::strcmp (str.in (), "::outer::middle::inner::iface::op");
- ACE_ASSERT (!ACE_OS::strcmp (str.in (),
- "::outer::middle::inner::iface::op"));
+ ACE_ASSERT (cmp_result == 0);
result = middle->lookup ("inner::iface::op"
ACE_ENV_ARG_PARAMETER);
@@ -3046,46 +3426,57 @@ Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("ModuleDef::lookup (relative)::absolute_name: %s\n"),
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ModuleDef::lookup (relative)::absolute_name: %s\n"),
+ str.in ()
+ ));
+ }
+
+ cmp_result =
+ ACE_OS::strcmp (str.in (), "::outer::middle::inner::iface::op");
- ACE_ASSERT (!ACE_OS::strcmp (str.in (),
- "::outer::middle::inner::iface::op"));
+ ACE_ASSERT (cmp_result == 0);
- CORBA::ContainedSeq_var cseq = this->repo_->lookup_name ("op",
- -1,
- CORBA::dk_all,
- 0
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ContainedSeq_var cseq =
+ this->repo_->lookup_name ("op",
+ -1,
+ CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
length = cseq->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = cseq[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ cmp_result =
+ ACE_OS::strcmp (str.in (), "::outer::middle::inner::iface::op");
- ACE_ASSERT (!ACE_OS::strcmp (str.in (),
- "::outer::middle::inner::iface::op"));
+ ACE_ASSERT (cmp_result == 0);
}
cseq = middle->lookup_name ("attr",
@@ -3098,26 +3489,30 @@ Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
length = cseq->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = cseq[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::outer::p_iface::attr"));
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::outer::p_iface::attr") == 0);
}
iface->move (outer.in (),
@@ -3127,8 +3522,10 @@ Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nInterfaceDef::move (into outer module)\n")));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::move (into outer module)\n")));
+ }
cseq = this->repo_->lookup_name ("op",
-1,
@@ -3140,26 +3537,30 @@ Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
length = cseq->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
str = cseq[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
if (this->debug_)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
- i,
- str.in ()
- ));
-
- ACE_ASSERT (!ACE_OS::strcmp (str.in (), "::outer::iface::op"));
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::outer::iface::op") == 0);
}
ex_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp
index f03dc8416aa..aa3af160455 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp
@@ -3,22 +3,21 @@
#include "Admin_Client.h"
-ACE_RCSID(IFR_Test, client, "$Id$")
+ACE_RCSID (IFR_Test,
+ client,
+ "$Id$")
int main (int argc, char *argv[])
{
Admin_Client admin_client;
- ACE_DEBUG ((LM_DEBUG,
- "\n\t IFR_Test \n\n"));
-
int retval = admin_client.init (argc,
argv);
if (retval == -1)
- return 1;
-
- retval = admin_client.run ();
+ {
+ return 1;
+ }
- return retval;
+ return admin_client.run ();
}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
index 34a43bae08e..c29daa4ff2a 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
@@ -14,7 +14,7 @@ ACE_RCSID (Latency_Test,
const CORBA::ULong DEFAULT_NUMCALLS = 20000;
Latency_Query_Client::Latency_Query_Client (void)
- : debug_ (0),
+ : debug_ (false),
do_dump_history_ (0),
iterations_ (DEFAULT_NUMCALLS)
{
@@ -107,15 +107,6 @@ Latency_Query_Client::run (void)
{
return -1;
}
-/*
- dk = this->tdef_->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (dk != CORBA::dk_Alias)
- {
- return -1;
- }
-*/
}
ACE_Sample_History history (this->iterations_);
@@ -126,7 +117,6 @@ Latency_Query_Client::run (void)
ACE_hrtime_t start = ACE_OS::gethrtime ();
am = this->attr_->mode (ACE_ENV_SINGLE_ARG_PARAMETER);
-// dk = this->tdef_->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_hrtime_t now = ACE_OS::gethrtime ();
@@ -135,28 +125,30 @@ Latency_Query_Client::run (void)
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
- ACE_DEBUG ((LM_DEBUG,
- "test finished\n"));
- ACE_DEBUG ((LM_DEBUG,
- "High resolution timer calibration...."));
- ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
- ACE_DEBUG ((LM_DEBUG,
- "done\n"));
-
- if (this->do_dump_history_)
+ if (this->debug_)
{
- history.dump_samples ("HISTORY", gsf);
- }
-
- ACE_Basic_Stats stats;
- history.collect_basic_stats (stats);
- stats.dump_results ("Total", gsf);
+ ACE_DEBUG ((LM_DEBUG,
+ "test finished\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "High resolution timer calibration...."));
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG,
+ "done\n"));
+
+ if (this->do_dump_history_)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
- ACE_Throughput_Stats::dump_throughput ("Total",
- gsf,
- test_end - test_start,
- stats.samples_count ());
+ ACE_Basic_Stats stats;
+ history.collect_basic_stats (stats);
+ stats.dump_results ("Total", gsf);
+ ACE_Throughput_Stats::dump_throughput ("Total",
+ gsf,
+ test_end - test_start,
+ stats.samples_count ());
+ }
}
ACE_CATCHANY
{
@@ -178,33 +170,35 @@ Latency_Query_Client::parse_args (int argc,
int result = 0;
while ((c = opts ()) != -1)
- switch (c)
- {
- case 'd':
- this->debug_ = 1;
- break;
- case 'h':
- this->do_dump_history_ = 1;
- break;
- case 'i':
- result = ACE_OS::atoi (opts.opt_arg ());
-
- if (result > 0)
- {
- this->iterations_ = result;
- }
-
- break;
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s"
- " [-d]"
- " [-i iterations]"
- "\n",
- argv [0]),
- -1);
- }
+ {
+ switch (c)
+ {
+ case 'd':
+ this->debug_ = true;
+ break;
+ case 'h':
+ this->do_dump_history_ = true;
+ break;
+ case 'i':
+ result = ACE_OS::atoi (opts.opt_arg ());
+
+ if (result > 0)
+ {
+ this->iterations_ = result;
+ }
+
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-i iterations]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ }
return 0;
}
@@ -257,57 +251,7 @@ Latency_Query_Client::populate_ifr (ACE_ENV_SINGLE_ARG_DECL)
CORBA::ATTR_NORMAL
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
-/*
- CORBA::Contained_var irobj = this->repo_->lookup_id ("IDL:longtype:1.0"
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
-
- if (! CORBA::is_nil (irobj.in ()))
- {
- this->tdef_ = CORBA::AliasDef::_narrow (irobj.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
-
- if (CORBA::is_nil (this->tdef_.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Latency_Query_Client::populate_ifr - "
- "AliasDef::_narrow returned null\n"),
- -1);
- }
-
- return 0;
- }
-
- CORBA::PrimitiveDef_var longdef =
- this->repo_->get_primitive (CORBA::pk_long
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
- if (CORBA::is_nil (longdef.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Latency_Query_Client::populate_ifr - "
- "get_primitive returned null\n"),
- -1);
- }
-
- this->tdef_ =
- this->repo_->create_alias ("IDL:longtype:1.0",
- "longtype",
- "1.0",
- longdef.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
-
- if (CORBA::is_nil (this->tdef_.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Latency_Query_Client::populate_ifr - "
- "create_alias returned null\n"),
- -1);
- }
-*/
return 0;
}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h
index 589dc476a3a..fa223454637 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h
@@ -52,10 +52,10 @@ private:
// Put in something to query about.
private:
- CORBA::Boolean debug_;
+ bool debug_;
// Toggle debugging output.
- CORBA::Boolean do_dump_history_;
+ bool do_dump_history_;
// Toggle saving of dump history.
CORBA::ULong iterations_;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp
index b718a900b2e..43c9155ebb1 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp
@@ -12,9 +12,6 @@ main (int argc, char *argv[])
{
Latency_Query_Client client;
- ACE_DEBUG ((LM_DEBUG,
- "\n\t IFR Latency Test \n\n"));
-
int retval = client.init (argc,
argv);
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp
index 11073e423e1..10146a9a882 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp
@@ -134,10 +134,13 @@ Ptest::parse_args (int argc,
void
Ptest::populate (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== POPULATE ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== POPULATE ==============\n\n")
+ ));
+ }
CORBA::StructMemberSeq members (2);
members.length (2);
@@ -181,10 +184,13 @@ Ptest::populate (ACE_ENV_SINGLE_ARG_DECL)
void
Ptest::query (ACE_ENV_SINGLE_ARG_DECL)
{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("\n============== QUERY ==============\n\n")
- ));
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== QUERY ==============\n\n")
+ ));
+ }
const char *members[] =
{
@@ -193,71 +199,64 @@ Ptest::query (ACE_ENV_SINGLE_ARG_DECL)
"my_enum"
};
- CORBA::ContainedSeq_var contents = this->repo_->contents (CORBA::dk_all,
- 0
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ContainedSeq_var contents =
+ this->repo_->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::ULong length = contents->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Repository::contents::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::contents::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 1);
CORBA::ULong i = 0;
- CORBA::StructDef_var svar = CORBA::StructDef::_narrow (contents[i]
- ACE_ENV_ARG_PARAMETER);
+ CORBA::StructDef_var svar =
+ CORBA::StructDef::_narrow (contents[i]
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
ACE_ASSERT (!CORBA::is_nil (svar.in ()));
- CORBA::StructMemberSeq_var out_members = svar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::StructMemberSeq_var out_members =
+ svar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
length = out_members->length ();
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\nStructDef::members::length: %d\n"),
- length));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::members::length: %d\n"),
+ length));
+ }
ACE_ASSERT (length == 3);
- for (i = 0; i < length; i++)
+ for (i = 0; i < length; ++i)
{
if (this->debug_)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
- i,
- out_members[i].name.in ()));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+ }
if (i == length - 1)
{
- if (ACE_OS::strcmp (out_members[i].name, "my_enum"))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("persistence_test::query::members -")
- ACE_TEXT ("incorrect local name in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (out_members[i].name, "my_enum") == 0);
}
else
{
- if (ACE_OS::strcmp (out_members[i].name, members[i]))
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("persistence_test::query::members -")
- ACE_TEXT ("incorrect local name in item %d"),
- i));
-
- return;
- }
+ ACE_ASSERT (ACE_OS::strcmp (out_members[i].name, members[i]) == 0);
}
}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
index bb842b99d0a..8ded8407764 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
@@ -33,8 +33,6 @@ for ($i = 0; $i <= $#ARGV; $i++) {
unlink $iorfile;
unlink $backing_file;
-print STDERR "\t IFR Persistence Test\n\n";
-
$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " -o $iorfile" . " $persistent");
$T = new PerlACE::Process ("Persistence_Test");
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp
index 27aa6d31b2a..2155c1c4c36 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp
@@ -3,7 +3,9 @@
#include "Ptest.h"
-ACE_RCSID(Persistence_Test, test, "$Id$")
+ACE_RCSID (Persistence_Test,
+ test,
+ "$Id$")
int main (int argc, char *argv[])
{