diff options
Diffstat (limited to 'tests/Process_Manual_Event_Test.cpp')
-rw-r--r-- | tests/Process_Manual_Event_Test.cpp | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/tests/Process_Manual_Event_Test.cpp b/tests/Process_Manual_Event_Test.cpp index b697743273b..b03c1457364 100644 --- a/tests/Process_Manual_Event_Test.cpp +++ b/tests/Process_Manual_Event_Test.cpp @@ -53,7 +53,7 @@ print_usage_and_die (void) static void parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("i:c")); + ACE_Get_Arg_Opt<ACE_TCHAR> get_opt (argc, argv, ACE_TEXT ("i:c")); int c; @@ -92,7 +92,7 @@ acquire_release (void) event_ping.signal (); if (event_pong.wait ()) - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P) %p\n"), ACE_TEXT ("Failed acquiring pong"))); else @@ -109,14 +109,12 @@ acquire_release (void) wait.sec (wait.sec () + 3); // timeout in 3 secs if (event_pong.wait (&wait)) - { - if (errno != ETIME) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P) %p, but expected ETIME\n"), - ACE_TEXT ("event_pong.wait()"))); - } + if (errno != ETIME) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P) %p, but expected ETIME\n"), + ACE_TEXT ("event_pong.wait()"))); else - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P) Acquired pong without release()\n"))); event_ping.signal (); // release waiting parent before timeout @@ -126,7 +124,7 @@ acquire_release (void) for (i = 0; i < iterations; ++i) { if (event_ping.wait ()) - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P) %p\n"), ACE_TEXT ("Failed acquiring ping"))); else @@ -151,8 +149,8 @@ acquire_release (void) ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P) %p but should be ETIME\n"), ACE_TEXT ("Acquire pong"))); - - ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P) Acquire pong timed out\n"))); + else + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P) Acquire pong timed out\n"))); } } } @@ -187,18 +185,13 @@ run_main (int argc, ACE_TCHAR *argv[]) else { ACE_START_TEST (ACE_TEXT ("Process_Manual_Event_Test")); -#if defined (ACE_WIN32) - const ACE_TCHAR *cmdline_format = ACE_TEXT("\"%s\" -c -i %d"); -#elif !defined (ACE_USES_WCHAR) -const ACE_TCHAR *cmdline_format = ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT("%s -c -i %d"); -#else -const ACE_TCHAR *cmdline_format = ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT("%ls -c -i %d"); -#endif - ACE_Process_Options options; - options.command_line (cmdline_format, - argv[0], + options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR + ACE_TEXT ("Process_Manual_Event_Test") + ACE_PLATFORM_EXE_SUFFIX + ACE_TEXT (" -c -i %d"), iterations); + // Spawn a child process that will contend for the // lock. ACE_Process child; @@ -215,8 +208,7 @@ const ACE_TCHAR *cmdline_format = ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR ACE ACE_exitcode child_status; // Wait for the child processes we created to exit. - int wait_result = child.wait (&child_status); - ACE_ASSERT (wait_result != -1); + ACE_ASSERT (child.wait (&child_status) != -1); if (child_status == 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Child %d finished ok\n"), |