diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DLList_Test.cpp | 2 | ||||
-rw-r--r-- | tests/Hash_Map_Manager_Test.cpp | 4 | ||||
-rw-r--r-- | tests/Message_Block_Test.cpp | 2 | ||||
-rw-r--r-- | tests/Notify_Performance_Test.cpp | 41 | ||||
-rw-r--r-- | tests/Process_Strategy_Test.cpp | 2 | ||||
-rw-r--r-- | tests/RB_Tree_Test.cpp | 12 | ||||
-rw-r--r-- | tests/test_config.h | 8 |
7 files changed, 43 insertions, 28 deletions
diff --git a/tests/DLList_Test.cpp b/tests/DLList_Test.cpp index 9352e50b4a7..c5a484e918f 100644 --- a/tests/DLList_Test.cpp +++ b/tests/DLList_Test.cpp @@ -26,7 +26,7 @@ USELIB("..\ace\aced.lib"); //--------------------------------------------------------------------------- #endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ -static ASYS_TCHAR * string_table[] = +static LPCTSTR string_table[] = { ASYS_TEXT ("hello"), ASYS_TEXT ("guten Tag"), diff --git a/tests/Hash_Map_Manager_Test.cpp b/tests/Hash_Map_Manager_Test.cpp index e172015f03d..3554abe784e 100644 --- a/tests/Hash_Map_Manager_Test.cpp +++ b/tests/Hash_Map_Manager_Test.cpp @@ -54,8 +54,8 @@ typedef ACE_Hash_Map_Reverse_Iterator_Ex<ASYS_TCHAR *, struct String_Table { - ASYS_TCHAR *key_; - ASYS_TCHAR *value_; + LPCTSTR key_; + LPCTSTR value_; }; static String_Table string_table[] = diff --git a/tests/Message_Block_Test.cpp b/tests/Message_Block_Test.cpp index 4ebc1724591..17b5505622f 100644 --- a/tests/Message_Block_Test.cpp +++ b/tests/Message_Block_Test.cpp @@ -264,7 +264,7 @@ ACE_Cached_Allocator<MEMORY_CHUNK, struct { ACE_Allocator *strategy_; - ASYS_TCHAR *name_; + LPCTSTR name_; ACE_Profile_Timer::ACE_Elapsed_Time et_; } alloc_struct[ACE_ALLOC_STRATEGY_NO] = { diff --git a/tests/Notify_Performance_Test.cpp b/tests/Notify_Performance_Test.cpp index 6083846ee76..403fed63084 100644 --- a/tests/Notify_Performance_Test.cpp +++ b/tests/Notify_Performance_Test.cpp @@ -9,14 +9,13 @@ // Notify_Performance_Test.cpp // // = DESCRIPTION -// // This test is used to time the notification mechanisms of the // ACE_Reactors. Both the WFMO_Reactor and Select_Reactor can be // tested. The notify() mechanism can also be tested with or // without data. // // = AUTHOR -// Irfan Pyarali +// Irfan Pyarali <irfan@cs.wustl.edu> // // ============================================================================ @@ -71,7 +70,8 @@ Handler::handle_exception (ACE_HANDLE handle) } // Execute the client tests. -void * + +static void * client (void *arg) { // Number of client (user) threads @@ -94,7 +94,8 @@ client (void *arg) } // Sets up the correct reactor (based on platform and options) -void + +static void create_reactor (void) { ACE_Reactor_Impl *impl = 0; @@ -114,10 +115,10 @@ create_reactor (void) ACE_Reactor::instance (reactor); } -void +static void print_results (ACE_Profile_Timer::ACE_Elapsed_Time &et) { - ASYS_TCHAR *reactor_type = 0; + LPCTSTR reactor_type = 0; if (opt_wfmo_reactor) reactor_type = ASYS_TEXT ("WFMO_Reactor"); else if (opt_select_reactor) @@ -125,16 +126,26 @@ print_results (ACE_Profile_Timer::ACE_Elapsed_Time &et) else reactor_type = ASYS_TEXT ("Platform's default Reactor"); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nNotify_Performance Test statistics:\n\n"))); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\tReactor Type: %s\n"), reactor_type)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\tWorker threads (calling notify()): %d\n"), opt_nthreads)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\tIteration per thread: %d\n"), opt_nloops)); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\nNotify_Performance Test statistics:\n\n"))); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\tReactor Type: %s\n"), + reactor_type)); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\tWorker threads (calling notify()): %d\n"), + opt_nthreads)); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\tIteration per thread: %d\n"), + opt_nloops)); if (opt_pass_notify_data) - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\tData was passed in the notify() call\n"))); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\tData was passed in the notify() call\n"))); else - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\tNo data was passed in the notify() call\n"))); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\tNo data was passed in the notify() call\n"))); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n\tTiming results notify() call:\n"))); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("\n\tTiming results notify() call:\n"))); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\t\treal time = %f secs \n\t\tuser time = %f secs \n\t\tsystem time = %f secs\n\n"), et.real_time, @@ -148,6 +159,7 @@ main (int argc, ASYS_TCHAR *argv[]) ACE_START_TEST (ASYS_TEXT ("Notify_Performance_Test")); ACE_Get_Opt getopt (argc, argv, ASYS_TEXT ("swdc:l:")); + for (int c; (c = getopt ()) != -1; ) switch (c) { @@ -209,7 +221,8 @@ main (int argc, ASYS_TCHAR *argv[]) // Print results print_results (et); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) waiting for the worker threads...\n"))); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("(%P|%t) waiting for the worker threads...\n"))); // Wait for all worker to get done. ACE_Thread_Manager::instance ()->wait (); diff --git a/tests/Process_Strategy_Test.cpp b/tests/Process_Strategy_Test.cpp index 11ec1c318c5..c60e343395c 100644 --- a/tests/Process_Strategy_Test.cpp +++ b/tests/Process_Strategy_Test.cpp @@ -475,7 +475,7 @@ client (void *arg) ACE_SOCK_Connector connector; char buf[BUFSIZ]; - char *command; + const char *command; size_t command_len; size_t i; diff --git a/tests/RB_Tree_Test.cpp b/tests/RB_Tree_Test.cpp index ef89caf7205..edb47bfbfbd 100644 --- a/tests/RB_Tree_Test.cpp +++ b/tests/RB_Tree_Test.cpp @@ -38,11 +38,15 @@ USELIB("..\ace\aced.lib"); // These arrays of numbers as ints and character strings // are used to instantiate key and item nodes in the tree. -static char *number_strings [] = {"10", "20", "30", "40", - "50", "60", "70", "80"}; +static const char *number_strings [] = +{ + "10", "20", "30", "40", "50", "60", "70", "80" +}; -static int number_integers [] = {10, 20, 30, 40, - 50, 60, 70, 80}; +static int number_integers [] = +{ + 10, 20, 30, 40, 50, 60, 70, 80 +}; // These arrays of ints are used to shuffle the order of insertion // of keys and items for the various trees. diff --git a/tests/test_config.h b/tests/test_config.h index 2c961ce5517..3effdb8f81d 100644 --- a/tests/test_config.h +++ b/tests/test_config.h @@ -246,7 +246,7 @@ ACE_Test_Output::set_output (const ASYS_TCHAR *filename, int append) { ASYS_TCHAR temp[MAXPATHLEN]; // Ignore the error value since the directory may already exist. - ASYS_TCHAR *test_dir; + LPCTSTR test_dir; #if !defined (ACE_HAS_WINCE) test_dir = ACE_OS::getenv ("ACE_TEST_DIR"); @@ -255,8 +255,6 @@ ACE_Test_Output::set_output (const ASYS_TCHAR *filename, int append) #endif /* ACE_HAS_WINCE */ test_dir = ASYS_TEXT (""); - - ACE_OS::sprintf (temp, ASYS_TEXT ("%s%s%s%s"), test_dir, @@ -268,8 +266,8 @@ ACE_Test_Output::set_output (const ASYS_TCHAR *filename, int append) // This is the only way I could figure out to avoid a console warning // about opening an existing file (w/o O_CREAT), or attempting to unlink // a non-existant one. - int fd; - if ((fd = ACE_OS::open (temp, O_WRONLY | O_CREAT, 0x644)) != ERROR) + int fd = ACE_OS::open (temp, O_WRONLY | O_CREAT, 0x644); + if (fd != ERROR) { ACE_OS::close (fd); ACE_OS::unlink (temp); |