diff options
Diffstat (limited to 'tests/Service_Config_Test.cpp')
-rw-r--r-- | tests/Service_Config_Test.cpp | 94 |
1 files changed, 30 insertions, 64 deletions
diff --git a/tests/Service_Config_Test.cpp b/tests/Service_Config_Test.cpp index a49199f0156..7650417c110 100644 --- a/tests/Service_Config_Test.cpp +++ b/tests/Service_Config_Test.cpp @@ -1,47 +1,43 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Service_Config_Test.cpp - * - * $Id$ - * - * This is a simple test to make sure the Service_Configurator is - * working correctly. - * - * @author David Levine <levine@cs.wustl.edu> - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// tests +// +// = FILENAME +// Service_Config_Test.cpp +// +// = DESCRIPTION +// This is a simple test to make sure the Service_Configurator is +// working correctly. +// +// = AUTHOR +// David Levine <levine@cs.wustl.edu> +// +// ============================================================================ #include "test_config.h" #include "ace/Object_Manager.h" #include "ace/Service_Config.h" -#include "ace/Thread_Manager.h" -#include "ace/ARGV.h" -ACE_RCSID (tests, - Service_Config_Test, - "$Id$") +ACE_RCSID(tests, Service_Config_Test, "$Id$") static const u_int VARIETIES = 3; static u_int error = 0; -/** - * @class Test_Singleton - * - * @brief Test the Singleton - * - * This should be a template class, with singleton instantiations. - * But to avoid having to deal with compilers that want template - * declarations in separate files, it's just a plain class. The - * instance argument differentiates the "singleton" instances. It - * also demonstrates the use of the param arg to the cleanup () - * function. - */ class Test_Singleton + // = TITLE + // Test the Singleton + // + // = DESCRIPTION + // This should be a template class, with singleton instantiations. + // But to avoid having to deal with compilers that want template + // declarations in separate files, it's just a plain class. The + // instance argument differentiates the "singleton" instances. It + // also demonstrates the use of the param arg to the cleanup () + // function. { public: static Test_Singleton *instance (u_short variety); @@ -118,38 +114,11 @@ Test_Singleton::~Test_Singleton (void) static void run_test (int argc, ACE_TCHAR *argv[]) { - ACE_ARGV new_argv; - - const ACE_TCHAR svc_conf[] = -#if defined (ACE_USES_WCHAR) - // When using full Unicode support, use the version of the Service - // Configurator file that is UTF-16 encoded. - // - // @@ Note: Some platforms may want other encoding (e.g. UTF-32). - // - // iconv(1) found on Linux and Solaris, for example, can - // be used to convert between encodings. - // - // Byte ordering is also an issue, so we should be - // generating this file on-the-fly from the UTF-8 encoded - // file by using functions like iconv(1) or iconv(3). - ACE_TEXT ("Service_Config_Test.UTF-16.conf"); -#else - // ASCII (UTF-8) encoded Service Configurator file. - ACE_TEXT ("Service_Config_Test.conf"); -#endif /* ACE_USES_WCHAR */ - - // Process the Service Configurator directives in this test's - ACE_ASSERT (new_argv.add (argv) != -1 - && new_argv.add (ACE_TEXT ("-f")) != -1 - && new_argv.add (svc_conf) != -1); - // We need this scope to make sure that the destructor for the // <ACE_Service_Config> gets called. ACE_Service_Config daemon; - ACE_ASSERT (daemon.open (new_argv.argc (), - new_argv.argv ()) != -1 || errno == ENOENT); + ACE_ASSERT (daemon.open (argc, argv) != -1 || errno == ENOENT); ACE_Time_Value tv (argc > 1 ? ACE_OS::atoi (argv[1]) : 2); @@ -173,9 +142,6 @@ main (int argc, ACE_TCHAR *argv[]) run_test (argc, argv); - // Wait for all threads to complete. - ACE_Thread_Manager::instance ()->wait (); - ACE_END_TEST; return error == 0 ? 0 : 1; } |