diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-15 03:10:49 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-15 03:10:49 +0000 |
commit | 07e1f2df92172279e074290782243d99ec123d5f (patch) | |
tree | e5a517d9b620d0c7cbf14f16e39b6cb7ee0c1961 /TAO/orbsvcs | |
parent | f5ca2a92eeb9e3659526d1cfd5b1245d5e0677ce (diff) | |
download | ATCD-07e1f2df92172279e074290782243d99ec123d5f.tar.gz |
(init_naming_service): dereferenced orb_ with .in () to please g++.
Diffstat (limited to 'TAO/orbsvcs')
-rw-r--r-- | TAO/orbsvcs/tests/Logger/Logging_Test_i.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/TAO/orbsvcs/tests/Logger/Logging_Test_i.cpp b/TAO/orbsvcs/tests/Logger/Logging_Test_i.cpp index 1a778b20a0a..32b8b8b71db 100644 --- a/TAO/orbsvcs/tests/Logger/Logging_Test_i.cpp +++ b/TAO/orbsvcs/tests/Logger/Logging_Test_i.cpp @@ -31,34 +31,34 @@ Logger_Client::init (int argc, char **argv) { // Initialize the ORB orb_ = CORBA::ORB_init (argc, - argv, - "internet", - TAO_TRY_ENV); + argv, + "internet", + TAO_TRY_ENV); if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "\nTrying to initialize orb\n")); - + ACE_DEBUG ((LM_DEBUG, + "\nTrying to initialize orb\n")); + TAO_CHECK_ENV; if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "\nOrb initialized successfully\n")); - + ACE_DEBUG ((LM_DEBUG, + "\nOrb initialized successfully\n")); + // Parse command line and verify parameters. if (this->parse_args () == -1) return -1; // Initialize the naming service if (this->init_naming_service (TAO_TRY_ENV) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize naming" - "services.\n"), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize naming" + "services.\n"), + -1); // Create the logger instances if (this->init_loggers (TAO_TRY_ENV) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize logger" - "instances.\n"), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize logger" + "instances.\n"), + -1); } TAO_CATCHANY { @@ -66,65 +66,65 @@ Logger_Client::init (int argc, char **argv) return -1; } TAO_ENDTRY; - + return 0; - + } int Logger_Client::init_naming_service (CORBA::Environment &env) { // Initialize the naming services - if (my_name_client_.init (orb_, argc_, argv_) != 0) + if (my_name_client_.init (orb_.in (), argc_, argv_) != 0) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize " - "the TAO_Naming_Client. \n"), - -1); - + " (%P|%t) Unable to initialize " + "the TAO_Naming_Client. \n"), + -1); + // Resolve an instance of the Logger_Factory CosNaming::Name factory_name (1); factory_name.length (1); factory_name[0].id = CORBA::string_dup ("Logger_Factory"); - + CORBA::Object_var factory_ref = my_name_client_->resolve (factory_name, - env); + env); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "\nFactory_ref resolved\n")); - + "\nFactory_ref resolved\n")); + if (CORBA::is_nil (factory_ref.in ())) ACE_ERROR_RETURN ((LM_ERROR, - "resolved to nil object"), - -1); + "resolved to nil object"), + -1); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "\nLogger_Factory resolved\n")); + "\nLogger_Factory resolved\n")); // Narrow the factory and check the success factory_ = Logger_Factory::_narrow (factory_ref.in (), - env); + env); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "\nFactory narrowed\n")); + "\nFactory narrowed\n")); if (CORBA::is_nil (factory_.in ())) ACE_ERROR_RETURN ((LM_ERROR, - "narrow returned nil"), - -1); + "narrow returned nil"), + -1); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "\nLogger_Factory narrowed\n")); + "\nLogger_Factory narrowed\n")); - // If debugging, get the factory's IOR + // If debugging, get the factory's IOR CORBA::String_var str = orb_->object_to_string (factory_.in (), - env); + env); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "The factory IOR is <%s>\n", - str.in ())); + "The factory IOR is <%s>\n", + str.in ())); return 0; } @@ -134,38 +134,38 @@ Logger_Client::init_loggers (CORBA::Environment &env) // Retrieve the Logger obj ref corresponding to key1 and // key2. this->logger_1_ = factory_->make_logger ("key1", - env); + env); this->logger_2_ = factory_->make_logger ("key2", - env); - + env); + if (CORBA::is_nil (this->logger_1_.in ())) ACE_ERROR_RETURN ((LM_ERROR, - "nil logger1"), - -1); - + "nil logger1"), + -1); + if (CORBA::is_nil (this->logger_2_.in ())) ACE_ERROR_RETURN ((LM_ERROR, - "nil logger2"), - -1); + "nil logger2"), + -1); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "Created two loggers\n")); + "Created two loggers\n")); if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, - "\nTrying to resolve already created logger...")); + "\nTrying to resolve already created logger...")); Logger_var logger_3 = factory_->make_logger ("key1", - env); + env); if (CORBA::is_nil (logger_3.in ())) - ACE_DEBUG ((LM_DEBUG, - "\nResolution failed.")); + ACE_DEBUG ((LM_DEBUG, + "\nResolution failed.")); else - ACE_DEBUG ((LM_DEBUG, - "\nResolution succeeded.")); + ACE_DEBUG ((LM_DEBUG, + "\nResolution succeeded.")); } - + return 0; } @@ -181,7 +181,7 @@ Logger_Client::run (void) Logger::Log_Record rec1; Logger::Log_Record rec2; Logger::Log_Record rec3; - + // Setup the first log record this->init_record (rec1, Logger::LM_DEBUG, @@ -193,9 +193,9 @@ Logger_Client::run (void) "Beware The Stark Fist of Removal. (2)\n"); this->init_record (rec3, - Logger::LM_INFO, - "Bob loves you. Logv test successful. (3)\n"); - + Logger::LM_INFO, + "Bob loves you. Logv test successful. (3)\n"); + // If debugging, output the new log records if (TAO_debug_level > 0) { @@ -207,15 +207,15 @@ Logger_Client::run (void) "\nSecond Log_Record created. Contents:\n")); this->show_record (rec2); - ACE_DEBUG ((LM_DEBUG, - "\nThird log record created. Contents:\n")); - this->show_record (rec3); - } + ACE_DEBUG ((LM_DEBUG, + "\nThird log record created. Contents:\n")); + this->show_record (rec3); + } // Change the verbosity. this->logger_1_->verbosity (Logger::VERBOSE_LITE, TAO_TRY_ENV); TAO_CHECK_ENV; - + // Log the first Log_Record this->logger_1_->log (rec1, TAO_TRY_ENV); TAO_CHECK_ENV; @@ -263,7 +263,7 @@ Logger_Client::parse_args (void) ACE_ERROR_RETURN ((LM_ERROR, "usage: %s" " [-d]" - "\n" + "\n" " -d: increase debug level\n", this->argv_ [0]), -1); |