diff options
Diffstat (limited to 'tests/Tokens_Test.cpp')
-rw-r--r-- | tests/Tokens_Test.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/tests/Tokens_Test.cpp b/tests/Tokens_Test.cpp index 528932d7cb0..30113586aac 100644 --- a/tests/Tokens_Test.cpp +++ b/tests/Tokens_Test.cpp @@ -40,7 +40,7 @@ ACE_RCSID(tests, Tokens_Test, "$Id$") typedef ACE_Token_Invariant_Manager TOKEN_INVARIANTS; -static const ASYS_TCHAR *server_host = ACE_DEFAULT_SERVER_HOST; +static const ACE_TCHAR *server_host = ACE_DEFAULT_SERVER_HOST; static const int server_port = 23456; // Synchronize starts of threads, so that they all start before one @@ -54,7 +54,7 @@ struct Test_Params public: ACE_Token_Proxy *token1_; ACE_Token_Proxy *token2_; - const ASYS_TCHAR *collection_name_; + const ACE_TCHAR *collection_name_; }; static void * @@ -65,7 +65,7 @@ run_thread (void *vp) collection.insert (*(tp->token1_)); collection.insert (*(tp->token2_)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) new thread.\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) new thread.\n"))); thread_start->wait (); int count = 50; @@ -75,19 +75,19 @@ run_thread (void *vp) { if (ACE_OS::last_error () == EDEADLK) { - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("deadlock detected in acquire"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("deadlock detected in acquire"))); continue; } ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("(%t) %p acquire failed\n"), - ASYS_TEXT ("run_thread"))); + ACE_TEXT ("(%t) %p acquire failed\n"), + ACE_TEXT ("run_thread"))); return (void *) -1; } ACE_ASSERT ((TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1) || (TOKEN_INVARIANTS::instance ()->acquired (tp->token2_) == 1)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %s acquired.\n"), collection.name ())); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) %s acquired.\n"), collection.name ())); TOKEN_INVARIANTS::instance ()->releasing (tp->token1_); TOKEN_INVARIANTS::instance ()->releasing (tp->token2_); @@ -96,18 +96,18 @@ run_thread (void *vp) { if (ACE_OS::last_error () == EDEADLK) { - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("deadlock detected"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("deadlock detected"))); goto deadlock; } - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%t) %p renew failed\n"), - ASYS_TEXT ("run_thread"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%t) %p renew failed\n"), + ACE_TEXT ("run_thread"))); return (void *) -1; } ACE_ASSERT (TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1 || TOKEN_INVARIANTS::instance ()->acquired (tp->token2_) == 1); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %s renewed.\n"), collection.name ())); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) %s renewed.\n"), collection.name ())); deadlock: @@ -116,15 +116,15 @@ run_thread (void *vp) if (collection.release () == -1) { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%t) %p release failed\n"),ASYS_TEXT ("run_thread"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%t) %p release failed\n"),ACE_TEXT ("run_thread"))); return (void *) -1; } - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %s released.\n"), collection.name ())); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) %s released.\n"), collection.name ())); } - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) thread finished.\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) thread finished.\n"))); return 0; } @@ -140,15 +140,15 @@ run_test (ACE_Token_Proxy *A, // tp1 and tp2 can run concurrently. Neither tp1 or tp3 can run // when tp2 is running. - tp1.collection_name_ = ASYS_TEXT ("A and Reader"); + tp1.collection_name_ = ACE_TEXT ("A and Reader"); tp1.token1_ = A; tp1.token2_ = R; - tp2.collection_name_ = ASYS_TEXT ("A and Writer"); + tp2.collection_name_ = ACE_TEXT ("A and Writer"); tp2.token1_ = A; tp2.token2_ = W; - tp3.collection_name_ = ASYS_TEXT ("B and Reader"); + tp3.collection_name_ = ACE_TEXT ("B and Reader"); tp3.token1_ = B; tp3.token2_ = R; @@ -157,40 +157,40 @@ run_test (ACE_Token_Proxy *A, if (mgr->spawn (ACE_THR_FUNC (run_thread), (void *) &tp1, THR_BOUND) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn 1 failed")), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn 1 failed")), -1); if (mgr->spawn (ACE_THR_FUNC (run_thread), (void *) &tp2, THR_BOUND) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn 2 failed")), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn 2 failed")), -1); if (mgr->spawn (ACE_THR_FUNC (run_thread), (void *) &tp3, THR_BOUND) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn 3 failed")), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn 3 failed")), -1); // Wait for all threads to exit. mgr->wait (); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Test finished.\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Test finished.\n"))); return 0; } #endif /* ACE_HAS_THREADS */ int -main (int, ASYS_TCHAR *[]) +main (int, ACE_TCHAR *[]) { - ACE_START_TEST (ASYS_TEXT ("Tokens_Test")); + ACE_START_TEST (ACE_TEXT ("Tokens_Test")); #if defined (ACE_HAS_THREADS) ACE_Token_Proxy *A = 0, *B = 0, *R = 0, *W = 0; - ACE_NEW_RETURN (A, ACE_Local_Mutex (ASYS_TEXT ("L Mutex A"), 0, 0), -1); - ACE_NEW_RETURN (B, ACE_Local_Mutex (ASYS_TEXT ("L Mutex B"), 0, 0), -1); - ACE_NEW_RETURN (R, ACE_Local_RLock (ASYS_TEXT ("L Reader Lock"), 0, 0), -1); - ACE_NEW_RETURN (W, ACE_Local_WLock (ASYS_TEXT ("L Writer Lock"), 0, 0), -1); + ACE_NEW_RETURN (A, ACE_Local_Mutex (ACE_TEXT ("L Mutex A"), 0, 0), -1); + ACE_NEW_RETURN (B, ACE_Local_Mutex (ACE_TEXT ("L Mutex B"), 0, 0), -1); + ACE_NEW_RETURN (R, ACE_Local_RLock (ACE_TEXT ("L Reader Lock"), 0, 0), -1); + ACE_NEW_RETURN (W, ACE_Local_WLock (ACE_TEXT ("L Writer Lock"), 0, 0), -1); ACE_NEW_RETURN (thread_start, ACE_Barrier (3), -1); run_test (A, B, R, W); - LPCTSTR cl = + const ACE_TCHAR * cl = ACE_TEXT ("..") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT ("netsvcs") ACE_DIRECTORY_SEPARATOR_STR ACE_TEXT ("servers") ACE_DIRECTORY_SEPARATOR_STR @@ -201,23 +201,23 @@ main (int, ASYS_TCHAR *[]) ACE_Process_Options options; options.command_line (cl); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Forking Token Service.\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Forking Token Service.\n"))); // Start up the token server for the remote test. ACE_Process new_process; if (new_process.spawn (options) == -1) - ACE_ERROR ((LM_DEBUG, ASYS_TEXT ("%n; %p (%s), will not run remote test.\n"), - ASYS_TEXT ("Server fork failed"), cl)); + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("%n; %p (%s), will not run remote test.\n"), + ACE_TEXT ("Server fork failed"), cl)); else { - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Server forked with pid = %d.\n"), + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Server forked with pid = %d.\n"), new_process.getpid ())); // Wait for the server to start. ACE_OS::sleep (3); ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("Using Token Server on %s at port %d.\n"), + ACE_TEXT ("Using Token Server on %s at port %d.\n"), server_host, server_port)); ACE_Remote_Mutex::set_server_address (ACE_INET_Addr (server_port, server_host)); @@ -227,10 +227,10 @@ main (int, ASYS_TCHAR *[]) delete R; delete W; - ACE_NEW_RETURN (A, ACE_Remote_Mutex (ASYS_TEXT ("R Mutex A"), 0, 1), -1); - ACE_NEW_RETURN (B, ACE_Remote_Mutex (ASYS_TEXT ("R Mutex B"), 0, 1), -1); - ACE_NEW_RETURN (R, ACE_Remote_RLock (ASYS_TEXT ("R Reader Lock"), 0, 1), -1); - ACE_NEW_RETURN (W, ACE_Remote_WLock (ASYS_TEXT ("R Writer Lock"), 0, 1), -1); + ACE_NEW_RETURN (A, ACE_Remote_Mutex (ACE_TEXT ("R Mutex A"), 0, 1), -1); + ACE_NEW_RETURN (B, ACE_Remote_Mutex (ACE_TEXT ("R Mutex B"), 0, 1), -1); + ACE_NEW_RETURN (R, ACE_Remote_RLock (ACE_TEXT ("R Reader Lock"), 0, 1), -1); + ACE_NEW_RETURN (W, ACE_Remote_WLock (ACE_TEXT ("R Writer Lock"), 0, 1), -1); run_test (A, B, R, W); @@ -239,7 +239,7 @@ main (int, ASYS_TCHAR *[]) // Kill the token server. if (new_process.terminate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("Kill failed.\n")), -1); + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Kill failed.\n")), -1); } delete thread_start; @@ -249,10 +249,10 @@ main (int, ASYS_TCHAR *[]) delete R; delete W; - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) main thread exiting.\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) main thread exiting.\n"))); #else ACE_ERROR ((LM_INFO, - ASYS_TEXT ("threads not supported on this platform\n"))); + ACE_TEXT ("threads not supported on this platform\n"))); #endif /* ACE_HAS_THREADS */ ACE_END_TEST; return 0; |