diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-12-17 14:45:11 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-12-17 14:45:11 +0000 |
commit | 8b5e3a841da915b71c29c4967436f6089ed32873 (patch) | |
tree | 310942d51cfcc5b07025697dd3e562aa7166f935 /ACE/tests | |
parent | c28d3bdcfa39f4cb30c37c3c507dc0ef40a370ac (diff) | |
download | ATCD-8b5e3a841da915b71c29c4967436f6089ed32873.tar.gz |
Fri Dec 17 14:42:53 UTC 2010 Martin Corino <mcorino@remedy.nl>
* */*.*:
Merged RemedyWork branch.
Diffstat (limited to 'ACE/tests')
75 files changed, 510 insertions, 511 deletions
diff --git a/ACE/tests/Array_Map_Test.cpp b/ACE/tests/Array_Map_Test.cpp index 9a55c7fb493..42a1b5619ac 100644 --- a/ACE/tests/Array_Map_Test.cpp +++ b/ACE/tests/Array_Map_Test.cpp @@ -48,7 +48,7 @@ insertion_removal_test (void) typedef ACE_Array_Map<char, ACE_TString> Map; Map phonetic[2]; - ACE_ASSERT (phonetic[0] == phonetic[1]); // Sanity check. + ACE_TEST_ASSERT (phonetic[0] == phonetic[1]); // Sanity check. static size_t const phonetic_len = sizeof (phonetic) / sizeof (phonetic[0]); @@ -86,7 +86,7 @@ insertion_removal_test (void) false); } - ACE_ASSERT (m->size () == letters_len); + ACE_TEST_ASSERT (m->size () == letters_len); } // Test equality of identically populated maps. @@ -105,7 +105,7 @@ insertion_removal_test (void) false); } - ACE_ASSERT (!phonetic[0].is_empty ()); // Sanity check. + ACE_TEST_ASSERT (!phonetic[0].is_empty ()); // Sanity check. Map foo (phonetic[0]); // Copy construction Map bar = foo; // Assignment @@ -156,8 +156,8 @@ insertion_removal_test (void) // Remove two elements from map. Map::iterator letter_A = A.find ('A'); - ACE_ASSERT (letter_A == A.begin ()); // Should be first map element. - ACE_ASSERT (A.count ('A') == 1); // Should only be one letter 'A'. + ACE_TEST_ASSERT (letter_A == A.begin ()); // Should be first map element. + ACE_TEST_ASSERT (A.count ('A') == 1); // Should only be one letter 'A'. A.erase (letter_A); if (A.find ('A') != A.end () @@ -186,8 +186,8 @@ insertion_removal_test (void) Map::iterator const first = B.begin () + 2; Map::iterator const last = first + removed_len; - ACE_ASSERT (static_cast<Map::size_type> (last - first) < B.size ()); - ACE_ASSERT (last < B.end ()); + ACE_TEST_ASSERT (static_cast<Map::size_type> (last - first) < B.size ()); + ACE_TEST_ASSERT (last < B.end ()); Map::value_type removed[removed_len]; size_t rcount = 0; @@ -228,8 +228,8 @@ index_operator_test (void) typedef ACE_Array_Map<char, ACE_TString> Map; Map phonetic; - ACE_ASSERT (phonetic.size () == 0 && phonetic.is_empty ()); - ACE_ASSERT (phonetic.max_size () > 1); + ACE_TEST_ASSERT (phonetic.size () == 0 && phonetic.is_empty ()); + ACE_TEST_ASSERT (phonetic.max_size () > 1); // Run the same test twice, clearing the contents of the map between // the iterations. The goal is to verify that the constant time @@ -250,7 +250,7 @@ index_operator_test (void) phonetic[*i] = *word; } - ACE_ASSERT (phonetic.size () == letters_len); + ACE_TEST_ASSERT (phonetic.size () == letters_len); typedef Map::const_iterator const_iterator; @@ -319,12 +319,12 @@ index_operator_test (void) } // The size should not have changed. - ACE_ASSERT (phonetic.size () == letters_len); + ACE_TEST_ASSERT (phonetic.size () == letters_len); // Empty the map of its contents wholesale. phonetic.clear (); - ACE_ASSERT (phonetic.size () == 0 && phonetic.is_empty ()); + ACE_TEST_ASSERT (phonetic.size () == 0 && phonetic.is_empty ()); } ACE_DEBUG ((LM_DEBUG, @@ -402,7 +402,7 @@ reference_count_test (void) RefCounted counted (&ref_count); - ACE_ASSERT (counted.refcount () == 1); + ACE_TEST_ASSERT (counted.refcount () == 1); { Map map (CAPACITY); // Preallocate storage for a number of @@ -411,7 +411,7 @@ reference_count_test (void) map[ACE_TEXT("One")] = counted; - ACE_ASSERT (counted.refcount () == 2); + ACE_TEST_ASSERT (counted.refcount () == 2); std::pair<Map::iterator, bool> result; @@ -423,10 +423,10 @@ reference_count_test (void) result = map.insert (std::make_pair (ACE_TString (ACE_TEXT ("Two")), counted)); - ACE_ASSERT (result.second); + ACE_TEST_ASSERT (result.second); } - ACE_ASSERT (counted.refcount () == 3); + ACE_TEST_ASSERT (counted.refcount () == 3); { // Enter a new scope block to assure destruction of temporaries @@ -435,22 +435,22 @@ reference_count_test (void) result = map.insert (std::make_pair (ACE_TString (ACE_TEXT ("Three")), counted)); - ACE_ASSERT (result.second); + ACE_TEST_ASSERT (result.second); } - ACE_ASSERT (counted.refcount () == 4); + ACE_TEST_ASSERT (counted.refcount () == 4); Map::size_type const erased = map.erase (ACE_TEXT ("One")); - ACE_ASSERT (erased == 1); - ACE_ASSERT (counted.refcount () == 3); + ACE_TEST_ASSERT (erased == 1); + ACE_TEST_ASSERT (counted.refcount () == 3); } // Map instance no longer contains any references to the "counted" // object so the reference count should be back to one. - ACE_ASSERT (counted.refcount () == 1); + ACE_TEST_ASSERT (counted.refcount () == 1); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Reference count test passed.\n"))); @@ -465,7 +465,7 @@ run_main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("Array_Map_Test")); - ACE_ASSERT (::letters_len == ::words_len); + ACE_TEST_ASSERT (::letters_len == ::words_len); bool const success = ::insertion_removal_test () diff --git a/ACE/tests/Atomic_Op_Test.cpp b/ACE/tests/Atomic_Op_Test.cpp index d0109b6093a..739531d009f 100644 --- a/ACE/tests/Atomic_Op_Test.cpp +++ b/ACE/tests/Atomic_Op_Test.cpp @@ -36,39 +36,39 @@ int test (const ACE_TCHAR* type, int iterations) int retval = 0; ACE_Atomic_Op <ACE_SYNCH_MUTEX, TYPE> foo (5); - ACE_ASSERT (foo == 5); + ACE_TEST_ASSERT (foo == 5); TYPE result = ++foo; - ACE_ASSERT (foo == 6); - ACE_ASSERT (result == 6); + ACE_TEST_ASSERT (foo == 6); + ACE_TEST_ASSERT (result == 6); result = --foo; - ACE_ASSERT (foo == 5); - ACE_ASSERT (result == 5); + ACE_TEST_ASSERT (foo == 5); + ACE_TEST_ASSERT (result == 5); result = foo++; - ACE_ASSERT (foo == 6); - ACE_ASSERT (result == 5); + ACE_TEST_ASSERT (foo == 6); + ACE_TEST_ASSERT (result == 5); result = foo--; - ACE_ASSERT (foo == 5); - ACE_ASSERT (result == 6); + ACE_TEST_ASSERT (foo == 5); + ACE_TEST_ASSERT (result == 6); result = foo += 10; - ACE_ASSERT (foo == 15); - ACE_ASSERT (result == 15); + ACE_TEST_ASSERT (foo == 15); + ACE_TEST_ASSERT (result == 15); result = foo -= 10; - ACE_ASSERT (foo == 5); - ACE_ASSERT (result == 5); + ACE_TEST_ASSERT (foo == 5); + ACE_TEST_ASSERT (result == 5); foo = 7; - ACE_ASSERT (foo == 7); + ACE_TEST_ASSERT (foo == 7); ACE_Atomic_Op <ACE_SYNCH_MUTEX, TYPE> foo2 (5); foo2 = foo; - ACE_ASSERT (foo == 7); - ACE_ASSERT (foo2 == 7); + ACE_TEST_ASSERT (foo == 7); + ACE_TEST_ASSERT (foo2 == 7); ACE_UINT64 usec; diff --git a/ACE/tests/Auto_IncDec_Test.cpp b/ACE/tests/Auto_IncDec_Test.cpp index 5b57c33de17..7311f9db76d 100644 --- a/ACE/tests/Auto_IncDec_Test.cpp +++ b/ACE/tests/Auto_IncDec_Test.cpp @@ -109,7 +109,7 @@ run_main (int, ACE_TCHAR *[]) ACE_Thread_Manager::instance ()->wait (); - ACE_ASSERT (current_threads_in_first_section.value () == 0 + ACE_TEST_ASSERT (current_threads_in_first_section.value () == 0 && current_threads_in_second_section.value () == 0); ACE_DEBUG ((LM_DEBUG, @@ -118,21 +118,21 @@ run_main (int, ACE_TCHAR *[]) int counter = 0; { ACE_Auto_IncDec<int> Auto_IncDec1 (counter); - ACE_ASSERT (counter == 1); + ACE_TEST_ASSERT (counter == 1); ACE_Auto_IncDec<int> Auto_IncDec2 (counter); - ACE_ASSERT (counter == 2); + ACE_TEST_ASSERT (counter == 2); { - ACE_ASSERT (counter == 2); + ACE_TEST_ASSERT (counter == 2); ACE_Auto_IncDec<int> Auto_IncDec3 (counter); - ACE_ASSERT (counter == 3); + ACE_TEST_ASSERT (counter == 3); } - ACE_ASSERT (counter == 2); + ACE_TEST_ASSERT (counter == 2); } - ACE_ASSERT (counter == 0); + ACE_TEST_ASSERT (counter == 0); #endif /* ACE_HAS_THREADS */ diff --git a/ACE/tests/Buffer_Stream_Test.cpp b/ACE/tests/Buffer_Stream_Test.cpp index 57b64a77915..715d6d97b9f 100644 --- a/ACE/tests/Buffer_Stream_Test.cpp +++ b/ACE/tests/Buffer_Stream_Test.cpp @@ -183,7 +183,7 @@ Consumer::svc (void) if (length > 0) { output = mb->rd_ptr (); - ACE_ASSERT (*c == output[0]); + ACE_TEST_ASSERT (*c == output[0]); c++; } mb->release (); diff --git a/ACE/tests/Bug_2434_Regression_Test.cpp b/ACE/tests/Bug_2434_Regression_Test.cpp index c9189e1dc76..a0fe2cb84af 100644 --- a/ACE/tests/Bug_2434_Regression_Test.cpp +++ b/ACE/tests/Bug_2434_Regression_Test.cpp @@ -46,21 +46,21 @@ run_main (int, ACE_TCHAR *[]) tv1.set (max_time_t - 1, 499999); tv2.set (max_time_t, 999999); // ACE_Time_Value::max_time tv1 *= 10.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); tv1.set (max_time_t - 1, 499999); tv2.set (min_time_t, -999999); tv1 *= -10.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); // test results near limits tv1.set ((max_time_t >> 1), 499999); tv2.set ((-(max_time_t >> 1) << 1), -999998); tv1 *= -2.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); tv1.set (max_time_t >> 1, 499999); tv2.set (((max_time_t >> 1) << 1), 999998); tv1 *= 2.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); ACE_END_TEST; diff --git a/ACE/tests/Bug_3332_Regression_Test.cpp b/ACE/tests/Bug_3332_Regression_Test.cpp index 0fd489915a7..e6683f9781b 100644 --- a/ACE/tests/Bug_3332_Regression_Test.cpp +++ b/ACE/tests/Bug_3332_Regression_Test.cpp @@ -23,7 +23,7 @@ // // ============================================================================ -#include "test_config.h" /* Include first to enable ACE_ASSERT. */ +#include "test_config.h" /* Include first to enable ACE_TEST_ASSERT. */ #include "ace/RB_Tree.h" #include "ace/Null_Mutex.h" @@ -72,7 +72,7 @@ run_main (int, ACE_TCHAR *[]) ACE_DEBUG ((LM_DEBUG, "Validating Tree\n")); {for (size_t i= 0u; i < sizeof(nodes)/sizeof(Nodes); ++i) { - ACE_RB_Tree_Node<char, int> *node; + ACE_RB_Tree_Node<char, int> *node = 0; if (tree.find (nodes[i].key, node)) { @@ -106,7 +106,7 @@ run_main (int, ACE_TCHAR *[]) } else { - ACE_RB_Tree_Node<char, int> *node; + ACE_RB_Tree_Node<char, int> *node = 0; if (0 == tree.find (nodes[i].key, node)) { diff --git a/ACE/tests/Bug_3878_Regression_Test.cpp b/ACE/tests/Bug_3878_Regression_Test.cpp index 614368a6bf1..5c525383666 100644 --- a/ACE/tests/Bug_3878_Regression_Test.cpp +++ b/ACE/tests/Bug_3878_Regression_Test.cpp @@ -216,7 +216,7 @@ Manager::shut_down (void) // Wait for the exit. worker->wait (); - ACE_ASSERT (worker->msg_queue ()->is_empty ()); + ACE_TEST_ASSERT (worker->msg_queue ()->is_empty ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Worker %C shut down.\n"), buf)); diff --git a/ACE/tests/Bug_3911_Regression_Test.cpp b/ACE/tests/Bug_3911_Regression_Test.cpp index 0a12172358a..3f4d48dc36f 100644 --- a/ACE/tests/Bug_3911_Regression_Test.cpp +++ b/ACE/tests/Bug_3911_Regression_Test.cpp @@ -97,7 +97,7 @@ public: void* getMemoryBlock(const char* block_name, unsigned int block_size) { - void* shared; + void* shared = 0; ACE_DEBUG((LM_INFO, ACE_TEXT("errno = %d. Looking for a Shared Memory block named %C\n"), ACE_OS::last_error(), diff --git a/ACE/tests/CDR_Array_Test.cpp b/ACE/tests/CDR_Array_Test.cpp index 6f0df84be7d..38e7163fabe 100644 --- a/ACE/tests/CDR_Array_Test.cpp +++ b/ACE/tests/CDR_Array_Test.cpp @@ -391,7 +391,7 @@ CDR_Test<T, H>::do_test (int total, int niter, int use_array, char* toread = 0; { - ACE_ASSERT(use_array || total % 4 == 0); + ACE_TEST_ASSERT(use_array || total % 4 == 0); double totalsecs = 0.0; int n; diff --git a/ACE/tests/CDR_Test.cpp b/ACE/tests/CDR_Test.cpp index cf1ae854dc6..19df22a0adc 100644 --- a/ACE/tests/CDR_Test.cpp +++ b/ACE/tests/CDR_Test.cpp @@ -553,15 +553,15 @@ run_main (int argc, ACE_TCHAR *argv[]) } // Sanity checks. - ACE_ASSERT (sizeof (ACE_CDR::Boolean) >= 1); - ACE_ASSERT (sizeof (ACE_CDR::Octet) == 1); - ACE_ASSERT (sizeof (ACE_CDR::WChar) >= 2); - ACE_ASSERT (sizeof (ACE_CDR::Short) == 2); - ACE_ASSERT (sizeof (ACE_CDR::Long) == 4); - ACE_ASSERT (sizeof (ACE_CDR::LongLong) == 8); - ACE_ASSERT (sizeof (ACE_CDR::Float) == 4); - ACE_ASSERT (sizeof (ACE_CDR::Double) == 8); - ACE_ASSERT (sizeof (ACE_CDR::LongDouble) == 16); + ACE_TEST_ASSERT (sizeof (ACE_CDR::Boolean) >= 1); + ACE_TEST_ASSERT (sizeof (ACE_CDR::Octet) == 1); + ACE_TEST_ASSERT (sizeof (ACE_CDR::WChar) >= 2); + ACE_TEST_ASSERT (sizeof (ACE_CDR::Short) == 2); + ACE_TEST_ASSERT (sizeof (ACE_CDR::Long) == 4); + ACE_TEST_ASSERT (sizeof (ACE_CDR::LongLong) == 8); + ACE_TEST_ASSERT (sizeof (ACE_CDR::Float) == 4); + ACE_TEST_ASSERT (sizeof (ACE_CDR::Double) == 8); + ACE_TEST_ASSERT (sizeof (ACE_CDR::LongDouble) == 16); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing ACE CDR functions - short stream\n\n"))); diff --git a/ACE/tests/Cache_Map_Manager_Test.cpp b/ACE/tests/Cache_Map_Manager_Test.cpp index a23dea8b42d..7263fa8411c 100644 --- a/ACE/tests/Cache_Map_Manager_Test.cpp +++ b/ACE/tests/Cache_Map_Manager_Test.cpp @@ -143,14 +143,14 @@ run_iterator_cache (MAP_CACHE &cache) (*iter).first (), (*iter).second ())); - ACE_ASSERT ((*iter).first () == (*iter).second ()); + ACE_TEST_ASSERT ((*iter).first () == (*iter).second ()); ++counter; } ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); ACE_UNUSED_ARG (iterations); - ACE_ASSERT (counter == iterations); + ACE_TEST_ASSERT (counter == iterations); } static void @@ -170,14 +170,14 @@ run_iterator_hash_cache (HASH_MAP_CACHE &cache) (*iter).first (), (*iter).second ())); - ACE_ASSERT ((*iter).first () == (*iter).second ()); + ACE_TEST_ASSERT ((*iter).first () == (*iter).second ()); ++counter; } ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); ACE_UNUSED_ARG (iterations); - ACE_ASSERT (counter == iterations); + ACE_TEST_ASSERT (counter == iterations); } static void @@ -190,7 +190,7 @@ run_reverse_iterator_cache (MAP_CACHE &cache) iter != rend; ++iter) { - ACE_ASSERT ((*iter).first () == (*iter).second ()); + ACE_TEST_ASSERT ((*iter).first () == (*iter).second ()); // Debugging info. if (debug) @@ -204,7 +204,7 @@ run_reverse_iterator_cache (MAP_CACHE &cache) if (debug) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_ASSERT (counter == 0); + ACE_TEST_ASSERT (counter == 0); } static void @@ -217,7 +217,7 @@ run_reverse_iterator_hash_cache (HASH_MAP_CACHE &cache) iter != rend; ++iter) { - ACE_ASSERT ((*iter).first () == (*iter).second ()); + ACE_TEST_ASSERT ((*iter).first () == (*iter).second ()); // Debugging info. if (debug) @@ -231,7 +231,7 @@ run_reverse_iterator_hash_cache (HASH_MAP_CACHE &cache) if (debug) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); - ACE_ASSERT (counter == 0); + ACE_TEST_ASSERT (counter == 0); } static void @@ -242,8 +242,8 @@ find_test_cache (MAP_CACHE &cache) VALUE j = 0; int result = cache.find (lookup_array[i], j); - ACE_ASSERT (result != -1); - ACE_ASSERT (j == lookup_array[i]); + ACE_TEST_ASSERT (result != -1); + ACE_TEST_ASSERT (j == lookup_array[i]); if (debug) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%d "), j)); @@ -263,8 +263,8 @@ find_test_hash_cache (HASH_MAP_CACHE &cache) VALUE j = 0; int result = cache.find (lookup_array[i], j); - ACE_ASSERT (result != -1); - ACE_ASSERT (j == lookup_array[i]); + ACE_TEST_ASSERT (result != -1); + ACE_TEST_ASSERT (j == lookup_array[i]); if (debug) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%d "), j)); @@ -290,7 +290,7 @@ purge_test_cache (MAP_CACHE &cache) // Purge from cache. int result = cache.purge (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_UNUSED_ARG (result); size_t resultant_size = 0; @@ -300,7 +300,7 @@ purge_test_cache (MAP_CACHE &cache) resultant_size = current_map_size - entries_to_remove; // Make sure the purge took out the appropriate number of entries. - ACE_ASSERT (cache.current_size () == resultant_size); + ACE_TEST_ASSERT (cache.current_size () == resultant_size); ACE_UNUSED_ARG (resultant_size); } @@ -318,7 +318,7 @@ purge_test_hash_cache (HASH_MAP_CACHE &cache) // Purge from cache. int result = cache.purge (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_UNUSED_ARG (result); size_t resultant_size = 0; @@ -328,7 +328,7 @@ purge_test_hash_cache (HASH_MAP_CACHE &cache) resultant_size = current_map_size - entries_to_remove; // Make sure the purge took out the appropriate number of entries. - ACE_ASSERT (cache.current_size () == resultant_size); + ACE_TEST_ASSERT (cache.current_size () == resultant_size); ACE_UNUSED_ARG (resultant_size); } @@ -345,14 +345,14 @@ functionality_test_cache (MAP_CACHING_STRATEGY &caching_strategy) ++i, ++j) { int result = cache.bind (i, j); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); if (debug) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("keys[%d]=%d value=[%d]=%d\n"), i, i, j, j)); ++counter; - ACE_ASSERT (cache.current_size () == counter); + ACE_TEST_ASSERT (cache.current_size () == counter); } ACE_DEBUG ((LM_DEBUG, @@ -387,7 +387,7 @@ functionality_test_hash_cache (HASH_MAP_CACHING_STRATEGY &caching_strategy) ++i, ++j) { int result = cache.bind (i, j); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); if (debug) @@ -395,7 +395,7 @@ functionality_test_hash_cache (HASH_MAP_CACHING_STRATEGY &caching_strategy) ACE_TEXT ("keys[%d]=%d value=[%d]=%d\n"), i, i, j, j)); ++counter; - ACE_ASSERT (cache.current_size () == counter); + ACE_TEST_ASSERT (cache.current_size () == counter); } ACE_DEBUG ((LM_DEBUG, diff --git a/ACE/tests/Collection_Test.cpp b/ACE/tests/Collection_Test.cpp index 1fe58f7ef69..9d7cea3d13f 100644 --- a/ACE/tests/Collection_Test.cpp +++ b/ACE/tests/Collection_Test.cpp @@ -147,9 +147,9 @@ run_main (int, ACE_TCHAR *[]) ARRAY array4; array4 = array2; - ACE_ASSERT (array1 == array2); - ACE_ASSERT (array1 == array3); - ACE_ASSERT (array1 == array4); + ACE_TEST_ASSERT (array1 == array2); + ACE_TEST_ASSERT (array1 == array3); + ACE_TEST_ASSERT (array1 == array4); { for (size_t i = 0; @@ -158,7 +158,7 @@ run_main (int, ACE_TCHAR *[]) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%d\n"), array1[i])); - ACE_ASSERT (array1[i] == 4); + ACE_TEST_ASSERT (array1[i] == 4); } } @@ -170,7 +170,7 @@ run_main (int, ACE_TCHAR *[]) iterator.next (data); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%d\n"), (*data))); - ACE_ASSERT (*data == 4); + ACE_TEST_ASSERT (*data == 4); iterator.advance (); } } diff --git a/ACE/tests/Conn_Test.cpp b/ACE/tests/Conn_Test.cpp index e133753afdb..19ceab04825 100644 --- a/ACE/tests/Conn_Test.cpp +++ b/ACE/tests/Conn_Test.cpp @@ -183,7 +183,7 @@ Svc_Handler::recv_data (void) while ((r_bytes = new_stream.recv (&c, 1)) > 0) { - ACE_ASSERT (*t == c); + ACE_TEST_ASSERT (*t == c); // We need to guard against cached connections, which // will send multiple sequences of letters from 'a' -> @@ -748,7 +748,7 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("open"))); - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); } else { diff --git a/ACE/tests/Dev_Poll_Reactor_Test.cpp b/ACE/tests/Dev_Poll_Reactor_Test.cpp index 3e1cb27e82b..5b21a276ba2 100644 --- a/ACE/tests/Dev_Poll_Reactor_Test.cpp +++ b/ACE/tests/Dev_Poll_Reactor_Test.cpp @@ -97,7 +97,7 @@ Client::Client (void) int Client::open (void *) { - // ACE_ASSERT (this->reactor () != 0); + // ACE_TEST_ASSERT (this->reactor () != 0); if (this->reactor () && this->reactor ()->register_handler ( diff --git a/ACE/tests/Dynamic_Priority_Test.cpp b/ACE/tests/Dynamic_Priority_Test.cpp index 1967ddf775e..fdce93fae85 100644 --- a/ACE/tests/Dynamic_Priority_Test.cpp +++ b/ACE/tests/Dynamic_Priority_Test.cpp @@ -47,7 +47,7 @@ // // ============================================================================ -#include "test_config.h" /* Include first to enable ACE_ASSERT. */ +#include "test_config.h" /* Include first to enable ACE_TEST_ASSERT. */ #include "ace/Message_Queue.h" #include "ace/Thread_Manager.h" #include "ace/High_Res_Timer.h" @@ -137,7 +137,7 @@ static const ACE_Time_Value offset_step (0, 5); static void * order_consumer (void *args) { - ACE_ASSERT (args != 0); + ACE_TEST_ASSERT (args != 0); ACE_Message_Queue<ACE_SYNCH> *msg_queue = static_cast<ArgStruct *> (args)->queue_; @@ -146,8 +146,8 @@ order_consumer (void *args) u_int expected_count = static_cast<ArgStruct *> (args)->expected_count_; - ACE_ASSERT (receipt_order != 0); - ACE_ASSERT (msg_queue != 0); + ACE_TEST_ASSERT (receipt_order != 0); + ACE_TEST_ASSERT (msg_queue != 0); u_int local_count = 0; @@ -167,11 +167,11 @@ order_consumer (void *args) local_count++; - ACE_ASSERT (*expected == *mb->rd_ptr ()); + ACE_TEST_ASSERT (*expected == *mb->rd_ptr ()); } - ACE_ASSERT (local_count == ACE_OS::strlen (receipt_order)); - ACE_ASSERT (local_count == expected_count); + ACE_TEST_ASSERT (local_count == ACE_OS::strlen (receipt_order)); + ACE_TEST_ASSERT (local_count == expected_count); return 0; } @@ -183,7 +183,7 @@ order_consumer (void *args) static void * order_producer (void *args) { - ACE_ASSERT (args != 0); + ACE_TEST_ASSERT (args != 0); ACE_Message_Queue<ACE_SYNCH> *msg_queue = static_cast<ArgStruct *> (args)->queue_; @@ -194,8 +194,8 @@ order_producer (void *args) int expected_count = static_cast<ArgStruct *> (args)->expected_count_; - ACE_ASSERT (send_order != 0); - ACE_ASSERT (block_array != 0); + ACE_TEST_ASSERT (send_order != 0); + ACE_TEST_ASSERT (block_array != 0); // Iterate through the send order string and the message block // array, setting the current message block's read pointer to the @@ -207,7 +207,7 @@ order_producer (void *args) { // point to the current message block ACE_Message_Block *mb = block_array [local_count]; - ACE_ASSERT (mb != 0); + ACE_TEST_ASSERT (mb != 0); // Set the current send character in the current message block // at its read pointer position, and adjust the write pointer. @@ -220,7 +220,7 @@ order_producer (void *args) break; } - ACE_ASSERT (local_count == expected_count); + ACE_TEST_ASSERT (local_count == expected_count); return 0; } @@ -233,10 +233,10 @@ run_order_test (ACE_Message_Queue<ACE_SYNCH>* msg_queue, u_int i; u_int array_size = ACE_OS::strlen (send_order); - ACE_ASSERT (msg_queue != 0); - ACE_ASSERT (send_order != 0); - ACE_ASSERT (receipt_order != 0); - ACE_ASSERT (ACE_OS::strlen (send_order) == ACE_OS::strlen (receipt_order)); + ACE_TEST_ASSERT (msg_queue != 0); + ACE_TEST_ASSERT (send_order != 0); + ACE_TEST_ASSERT (receipt_order != 0); + ACE_TEST_ASSERT (ACE_OS::strlen (send_order) == ACE_OS::strlen (receipt_order)); ArgStruct supplier_args, consumer_args; @@ -307,7 +307,7 @@ run_order_test (ACE_Message_Queue<ACE_SYNCH>* msg_queue, break; // should never reach here, but its better to make sure default: - ACE_ASSERT ((4 * i) / array_size < 4); + ACE_TEST_ASSERT ((4 * i) / array_size < 4); break; } } @@ -340,14 +340,14 @@ performance_consumer (void * args) { ACE_High_Res_Timer timer; - ACE_ASSERT (args != 0); + ACE_TEST_ASSERT (args != 0); ACE_Message_Queue<ACE_SYNCH> *msg_queue = static_cast<ArgStruct *> (args)->queue_; u_int expected_count = static_cast<ArgStruct *> (args)->expected_count_; - ACE_ASSERT (msg_queue != 0); + ACE_TEST_ASSERT (msg_queue != 0); u_int local_count = 0; ACE_Message_Block *mb = 0; @@ -371,7 +371,7 @@ performance_consumer (void * args) tv.msec (), (ACE_timer_t) tv.msec () / local_count)); - ACE_ASSERT (local_count == expected_count); + ACE_TEST_ASSERT (local_count == expected_count); return 0; } @@ -386,7 +386,7 @@ performance_producer (void *args) { ACE_High_Res_Timer timer; - ACE_ASSERT (args != 0); + ACE_TEST_ASSERT (args != 0); ACE_Message_Queue<ACE_SYNCH> *msg_queue = static_cast<ArgStruct *> (args)->queue_; @@ -395,8 +395,8 @@ performance_producer (void *args) int expected_count = static_cast<ArgStruct *> (args)->expected_count_; - ACE_ASSERT (send_order != 0); - ACE_ASSERT (block_array != 0); + ACE_TEST_ASSERT (send_order != 0); + ACE_TEST_ASSERT (block_array != 0); // reset, then start timer timer.reset (); @@ -411,7 +411,7 @@ performance_producer (void *args) { // Point to the current message block. ACE_Message_Block *mb = block_array [local_count]; - ACE_ASSERT (mb != 0); + ACE_TEST_ASSERT (mb != 0); // Set a character in the current message block at its // read pointer position, and adjust the write pointer. @@ -433,7 +433,7 @@ performance_producer (void *args) tv.msec (), (ACE_timer_t) tv.msec () / local_count)); - ACE_ASSERT (local_count == expected_count); + ACE_TEST_ASSERT (local_count == expected_count); return 0; } @@ -457,16 +457,16 @@ run_performance_test (u_int min_load, ACE_Message_Queue<ACE_SYNCH> *static_queue = ACE_Message_Queue_Factory<ACE_SYNCH>::create_static_message_queue (max_queue); - ACE_ASSERT (static_queue != 0); + ACE_TEST_ASSERT (static_queue != 0); ACE_Message_Queue<ACE_SYNCH> *deadline_queue = ACE_Message_Queue_Factory<ACE_SYNCH>::create_deadline_message_queue (max_queue); - ACE_ASSERT (deadline_queue != 0); + ACE_TEST_ASSERT (deadline_queue != 0); ACE_Message_Queue<ACE_SYNCH> *laxity_queue = ACE_Message_Queue_Factory<ACE_SYNCH>::create_laxity_message_queue (max_queue); - ACE_ASSERT (laxity_queue != 0); + ACE_TEST_ASSERT (laxity_queue != 0); // Zero out unused struct members. supplier_args.order_string_ = 0; @@ -727,7 +727,7 @@ run_main (int, ACE_TCHAR *[]) // Test factory, static message queue. ACE_Message_Queue<ACE_SYNCH> *test_queue = ACE_Message_Queue_Factory<ACE_SYNCH>::create_static_message_queue (max_queue); - ACE_ASSERT (test_queue != 0); + ACE_TEST_ASSERT (test_queue != 0); run_order_test (test_queue, send_order, static_receipt_order); @@ -736,7 +736,7 @@ run_main (int, ACE_TCHAR *[]) // Test factory, dynamic message queue (deadline strategy). test_queue = ACE_Message_Queue_Factory<ACE_SYNCH>::create_deadline_message_queue (max_queue); - ACE_ASSERT (test_queue != 0); + ACE_TEST_ASSERT (test_queue != 0); run_order_test (test_queue, send_order, deadline_receipt_order); @@ -745,7 +745,7 @@ run_main (int, ACE_TCHAR *[]) // Test factory, dynamic message queue (laxity strategy). test_queue = ACE_Message_Queue_Factory<ACE_SYNCH>::create_laxity_message_queue (max_queue); - ACE_ASSERT (test_queue != 0); + ACE_TEST_ASSERT (test_queue != 0); run_order_test (test_queue, send_order, laxity_receipt_order); @@ -756,7 +756,7 @@ run_main (int, ACE_TCHAR *[]) ACE_Message_Queue_Vx *test_queue_vx = ACE_Message_Queue_Factory<ACE_NULL_SYNCH>::create_Vx_message_queue (vx_max_queue, vx_msg_size); - ACE_ASSERT (test_queue_vx != 0); + ACE_TEST_ASSERT (test_queue_vx != 0); // (TBD - does message receipt order test make any sense for Vx Queue ? // If so, uncomment order test, or if not remove order test, below) // @@ % levine 22 Jul 1998 % It'd be nice to run the test, but: diff --git a/ACE/tests/Dynamic_Test.cpp b/ACE/tests/Dynamic_Test.cpp index 5225b7a4264..86e0b7323d9 100644 --- a/ACE/tests/Dynamic_Test.cpp +++ b/ACE/tests/Dynamic_Test.cpp @@ -56,10 +56,10 @@ A::operator new (size_t n) if (dynamic_instance == 0) { - // If this ACE_ASSERT fails, it may be due to running of out TSS + // If this ACE_TEST_ASSERT fails, it may be due to running of out TSS // keys. Try using ACE_HAS_TSS_EMULATION, or increasing // ACE_DEFAULT_THREAD_KEYS if already using TSS emulation. - ACE_ASSERT (dynamic_instance != 0); + ACE_TEST_ASSERT (dynamic_instance != 0); ACE_throw_bad_alloc; } @@ -81,10 +81,10 @@ A::operator new (size_t n, const ACE_nothrow_t&) throw() if (dynamic_instance == 0) { - // If this ACE_ASSERT fails, it may be due to running of out TSS + // If this ACE_TEST_ASSERT fails, it may be due to running of out TSS // keys. Try using ACE_HAS_TSS_EMULATION, or increasing // ACE_DEFAULT_THREAD_KEYS if already using TSS emulation. - ACE_ASSERT (dynamic_instance != 0); + ACE_TEST_ASSERT (dynamic_instance != 0); return 0; } diff --git a/ACE/tests/Future_Set_Test.cpp b/ACE/tests/Future_Set_Test.cpp index da6d0cf6381..6a138a99e85 100644 --- a/ACE/tests/Future_Set_Test.cpp +++ b/ACE/tests/Future_Set_Test.cpp @@ -383,17 +383,17 @@ run_main (int, ACE_TCHAR *[]) Prime_Scheduler (ACE_TEXT ("andres")), -1); int result = andres->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_NEW_RETURN (peter, Prime_Scheduler (ACE_TEXT ("peter")), -1); result = peter->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_NEW_RETURN (helmut, Prime_Scheduler (ACE_TEXT ("helmut")), -1); result = helmut->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // Matias passes all asynchronous method calls on to Andres... ACE_NEW_RETURN (matias, @@ -401,7 +401,7 @@ run_main (int, ACE_TCHAR *[]) andres), -1); result = matias->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_Future<u_long> fresulta; ACE_Future<u_long> fresultb; diff --git a/ACE/tests/Future_Test.cpp b/ACE/tests/Future_Test.cpp index 2d54ed95b91..40d14fc734f 100644 --- a/ACE/tests/Future_Test.cpp +++ b/ACE/tests/Future_Test.cpp @@ -386,17 +386,17 @@ run_main (int, ACE_TCHAR *[]) Prime_Scheduler (ACE_TEXT ("andres")), -1); int result = andres->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_NEW_RETURN (peter, Prime_Scheduler (ACE_TEXT ("peter")), -1); result = peter->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_NEW_RETURN (helmut, Prime_Scheduler (ACE_TEXT ("helmut")), -1); result = helmut->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // Matias passes all asynchronous method calls on to Andres... ACE_NEW_RETURN (matias, @@ -404,7 +404,7 @@ run_main (int, ACE_TCHAR *[]) andres), -1); result = matias->open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); for (int i = 0; i < n_loops; i++) { diff --git a/ACE/tests/Handle_Set_Test.cpp b/ACE/tests/Handle_Set_Test.cpp index 8331bd960ec..696f58525c3 100644 --- a/ACE/tests/Handle_Set_Test.cpp +++ b/ACE/tests/Handle_Set_Test.cpp @@ -60,8 +60,8 @@ test_duplicates (size_t count) } } - ACE_ASSERT (count == sets + clears); - ACE_ASSERT (handle_set.num_set () + duplicates == sets); + ACE_TEST_ASSERT (count == sets + clears); + ACE_TEST_ASSERT (handle_set.num_set () + duplicates == sets); } // This is the vector of handles to test. These numbers are chosen to @@ -109,7 +109,7 @@ test_boundaries (void) (handle = i1 ()) != ACE_INVALID_HANDLE; ) { - ACE_ASSERT (0 == + ACE_TEST_ASSERT (0 == ACE_TEXT ("this shouldn't get called since ") ACE_TEXT ("the set is empty!\n")); } @@ -149,11 +149,11 @@ test_boundaries (void) ACE_TEXT ("obtained handle %d\n"), handle)); int done = set.remove (handle); - ACE_ASSERT (done == 0); + ACE_TEST_ASSERT (done == 0); count++; } - ACE_ASSERT (count == handle_set.num_set ()); + ACE_TEST_ASSERT (count == handle_set.num_set ()); } static void @@ -182,7 +182,7 @@ test_performance (size_t max_handles, timer.stop (); - ACE_ASSERT (count == max_handles * max_iterations); + ACE_TEST_ASSERT (count == max_handles * max_iterations); ACE_Profile_Timer::ACE_Elapsed_Time et; diff --git a/ACE/tests/Hash_Map_Bucket_Iterator_Test.cpp b/ACE/tests/Hash_Map_Bucket_Iterator_Test.cpp index 5d2ed20e9b4..5cf017c288d 100644 --- a/ACE/tests/Hash_Map_Bucket_Iterator_Test.cpp +++ b/ACE/tests/Hash_Map_Bucket_Iterator_Test.cpp @@ -87,8 +87,7 @@ run_main (int argc, ACE_TCHAR *argv[]) for (i = 0; i < iterations; ++i) { int result = map.bind (i, i); - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result == 0); } for (i = 0; i < table_size; ++i) @@ -106,7 +105,7 @@ run_main (int argc, ACE_TCHAR *argv[]) { ACE_DEBUG ((LM_DEBUG, "%d ", (*iterator).int_id_)); ACE_UINT32 key = (*iterator).ext_id_; - ACE_ASSERT (((key - i) % table_size) == 0); + ACE_TEST_ASSERT (((key - i) % table_size) == 0); } ACE_DEBUG ((LM_DEBUG, "\n")); diff --git a/ACE/tests/Hash_Map_Manager_Test.cpp b/ACE/tests/Hash_Map_Manager_Test.cpp index 64308296f8a..6a9e6f91486 100644 --- a/ACE/tests/Hash_Map_Manager_Test.cpp +++ b/ACE/tests/Hash_Map_Manager_Test.cpp @@ -202,7 +202,7 @@ run_test (void) ACE_TEXT ("bind"), string_table[i].key_), -1); - const ACE_TCHAR *entry; + const ACE_TCHAR *entry = 0; // Check the <find> operation. for (i = 0; string_table[i].key_ != 0; i++) diff --git a/ACE/tests/IOStream_Test.cpp b/ACE/tests/IOStream_Test.cpp index 1e7c550db7d..276c69d5537 100644 --- a/ACE/tests/IOStream_Test.cpp +++ b/ACE/tests/IOStream_Test.cpp @@ -250,7 +250,7 @@ client (void *arg = 0) d)); // Check for proper received values. - ACE_ASSERT (i == 1 && (f1 >= 0.123420 && f1 <= 0.123422) + ACE_TEST_ASSERT (i == 1 && (f1 >= 0.123420 && f1 <= 0.123422) && l == 666555444 && (f2 >= 23.44 && f2 <= 23.46) && (d >= -47.1e+9 && d <= -45.9e+9)); // Reset the precision to limit ourselves to two significant digits. @@ -402,7 +402,7 @@ server (void *arg = 0) d)); // check for proper received values - ACE_ASSERT (i == -1 && (f1 >= -0.13 && f1 <= -0.11) + ACE_TEST_ASSERT (i == -1 && (f1 >= -0.13 && f1 <= -0.11) && l == -666555444 && (f2 >= -24.0 && f2 <= -22.0) && (d >= 45e+9 && d <= 47e+9)); diff --git a/ACE/tests/Integer_Truncate_Test.cpp b/ACE/tests/Integer_Truncate_Test.cpp index e171f9af269..0a1952c4073 100644 --- a/ACE/tests/Integer_Truncate_Test.cpp +++ b/ACE/tests/Integer_Truncate_Test.cpp @@ -35,7 +35,7 @@ sizeof_from_lt_sizeof_to (void) typedef signed char from_type; typedef unsigned int to_type; - ACE_ASSERT (sizeof (from_type) < sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) < sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should not be truncated. @@ -55,7 +55,7 @@ sizeof_from_lt_sizeof_to (void) typedef unsigned char from_type; typedef signed int to_type; - ACE_ASSERT (sizeof (from_type) < sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) < sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should not be truncated. @@ -75,7 +75,7 @@ sizeof_from_lt_sizeof_to (void) typedef signed char from_type; typedef signed int to_type; - ACE_ASSERT (sizeof (from_type) < sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) < sizeof (to_type)); from_type f1 = -1; // Should not be truncated. from_type f2 = @@ -97,7 +97,7 @@ sizeof_from_lt_sizeof_to (void) typedef unsigned char from_type; typedef unsigned int to_type; - ACE_ASSERT (sizeof (from_type) < sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) < sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should not be truncated. @@ -134,7 +134,7 @@ sizeof_from_eq_sizeof_to (void) typedef signed int from_type; typedef unsigned int to_type; - ACE_ASSERT (sizeof (from_type) == sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) == sizeof (to_type)); from_type f1 = -1; // Should not be truncated. from_type f2 = @@ -156,7 +156,7 @@ sizeof_from_eq_sizeof_to (void) typedef unsigned int from_type; typedef signed int to_type; - ACE_ASSERT (sizeof (from_type) == sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) == sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should be truncated. @@ -176,7 +176,7 @@ sizeof_from_eq_sizeof_to (void) typedef signed int from_type; typedef signed int to_type; - ACE_ASSERT (sizeof (from_type) == sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) == sizeof (to_type)); from_type f1 = -1; // Should not be truncated. from_type f2 = @@ -198,7 +198,7 @@ sizeof_from_eq_sizeof_to (void) typedef unsigned int from_type; typedef unsigned int to_type; - ACE_ASSERT (sizeof (from_type) == sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) == sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should not be truncated. @@ -235,7 +235,7 @@ sizeof_from_gt_sizeof_to (void) typedef signed int from_type; typedef unsigned char to_type; - ACE_ASSERT (sizeof (from_type) > sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) > sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should be truncated. @@ -255,7 +255,7 @@ sizeof_from_gt_sizeof_to (void) typedef unsigned int from_type; typedef signed char to_type; - ACE_ASSERT (sizeof (from_type) > sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) > sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should be truncated. @@ -275,7 +275,7 @@ sizeof_from_gt_sizeof_to (void) typedef signed int from_type; typedef signed char to_type; - ACE_ASSERT (sizeof (from_type) > sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) > sizeof (to_type)); from_type f1 = -1; // Should not be truncated. from_type f2 = @@ -297,7 +297,7 @@ sizeof_from_gt_sizeof_to (void) typedef unsigned int from_type; typedef unsigned char to_type; - ACE_ASSERT (sizeof (from_type) > sizeof (to_type)); + ACE_TEST_ASSERT (sizeof (from_type) > sizeof (to_type)); from_type f = ACE_Numeric_Limits<from_type>::max (); // Should be truncated. diff --git a/ACE/tests/Intrusive_Auto_Ptr_Test.cpp b/ACE/tests/Intrusive_Auto_Ptr_Test.cpp index 0fbff2fc8e4..bc49d843e0b 100644 --- a/ACE/tests/Intrusive_Auto_Ptr_Test.cpp +++ b/ACE/tests/Intrusive_Auto_Ptr_Test.cpp @@ -79,25 +79,25 @@ int run_main (int, ACE_TCHAR *[]) One *theone (new One(0)); { - ACE_ASSERT (theone->has_refs (0)); - ACE_ASSERT (!One::was_released ()); + ACE_TEST_ASSERT (theone->has_refs (0)); + ACE_TEST_ASSERT (!One::was_released ()); ACE_Intrusive_Auto_Ptr<One> ip2(theone); { - ACE_ASSERT (theone->has_refs (1)); - ACE_ASSERT (!One::was_released ()); + ACE_TEST_ASSERT (theone->has_refs (1)); + ACE_TEST_ASSERT (!One::was_released ()); ACE_Intrusive_Auto_Ptr<One> ip2(theone); - ACE_ASSERT (theone->has_refs (2)); - ACE_ASSERT (!One::was_released ()); + ACE_TEST_ASSERT (theone->has_refs (2)); + ACE_TEST_ASSERT (!One::was_released ()); } - ACE_ASSERT (theone->has_refs (1)); - ACE_ASSERT (!One::was_released ()); + ACE_TEST_ASSERT (theone->has_refs (1)); + ACE_TEST_ASSERT (!One::was_released ()); } - ACE_ASSERT (One::was_released()); + ACE_TEST_ASSERT (One::was_released()); ACE_END_TEST; return 0; diff --git a/ACE/tests/MM_Shared_Memory_Test.cpp b/ACE/tests/MM_Shared_Memory_Test.cpp index c8768dcc693..3df0943b05b 100644 --- a/ACE/tests/MM_Shared_Memory_Test.cpp +++ b/ACE/tests/MM_Shared_Memory_Test.cpp @@ -69,21 +69,21 @@ child (void * = 0) // Wait for the parent to be initialized. result = synchronizer->acquire (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); const char *t = ACE_ALPHABET; ACE_Shared_Memory_MM shm_child; result = shm_child.open (shm_key); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); char *shm = (char *) shm_child.malloc (); - ACE_ASSERT (shm != 0); + ACE_TEST_ASSERT (shm != 0); for (char *s = shm; *s != '\0'; s++) { - ACE_ASSERT (*t == s[0]); + ACE_TEST_ASSERT (*t == s[0]); t++; } @@ -100,11 +100,11 @@ parent (void * = 0) ACE_Shared_Memory_MM shm_parent; result = shm_parent.open (shm_key, SHMSZ); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); char *shm = (char *) shm_parent.malloc (); - ACE_ASSERT (shm != 0); + ACE_TEST_ASSERT (shm != 0); char *s = shm; @@ -115,7 +115,7 @@ parent (void * = 0) // Allow the child to proceed. result = synchronizer->release (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // Perform a "busy wait" until the child sets the character to '*'. while (*shm != '*') @@ -123,7 +123,7 @@ parent (void * = 0) ACE_TEXT ("(%P) spinning in parent!\n"))); result = shm_parent.remove (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_OS::unlink (shm_key); return 0; diff --git a/ACE/tests/MT_Reactor_Timer_Test.cpp b/ACE/tests/MT_Reactor_Timer_Test.cpp index 248f51115fa..d3448d98fec 100644 --- a/ACE/tests/MT_Reactor_Timer_Test.cpp +++ b/ACE/tests/MT_Reactor_Timer_Test.cpp @@ -74,16 +74,16 @@ Time_Handler::setup (void) int Time_Handler::verify_results (void) { - ACE_ASSERT (this->timer_id_[0] == Time_Handler::TIMER_FIRED); - ACE_ASSERT (this->timer_id_[1] == Time_Handler::TIMER_FIRED); - ACE_ASSERT (this->timer_id_[2] == Time_Handler::TIMER_CANCELLED); - ACE_ASSERT (this->timer_id_[3] == Time_Handler::TIMER_FIRED); - ACE_ASSERT (this->timer_id_[4] == Time_Handler::TIMER_CANCELLED); - ACE_ASSERT (this->timer_id_[5] == Time_Handler::TIMER_FIRED); - ACE_ASSERT (this->timer_id_[6] == Time_Handler::TIMER_FIRED); + ACE_TEST_ASSERT (this->timer_id_[0] == Time_Handler::TIMER_FIRED); + ACE_TEST_ASSERT (this->timer_id_[1] == Time_Handler::TIMER_FIRED); + ACE_TEST_ASSERT (this->timer_id_[2] == Time_Handler::TIMER_CANCELLED); + ACE_TEST_ASSERT (this->timer_id_[3] == Time_Handler::TIMER_FIRED); + ACE_TEST_ASSERT (this->timer_id_[4] == Time_Handler::TIMER_CANCELLED); + ACE_TEST_ASSERT (this->timer_id_[5] == Time_Handler::TIMER_FIRED); + ACE_TEST_ASSERT (this->timer_id_[6] == Time_Handler::TIMER_FIRED); for (int i = 7; i < Time_Handler::TIMER_SLOTS; i++) - ACE_ASSERT (this->timer_id_[i] == Time_Handler::TIMER_NOTSET); + ACE_TEST_ASSERT (this->timer_id_[i] == Time_Handler::TIMER_NOTSET); return 0; } @@ -93,7 +93,7 @@ Time_Handler::svc (void) { ACE_Reactor *r = ACE_Reactor::instance (); - ACE_ASSERT (r->cancel_timer (this->timer_id_[2]) == 1); + ACE_TEST_ASSERT (r->cancel_timer (this->timer_id_[2]) == 1); this->timer_id_[2] = Time_Handler::TIMER_CANCELLED; this->timer_id_[1] = r->schedule_timer(this, @@ -114,7 +114,7 @@ Time_Handler::svc (void) (const void *)6, ACE_Time_Value (12)); - ACE_ASSERT (r->cancel_timer (this->timer_id_[4]) == 1); + ACE_TEST_ASSERT (r->cancel_timer (this->timer_id_[4]) == 1); this->timer_id_[4] = Time_Handler::TIMER_CANCELLED; return 0; @@ -134,10 +134,10 @@ Time_Handler::handle_timeout (const ACE_Time_Value &tv, time_tag, this->timer_id_[time_tag])); - ACE_ASSERT (time_tag > this->prev_timer_); - ACE_ASSERT (this->timer_id_[time_tag] != Time_Handler::TIMER_NOTSET); - ACE_ASSERT (this->timer_id_[time_tag] != Time_Handler::TIMER_CANCELLED); - ACE_ASSERT (this->timer_id_[time_tag] != Time_Handler::TIMER_FIRED); + ACE_TEST_ASSERT (time_tag > this->prev_timer_); + ACE_TEST_ASSERT (this->timer_id_[time_tag] != Time_Handler::TIMER_NOTSET); + ACE_TEST_ASSERT (this->timer_id_[time_tag] != Time_Handler::TIMER_CANCELLED); + ACE_TEST_ASSERT (this->timer_id_[time_tag] != Time_Handler::TIMER_FIRED); this->timer_id_[time_tag] = Time_Handler::TIMER_FIRED; this->prev_timer_ = time_tag; @@ -187,7 +187,7 @@ Dispatch_Count_Handler::handle_close (ACE_HANDLE h, ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): handle_close\n"))); - ACE_ASSERT (h == this->pipe_.read_handle () + ACE_TEST_ASSERT (h == this->pipe_.read_handle () && m == ACE_Event_Handler::READ_MASK); return 0; @@ -198,7 +198,7 @@ Dispatch_Count_Handler::handle_input (ACE_HANDLE h) { char c; - ACE_ASSERT (this->input_seen_ == 0); + ACE_TEST_ASSERT (this->input_seen_ == 0); this->input_seen_ = 1; if (ACE::recv (h, &c, 1) != 1) @@ -207,7 +207,7 @@ Dispatch_Count_Handler::handle_input (ACE_HANDLE h) ACE_TEXT ("recv")), -1); - ACE_ASSERT (c == 'z'); + ACE_TEST_ASSERT (c == 'z'); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): handle_input\n"))); // Trigger the <handle_close> hook. @@ -219,7 +219,7 @@ Dispatch_Count_Handler::handle_exception (ACE_HANDLE h) { ACE_UNUSED_ARG (h); - ACE_ASSERT (this->notify_seen_ == 0); + ACE_TEST_ASSERT (this->notify_seen_ == 0); this->notify_seen_ = 1; ACE_DEBUG ((LM_DEBUG, @@ -312,7 +312,7 @@ run_main (int, ACE_TCHAR *[]) break; // Make sure there were no errors. - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); events += result; } @@ -347,8 +347,8 @@ run_main (int, ACE_TCHAR *[]) other_thread.activate (THR_NEW_LWP | THR_JOINABLE); status = ACE_Reactor::instance()->run_reactor_event_loop (time_limit); // Should have returned only because the time limit is up... - ACE_ASSERT (status != -1); - ACE_ASSERT (time_limit.sec () == 0); + ACE_TEST_ASSERT (status != -1); + ACE_TEST_ASSERT (time_limit.sec () == 0); status = other_thread.wait (); if (status == -1) @@ -357,7 +357,7 @@ run_main (int, ACE_TCHAR *[]) ACE_TEXT ("%p, errno is %d\n"), "wait ()", ACE_ERRNO_GET)); - ACE_ASSERT (status != -1); + ACE_TEST_ASSERT (status != -1); } status = other_thread.verify_results (); diff --git a/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp b/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp index fe502593970..111e1dceb2c 100644 --- a/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp +++ b/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp @@ -604,7 +604,7 @@ Connector::connect (ACE_HANDLE &client_handle, ACE_OS::sleep (pipe_retry_timeout); } - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); Receiver *receiver = @@ -628,7 +628,7 @@ Connector::connect (ACE_HANDLE &client_handle, ACE_Event_Handler_var safe_receiver (receiver); } - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); client_handle = @@ -678,7 +678,7 @@ Connection_Cache::add_connection (Sender *sender) // Make sure that the state of the connection cache is as // expected. <sender> should not be already in the cache. - ACE_ASSERT (this->find (sender) == -1); + ACE_TEST_ASSERT (this->find (sender) == -1); int empty_index = this->find (0); @@ -833,7 +833,7 @@ Invocation_Thread::create_connection (void) connector.connect (client_handle, server_handle, this->run_receiver_thread_); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); // Create a new sender. @@ -865,7 +865,7 @@ Invocation_Thread::create_connection (void) sender, ACE_Event_Handler::READ_MASK); #if 0 - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); #else if (result != 0) @@ -902,7 +902,7 @@ Invocation_Thread::svc (void) // connection has been created. int result = this->new_connection_event_.signal (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); ++connection_counter; @@ -1028,7 +1028,7 @@ Close_Socket_Thread::svc (void) int result = this->new_connection_event_.wait (&timeout, 0); - ACE_ASSERT (result == 0 || + ACE_TEST_ASSERT (result == 0 || (result == -1 && errno == ETIME)); if (result == -1 && @@ -1215,7 +1215,7 @@ testing (ACE_Reactor *reactor, result = invocation_thread.activate (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Create the thread for closing the server socket. Close_Socket_Thread close_socket_thread (thread_manager, @@ -1225,7 +1225,7 @@ testing (ACE_Reactor *reactor, run_receiver_thread); result = close_socket_thread.activate (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); global_event_loop_thread_variable = 0; @@ -1239,7 +1239,7 @@ testing (ACE_Reactor *reactor, result = event_loop_thread.activate (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } // Create a thread to run the purger. @@ -1250,12 +1250,12 @@ testing (ACE_Reactor *reactor, { result = purger_thread.activate (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } // Wait for threads to exit. result = thread_manager.wait (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Set the global variable to zero again because the // event_loop_thread exists on the stack and now diff --git a/ACE/tests/MT_Reference_Counted_Notify_Test.cpp b/ACE/tests/MT_Reference_Counted_Notify_Test.cpp index 031e7e93030..c2fc61a98a2 100644 --- a/ACE/tests/MT_Reference_Counted_Notify_Test.cpp +++ b/ACE/tests/MT_Reference_Counted_Notify_Test.cpp @@ -242,7 +242,7 @@ notify (ACE_Reactor &reactor, int result = event_loop_thread.activate (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); for (int i = 0; i < iterations; @@ -253,7 +253,7 @@ notify (ACE_Reactor &reactor, result = reactor.notify (event_handler, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } thread_manager.wait (); diff --git a/ACE/tests/MT_SOCK_Test.cpp b/ACE/tests/MT_SOCK_Test.cpp index 90e01fe6952..56fa9404da9 100644 --- a/ACE/tests/MT_SOCK_Test.cpp +++ b/ACE/tests/MT_SOCK_Test.cpp @@ -184,7 +184,7 @@ server (void *arg) ACE_DEBUG((LM_DEBUG, "(%P|%t) server: Waiting for connection...\n")); int result = ACE::handle_read_ready (peer_acceptor->get_handle (), &tv); - ACE_ASSERT (tv == def_timeout); + ACE_TEST_ASSERT (tv == def_timeout); if (result == -1) { @@ -248,7 +248,7 @@ server (void *arg) while ((r_bytes = new_stream.recv (buf, 1)) > 0) { - ACE_ASSERT (*t == buf[0]); + ACE_TEST_ASSERT (*t == buf[0]); t++; } diff --git a/ACE/tests/Malloc_Test.cpp b/ACE/tests/Malloc_Test.cpp index 1e84e853457..b38b7fb532a 100644 --- a/ACE/tests/Malloc_Test.cpp +++ b/ACE/tests/Malloc_Test.cpp @@ -203,8 +203,8 @@ initialize (MALLOC *allocator) long long_cont_1 = *lt->bpl_; long long_cont_2 = lt->bpl_[3]; - ACE_ASSERT (long_cont_1 == 1000); - ACE_ASSERT (long_cont_2 == 1003); + ACE_TEST_ASSERT (long_cont_1 == 1000); + ACE_TEST_ASSERT (long_cont_2 == 1003); ACE_ALLOCATOR_RETURN (ptr, allocator->malloc (sizeof (Long_Test)), @@ -223,8 +223,8 @@ initialize (MALLOC *allocator) long long_cont_3 = *lt->bpl_; long long_cont_4 = lt->bpl_[4]; - ACE_ASSERT (long_cont_3 == 2000); - ACE_ASSERT (long_cont_4 == 2004); + ACE_TEST_ASSERT (long_cont_3 == 2000); + ACE_TEST_ASSERT (long_cont_4 == 2004); return data2; } @@ -280,7 +280,7 @@ parent (Test_Data *data) myalloc->free (small_buf[cntr]); #endif /* ACE_TEST_REMAP_ON_FAULT */ - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); return 0; } @@ -369,7 +369,7 @@ run_main (int argc, ACE_TCHAR *argv[]) MALLOC *myalloc = myallocator (PARENT_BASE_ADDR); Test_Data *data = initialize (myalloc); - ACE_ASSERT (data != 0); + ACE_TEST_ASSERT (data != 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P) PARENT allocator at = %@, ") @@ -378,7 +378,7 @@ run_main (int argc, ACE_TCHAR *argv[]) data)); myalloc->dump (); int result = myalloc->bind ("foo", data); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_Process p; pid_t pid = p.spawn (options); @@ -395,7 +395,7 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("wait")), 1); - ACE_ASSERT (myalloc->ref_counter () == 1); + ACE_TEST_ASSERT (myalloc->ref_counter () == 1); myalloc->remove (); ACE_END_TEST; return 0; @@ -408,7 +408,7 @@ run_main (int argc, ACE_TCHAR *argv[]) void *data = 0; MALLOC *myalloc = myallocator (CHILD_BASE_ADDR); int result = myalloc->find ("foo", data); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P) CHILD allocator at = %@, ") diff --git a/ACE/tests/Mem_Map_Test.cpp b/ACE/tests/Mem_Map_Test.cpp index 81a496cbb00..9d1d56b76e6 100644 --- a/ACE/tests/Mem_Map_Test.cpp +++ b/ACE/tests/Mem_Map_Test.cpp @@ -261,7 +261,7 @@ run_main (int, ACE_TCHAR *[]) // Now do a memcmp -- the orig file and the second temporary file // should be identical. - ACE_ASSERT (ACE_OS::memcmp (temp_mmap2.addr (), + ACE_TEST_ASSERT (ACE_OS::memcmp (temp_mmap2.addr (), mmap.addr (), mmap.size ()) == 0); diff --git a/ACE/tests/Message_Queue_Notifications_Test.cpp b/ACE/tests/Message_Queue_Notifications_Test.cpp index 82aee8f7751..a57c4b31d2c 100644 --- a/ACE/tests/Message_Queue_Notifications_Test.cpp +++ b/ACE/tests/Message_Queue_Notifications_Test.cpp @@ -231,7 +231,7 @@ Watermark_Test::producer (void) // has dropped under the lwm. this->put_message (); - ACE_ASSERT (this->msg_queue ()-> message_bytes () <= this->lwm_ + this->len_); + ACE_TEST_ASSERT (this->msg_queue ()-> message_bytes () <= this->lwm_ + this->len_); this->print_producer_debug_message (); diff --git a/ACE/tests/Naming_Test.cpp b/ACE/tests/Naming_Test.cpp index ef37f403076..b6f219521c7 100644 --- a/ACE/tests/Naming_Test.cpp +++ b/ACE/tests/Naming_Test.cpp @@ -76,7 +76,7 @@ test_bind (ACE_Naming_Context &ns_context) ACE_OS::sprintf (type, "%s%d", "type", array [i]); int bind_result = ns_context.bind (w_name, w_value, type); - ACE_ASSERT (bind_result != -1); + ACE_TEST_ASSERT (bind_result != -1); } } @@ -92,7 +92,7 @@ test_find_failure (ACE_Naming_Context &ns_context) for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) { int resolve = ns_context.resolve (w_name, w_value, l_type); - ACE_ASSERT (resolve == -1); + ACE_TEST_ASSERT (resolve == -1); } } @@ -115,7 +115,7 @@ test_rebind (ACE_Naming_Context &ns_context) ACE_OS::sprintf (type, "%s%d", "type", -array[i]); int rebind = ns_context.rebind (w_name, w_value, type); - ACE_ASSERT (rebind != -1); + ACE_TEST_ASSERT (rebind != -1); } } @@ -133,7 +133,7 @@ test_unbind (ACE_Naming_Context &ns_context) ACE_OS::sprintf (name, "%s%d", "name", array[i]); ACE_NS_WString w_name (name); int unbind = ns_context.unbind (w_name); - ACE_ASSERT (unbind != -1); + ACE_TEST_ASSERT (unbind != -1); } } @@ -179,7 +179,7 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result) if (l_value) { - ACE_ASSERT (w_value == val); + ACE_TEST_ASSERT (w_value == val); if (ns_context.name_options ()->debug ()) { if (type_out) @@ -193,7 +193,7 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result) if (type_out) { - ACE_ASSERT (ACE_OS::strcmp (type_out, temp_type) == 0); + ACE_TEST_ASSERT (ACE_OS::strcmp (type_out, temp_type) == 0); delete[] type_out; } } diff --git a/ACE/tests/New_Fail_Test.cpp b/ACE/tests/New_Fail_Test.cpp index b90e8fbc19b..7375e624ba6 100644 --- a/ACE/tests/New_Fail_Test.cpp +++ b/ACE/tests/New_Fail_Test.cpp @@ -117,7 +117,7 @@ run_main (int, ACE_TCHAR *[]) } else { - ACE_ASSERT (blocks[i] == 0); + ACE_TEST_ASSERT (blocks[i] == 0); if (errno == ENOMEM) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_NEW failed properly at block %d\n"), @@ -152,7 +152,7 @@ run_main (int, ACE_TCHAR *[]) } else { - ACE_ASSERT (blocks[i] == 0); + ACE_TEST_ASSERT (blocks[i] == 0); if (errno == ENOMEM) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_NEW_RETURN failed properly at block %d\n"), @@ -185,7 +185,7 @@ run_main (int, ACE_TCHAR *[]) } else { - ACE_ASSERT (blocks[i] == 0); + ACE_TEST_ASSERT (blocks[i] == 0); if (errno == ENOMEM) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_NEW_NORETURN failed properly at block %d\n"), diff --git a/ACE/tests/NonBlocking_Conn_Test.cpp b/ACE/tests/NonBlocking_Conn_Test.cpp index 95db73ebc90..d85ce6ce1ba 100644 --- a/ACE/tests/NonBlocking_Conn_Test.cpp +++ b/ACE/tests/NonBlocking_Conn_Test.cpp @@ -143,7 +143,7 @@ test_connect (ACE_Reactor &reactor, synch_options); if (!synch_options[ACE_Synch_Options::USE_REACTOR]) - ACE_ASSERT (completion_counter == number_of_connections); + ACE_TEST_ASSERT (completion_counter == number_of_connections); if (complete_nonblocking_connections != Svc_Handler::Comp_NO) { diff --git a/ACE/tests/Object_Manager_Flipping_Test.cpp b/ACE/tests/Object_Manager_Flipping_Test.cpp index aa3f6066526..b42279aa767 100644 --- a/ACE/tests/Object_Manager_Flipping_Test.cpp +++ b/ACE/tests/Object_Manager_Flipping_Test.cpp @@ -81,14 +81,14 @@ int run_main (int, ACE_TCHAR *[]) // Obtain a SC instance which will be later used to compare with others. p1 = ACE_Service_Config::instance (); - // ACE_ASSERT uses Log_Msg::instance() and needs to be done only + // ACE_TEST_ASSERT uses Log_Msg::instance() and needs to be done only // after ACE_START_TEST // Additional ACE::init() should not have changed the context - ACE_ASSERT (p0 == p1); + ACE_TEST_ASSERT (p0 == p1); // It should appear open - ACE_ASSERT (!p0->is_opened ()); + ACE_TEST_ASSERT (!p0->is_opened ()); ACE_END_TEST; @@ -106,7 +106,7 @@ int run_main (int, ACE_TCHAR *[]) if (ACE_Service_Config::instance ()->is_opened ()) ++errors; - // Not using ACE_ASSERT because ACE is not initialized yet. + // Not using ACE_TEST_ASSERT because ACE is not initialized yet. { ACE::init(); @@ -114,10 +114,10 @@ int run_main (int, ACE_TCHAR *[]) ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> p2 (ACE_Service_Config::instance ()); - // ACE_ASSERT uses Log_Msg::instance() and needs to be done only + // ACE_TEST_ASSERT uses Log_Msg::instance() and needs to be done only // after ACE_START_TEST // An attempt to dereference should be fine. - ACE_ASSERT (!p2->is_opened ()); + ACE_TEST_ASSERT (!p2->is_opened ()); ACE_END_TEST; ACE::fini(); // Flipped twice diff --git a/ACE/tests/Pipe_Test.cpp b/ACE/tests/Pipe_Test.cpp index cbbc7c35acb..b40c756c789 100644 --- a/ACE/tests/Pipe_Test.cpp +++ b/ACE/tests/Pipe_Test.cpp @@ -80,10 +80,10 @@ open_pipe (ACE_Pipe &pipe, ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("opening %C\n"), name)); int result = pipe.open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); result = pipe.read_handle () != ACE_INVALID_HANDLE && pipe.write_handle () != ACE_INVALID_HANDLE; - ACE_ASSERT (result == 1); + ACE_TEST_ASSERT (result == 1); if (close_pipe) pipe.close (); diff --git a/ACE/tests/Priority_Buffer_Test.cpp b/ACE/tests/Priority_Buffer_Test.cpp index 1dbacd57997..885e01d63a5 100644 --- a/ACE/tests/Priority_Buffer_Test.cpp +++ b/ACE/tests/Priority_Buffer_Test.cpp @@ -73,8 +73,8 @@ consumer (void *args) { // This isn't a "shutdown" message, so process it // "normally." - ACE_ASSERT (c == *mb->rd_ptr ()); - ACE_ASSERT (mb->msg_priority () < cur_priority); + ACE_TEST_ASSERT (c == *mb->rd_ptr ()); + ACE_TEST_ASSERT (mb->msg_priority () < cur_priority); cur_priority = mb->msg_priority (); } @@ -88,7 +88,7 @@ consumer (void *args) break; } - ACE_ASSERT (local_count == message_count); + ACE_TEST_ASSERT (local_count == message_count); return 0; } diff --git a/ACE/tests/Proactor_Scatter_Gather_Test.cpp b/ACE/tests/Proactor_Scatter_Gather_Test.cpp index 8c4d5543bfa..24ed7f5d075 100644 --- a/ACE/tests/Proactor_Scatter_Gather_Test.cpp +++ b/ACE/tests/Proactor_Scatter_Gather_Test.cpp @@ -103,7 +103,7 @@ static int allocate_chunks_chain (ACE_Message_Block *&head_mb, } else { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return -1; } } @@ -375,7 +375,7 @@ Receiver::Receiver (Acceptor * acceptor, int index) Receiver::writer_ = new Writer; if (!Receiver::writer_) { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return; } } @@ -401,7 +401,7 @@ Receiver::~Receiver (void) if (this->partial_chunk_) { - ACE_ASSERT (0); // should not be getting here + ACE_TEST_ASSERT (0); // should not be getting here this->partial_chunk_->release (); } } @@ -449,7 +449,7 @@ Receiver::initiate_read_stream (void) ACE_Message_Block *head_mb = 0; if (-1 == allocate_chunks_chain (head_mb, number_of_new_chunks)) { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return -1; } @@ -504,7 +504,7 @@ Receiver::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) // On disconnect (error or 0 transferred), transfer whatever we have. // at this stage there should not be anything there - ACE_ASSERT (!this->partial_chunk_); + ACE_TEST_ASSERT (!this->partial_chunk_); // first, remove the empty chunks remove_empty_chunks (mb); @@ -557,7 +557,7 @@ Receiver::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) if (!result.error ()) this->initiate_read_stream (); else - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); } } else if (mb && !Receiver::writer_) @@ -775,7 +775,7 @@ Writer::initiate_write_file (void) // in the queues (1 to 2 chunks together), so let's force the merge size to 1. if (0 == merge_size) { - ACE_ASSERT (1 == odd_count && 1 >= even_count); + ACE_TEST_ASSERT (1 == odd_count && 1 >= even_count); merge_size = 1; } @@ -871,7 +871,7 @@ Writer::handle_write_file (const ACE_Asynch_Write_File::Result &result) if (0 == this->receiver_count_ && 0 == this->io_count_) { - ACE_ASSERT (0 == this->odd_chain_ && 0 == this->even_chain_); + ACE_TEST_ASSERT (0 == this->odd_chain_ && 0 == this->even_chain_); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Writer::handle_write_file") @@ -1155,7 +1155,7 @@ Sender::open (ACE_HANDLE handle, ACE_Message_Block &) int Sender::initiate_read_file (void) { - ACE_ASSERT (0 == this->file_offset_ % chunk_size); + ACE_TEST_ASSERT (0 == this->file_offset_ % chunk_size); static const size_t file_size = ACE_OS::filesize (input_file); @@ -1169,14 +1169,14 @@ Sender::initiate_read_file (void) if (!relevant_number_of_chunks) { - ACE_ASSERT (0); // Just 2 C it coming + ACE_TEST_ASSERT (0); // Just 2 C it coming return 0; } ACE_Message_Block *head_mb = 0; if (-1 == allocate_chunks_chain (head_mb, relevant_number_of_chunks)) { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return -1; } @@ -1292,9 +1292,9 @@ Sender::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) if (result.error () == 0 && result.bytes_transferred () != 0) // verify sent all - ACE_ASSERT (0 == mb->total_length ()); + ACE_TEST_ASSERT (0 == mb->total_length ()); else - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); free_chunks_chain (mb); @@ -1395,7 +1395,7 @@ run_main (int argc, ACE_TCHAR *argv[]) // Simplify, initial read with zero size if (-1 == acceptor.open (addr, 0, 1)) { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return -1; } } @@ -1404,7 +1404,7 @@ run_main (int argc, ACE_TCHAR *argv[]) { if (-1 == connector.open (1, ACE_Proactor::instance ())) { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return -1; } @@ -1414,7 +1414,7 @@ run_main (int argc, ACE_TCHAR *argv[]) connector.set_address (addr); if (-1 == connector.connect (addr)) { - ACE_ASSERT (0); + ACE_TEST_ASSERT (0); return -1; } } diff --git a/ACE/tests/Proactor_Test.cpp b/ACE/tests/Proactor_Test.cpp index dcdf7c1627c..2c0620a72c7 100644 --- a/ACE/tests/Proactor_Test.cpp +++ b/ACE/tests/Proactor_Test.cpp @@ -205,7 +205,7 @@ MyTask::create_proactor (ProactorType type_proactor, size_t max_op) this->lock_, -1); - ACE_ASSERT (this->proactor_ == 0); + ACE_TEST_ASSERT (this->proactor_ == 0); #if defined (ACE_WIN32) diff --git a/ACE/tests/Proactor_Test_IPV6.cpp b/ACE/tests/Proactor_Test_IPV6.cpp index fc0a6de80b4..c6de6ef20aa 100644 --- a/ACE/tests/Proactor_Test_IPV6.cpp +++ b/ACE/tests/Proactor_Test_IPV6.cpp @@ -205,7 +205,7 @@ MyTask::create_proactor (ProactorType type_proactor, size_t max_op) this->lock_, -1); - ACE_ASSERT (this->proactor_ == 0); + ACE_TEST_ASSERT (this->proactor_ == 0); #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) diff --git a/ACE/tests/Proactor_UDP_Test.cpp b/ACE/tests/Proactor_UDP_Test.cpp index 49bc63cedfe..d7398dbc725 100644 --- a/ACE/tests/Proactor_UDP_Test.cpp +++ b/ACE/tests/Proactor_UDP_Test.cpp @@ -199,7 +199,7 @@ MyTask::create_proactor (ProactorType type_proactor, size_t max_op) this->lock_, -1); - ACE_ASSERT (this->proactor_ == 0); + ACE_TEST_ASSERT (this->proactor_ == 0); #if defined (ACE_WIN32) diff --git a/ACE/tests/Process_Manual_Event_Test.cpp b/ACE/tests/Process_Manual_Event_Test.cpp index 85be15358fb..9da4d9d8229 100644 --- a/ACE/tests/Process_Manual_Event_Test.cpp +++ b/ACE/tests/Process_Manual_Event_Test.cpp @@ -80,7 +80,7 @@ acquire_release (void) ACE_Manual_Event event_pong (0, USYNC_PROCESS, event_pong_name); // Make sure the constructor succeeded - ACE_ASSERT (ACE_LOG_MSG->op_status () == 0); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P) Begin ping-pong\n"))); @@ -239,7 +239,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_TEST_ASSERT (wait_result != -1); if (child_status == 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Child %d finished ok\n"), diff --git a/ACE/tests/Process_Mutex_Test.cpp b/ACE/tests/Process_Mutex_Test.cpp index 76303956767..bc1a530c58f 100644 --- a/ACE/tests/Process_Mutex_Test.cpp +++ b/ACE/tests/Process_Mutex_Test.cpp @@ -79,7 +79,7 @@ acquire_release (void) ACE_Process_Mutex mutex (mutex_name); // Make sure the constructor succeeded - ACE_ASSERT (ACE_LOG_MSG->op_status () == 0); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () == 0); // To see if we really are the only holder of the mutex below, // we'll try to create a file with exclusive access. If the file @@ -90,7 +90,7 @@ acquire_release (void) // Grab the lock int mutex_acq = mutex.acquire (); - ACE_ASSERT (mutex_acq == 0); + ACE_TEST_ASSERT (mutex_acq == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P) Mutex acquired %s\n"), @@ -99,7 +99,7 @@ acquire_release (void) ACE_HANDLE checker_handle = ACE_OS::open (mutex_check, O_CREAT | O_EXCL); if (checker_handle == ACE_INVALID_HANDLE) { - ACE_ASSERT (errno != EEXIST); + ACE_TEST_ASSERT (errno != EEXIST); ACE_DEBUG ((LM_WARNING, ACE_TEXT ("(%P): %p\n"), ACE_TEXT ("checker file open"))); } @@ -122,7 +122,7 @@ acquire_release (void) ACE_TEXT ("(%P) Releasing the mutex %s\n"), mutex_name)); int mutex_release = mutex.release (); - ACE_ASSERT (mutex_release == 0); + ACE_TEST_ASSERT (mutex_release == 0); } } @@ -200,7 +200,7 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_exitcode child_status; // Wait for the child processes we created to exit. int wait_result = children[i].wait (&child_status); - ACE_ASSERT (wait_result != -1); + ACE_TEST_ASSERT (wait_result != -1); if (child_status == 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Child %d finished ok\n"), diff --git a/ACE/tests/Process_Semaphore_Test.cpp b/ACE/tests/Process_Semaphore_Test.cpp index 834db8bac56..3bf8d104d2c 100644 --- a/ACE/tests/Process_Semaphore_Test.cpp +++ b/ACE/tests/Process_Semaphore_Test.cpp @@ -90,7 +90,7 @@ acquire_release (void) #endif // Make sure the constructor succeeded - ACE_ASSERT (ACE_LOG_MSG->op_status () == 0); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P) Begin ping-pong\n"))); @@ -121,7 +121,7 @@ acquire_release (void) wait.sec (wait.sec () + 3); // timeout in 3 secs if (sema_pong.acquire (wait)) - ACE_ASSERT(errno == ETIME); + ACE_TEST_ASSERT(errno == ETIME); else ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P) Acquired pong without release()\n"))); @@ -156,7 +156,7 @@ acquire_release (void) if (sema_ping.acquire (wait)) { - ACE_ASSERT(errno == ETIME); + ACE_TEST_ASSERT(errno == ETIME); ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P) Acquiring pong timed out\n"))); } @@ -213,7 +213,7 @@ run_main (int argc, ACE_TCHAR *argv[]) // Spawn the child process. int result = child.spawn (options); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Parent spawned child process with pid = %d.\n"), child.getpid ())); @@ -223,7 +223,7 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_exitcode child_status; // Wait for the child processes we created to exit. - ACE_ASSERT (child.wait (&child_status) != -1); + ACE_TEST_ASSERT (child.wait (&child_status) != -1); if (child_status == 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Child %d finished ok\n"), diff --git a/ACE/tests/Process_Strategy_Test.cpp b/ACE/tests/Process_Strategy_Test.cpp index a7a09428bc2..ec92f62df05 100644 --- a/ACE/tests/Process_Strategy_Test.cpp +++ b/ACE/tests/Process_Strategy_Test.cpp @@ -249,7 +249,7 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) -1); break; #else - ACE_ASSERT ("PROCESS invalid on this platform" == 0); + ACE_TEST_ASSERT ("PROCESS invalid on this platform" == 0); #endif /* !defined (ACE_LACKS_FORK) */ case Options::THREAD: #if defined (ACE_HAS_THREADS) @@ -261,7 +261,7 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) -1); break; #else - ACE_ASSERT (!"THREAD invalid on this platform"); + ACE_TEST_ASSERT (!"THREAD invalid on this platform"); #endif /* !ACE_HAS_THREADS */ case Options::REACTIVE: // Settle for the purely Reactive strategy. diff --git a/ACE/tests/RB_Tree_Test.cpp b/ACE/tests/RB_Tree_Test.cpp index e42fac5dbb7..fd369d0d5ba 100644 --- a/ACE/tests/RB_Tree_Test.cpp +++ b/ACE/tests/RB_Tree_Test.cpp @@ -26,7 +26,7 @@ // // ============================================================================ -#include "test_config.h" /* Include first to enable ACE_ASSERT. */ +#include "test_config.h" /* Include first to enable ACE_TEST_ASSERT. */ #include "ace/RB_Tree.h" #include "ace/SString.h" #include "ace/Null_Mutex.h" diff --git a/ACE/tests/Reactor_Notify_Test.cpp b/ACE/tests/Reactor_Notify_Test.cpp index 8ba36ecf49e..2e9b635c77e 100644 --- a/ACE/tests/Reactor_Notify_Test.cpp +++ b/ACE/tests/Reactor_Notify_Test.cpp @@ -192,7 +192,7 @@ Supplier_Task::open (void *) int result; result = this->pipe_.open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // Register the pipe's write handle with the <Reactor> for writing. // This should mean that it's always "active." @@ -202,12 +202,12 @@ Supplier_Task::open (void *) (this->pipe_.write_handle (), this, ACE_Event_Handler::WRITE_MASK); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } // Make this an Active Object. result = this->activate (THR_BOUND | THR_DETACHED); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); return 0; } @@ -224,7 +224,7 @@ Supplier_Task::close (u_long) result = ACE_Reactor::instance ()->remove_handler (this->pipe_.write_handle (), ACE_Event_Handler::WRITE_MASK); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } else { @@ -233,7 +233,7 @@ Supplier_Task::close (u_long) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) waiting to be shutdown by main thread\n"))); result = this->waiter_.acquire (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } return 0; } @@ -278,7 +278,7 @@ Supplier_Task::perform_notifications (int notifications) ACE_TEXT ("(%t) %p\n"), ACE_TEXT ("notify"))); else - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } // Wait for our <handle_exception> method to release the @@ -287,7 +287,7 @@ Supplier_Task::perform_notifications (int notifications) && this->disable_notify_pipe_ == 0) { result = this->waiter_.acquire (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } } @@ -321,7 +321,7 @@ Supplier_Task::svc (void) int Supplier_Task::handle_exception (ACE_HANDLE handle) { - ACE_ASSERT (handle == ACE_INVALID_HANDLE); + ACE_TEST_ASSERT (handle == ACE_INVALID_HANDLE); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) handle_exception\n"))); @@ -332,7 +332,7 @@ Supplier_Task::handle_exception (ACE_HANDLE handle) int Supplier_Task::handle_output (ACE_HANDLE handle) { - ACE_ASSERT (handle == this->pipe_.write_handle ()); + ACE_TEST_ASSERT (handle == this->pipe_.write_handle ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) handle_output\n"))); @@ -371,17 +371,17 @@ run_test (int disable_notify_pipe, // Set the Singleton Reactor. ACE_Reactor *orig_reactor = ACE_Reactor::instance (reactor); - ACE_ASSERT (ACE_LOG_MSG->op_status () != -1); - ACE_ASSERT (ACE_Reactor::instance () == reactor); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () != -1); + ACE_TEST_ASSERT (ACE_Reactor::instance () == reactor); Supplier_Task task (disable_notify_pipe, tv); - ACE_ASSERT (ACE_LOG_MSG->op_status () != -1); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () != -1); int result; result = task.open (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); if (tv.sec () == LONG_TIMEOUT) // Sleep for a while so that the <ACE_Reactor>'s notification diff --git a/ACE/tests/Reactor_Timer_Test.cpp b/ACE/tests/Reactor_Timer_Test.cpp index 2351f43a467..8a564ebc2c2 100644 --- a/ACE/tests/Reactor_Timer_Test.cpp +++ b/ACE/tests/Reactor_Timer_Test.cpp @@ -84,7 +84,7 @@ Time_Handler::handle_timeout (const ACE_Time_Value &tv, { long current_count = static_cast<long> (reinterpret_cast<size_t> (arg)); if (current_count >= 0) - ACE_ASSERT (current_count == the_count); + ACE_TEST_ASSERT (current_count == the_count); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("[%x] Timer id %d with count #%d|%d timed out at %d!\n"), @@ -140,7 +140,7 @@ test_registering_all_handlers (void) ACE_Reactor::instance ()->schedule_timer (&rt[i], (const void *) i, ACE_Time_Value (2 * i + 1)); - ACE_ASSERT (t_id[i] != -1); + ACE_TEST_ASSERT (t_id[i] != -1); rt[i].timer_id (t_id[i]); } @@ -166,7 +166,7 @@ test_registering_one_handler (void) ACE_Reactor::instance ()->schedule_timer (&rt[0], (const void *) i, ACE_Time_Value (2 * i + 1)); - ACE_ASSERT (t_id[i] != -1); + ACE_TEST_ASSERT (t_id[i] != -1); } while (!done) @@ -191,7 +191,7 @@ test_canceling_odd_timers (void) t_id[i] = ACE_Reactor::instance ()->schedule_timer (&rt[i], (const void *) i, ACE_Time_Value (2 * i + 1)); - ACE_ASSERT (t_id[i] != -1); + ACE_TEST_ASSERT (t_id[i] != -1); rt[i].timer_id (t_id[i]); } @@ -231,7 +231,7 @@ test_resetting_timer_intervals (void) // Start off by making this an interval timer. ACE_Time_Value (1)); - ACE_ASSERT (t_id != -1); + ACE_TEST_ASSERT (t_id != -1); rt.timer_id (t_id); while (!done) diff --git a/ACE/tests/Reactors_Test.cpp b/ACE/tests/Reactors_Test.cpp index a59e592a92b..ae8575981a2 100644 --- a/ACE/tests/Reactors_Test.cpp +++ b/ACE/tests/Reactors_Test.cpp @@ -90,7 +90,7 @@ Test_Task::~Test_Task (void) ACE_TEXT ("(%t) TT- Test_Task::task_count_ = %d\n"), Test_Task::task_count_)); - ACE_ASSERT (Test_Task::task_count_ == 0); + ACE_TEST_ASSERT (Test_Task::task_count_ == 0); } int @@ -111,7 +111,7 @@ Test_Task::close (u_long) ACE_TEXT ("(%t) close Test_Task::task_count_ = %d\n"), Test_Task::task_count_)); - ACE_ASSERT (Test_Task::task_count_ >= 0); + ACE_TEST_ASSERT (Test_Task::task_count_ >= 0); return 0; } @@ -208,12 +208,12 @@ run_main (int, ACE_TCHAR *[]) ACE_START_TEST (ACE_TEXT ("Reactors_Test")); #if defined (ACE_HAS_THREADS) - ACE_ASSERT (ACE_LOG_MSG->op_status () != -1); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () != -1); thr_mgr = ACE_Thread_Manager::instance (); ACE_Reactor reactor; - ACE_ASSERT (ACE_LOG_MSG->op_status () != -1); + ACE_TEST_ASSERT (ACE_LOG_MSG->op_status () != -1); Test_Task tt1[MAX_TASKS]; Test_Task tt2[MAX_TASKS]; diff --git a/ACE/tests/Recursive_Mutex_Test.cpp b/ACE/tests/Recursive_Mutex_Test.cpp index f8e9d1c0f78..71565fa5bf2 100644 --- a/ACE/tests/Recursive_Mutex_Test.cpp +++ b/ACE/tests/Recursive_Mutex_Test.cpp @@ -77,7 +77,7 @@ test_recursion_depth (int nesting_level, } #endif /* !ACE_HAS_WTHREADS */ int result = rm->acquire (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); #if !defined (ACE_HAS_WTHREADS) if (nesting_level_supported && (nesting_level + 1) != rm->get_nesting_level ()) @@ -106,7 +106,7 @@ test_recursion_depth (int nesting_level, } #endif /* !ACE_HAS_WTHREADS */ result = rm->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); #if !defined (ACE_HAS_WTHREADS) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) = released, nesting = %d, thread id = %u\n"), @@ -186,7 +186,7 @@ test_timed_wait (int nesting_level, else { result = rm->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } // Now try the standard mutex. @@ -195,7 +195,7 @@ test_timed_wait (int nesting_level, ACE_TEXT ("(%P|%t) = trying to acquire on iteration %d\n"), i)); result = rm->acquire (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) = acquired on iteration %d\n"), i)); @@ -206,7 +206,7 @@ test_timed_wait (int nesting_level, ACE_OS::sleep (ACE_OS::rand () % 2); result = rm->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) = released on iteration %d\n"), i)); @@ -218,7 +218,7 @@ test_timed_wait (int nesting_level, { // Construct an ACE_Guard to implicitly acquire the mutex. ACE_Guard<ACE_TEST_MUTEX> guard (*rm); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. @@ -233,7 +233,7 @@ test_timed_wait (int nesting_level, { // Construct an ACE_Guard to implicitly acquire the mutex. ACE_Guard<ACE_TEST_MUTEX> guard (*rm); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. @@ -241,7 +241,7 @@ test_timed_wait (int nesting_level, // Release the mutex since we no longer need it. guard.release (); - ACE_ASSERT (guard.locked () == 0); + ACE_TEST_ASSERT (guard.locked () == 0); // Do something else which does not require the mutex to be locked. // ... @@ -258,7 +258,7 @@ test_timed_wait (int nesting_level, { // Construct an ACE_Guard to implicitly acquire the mutex. ACE_Guard<ACE_TEST_MUTEX> guard (*rm); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. @@ -267,13 +267,13 @@ test_timed_wait (int nesting_level, // Relinquish ownership of the mutex lock. Someone else must // now release it. guard.disown (); - ACE_ASSERT (guard.locked () == 0); + ACE_TEST_ASSERT (guard.locked () == 0); // ACE_Guard object's destructor will not release the mutex. } // We are now responsible for releasing the mutex. result = rm->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Construct an ACE_Guard without automatically acquiring the lock. { @@ -282,13 +282,13 @@ test_timed_wait (int nesting_level, // lock. The third parameter tells the guard that the mutex // has not been locked. ACE_Guard<ACE_TEST_MUTEX> guard (*rm, 0, 0); - ACE_ASSERT (guard.locked () == 0); + ACE_TEST_ASSERT (guard.locked () == 0); // Conditionally acquire the mutex. if (i % 2 == 0) { guard.acquire (); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); } // Perform some operation that might exit the current scope @@ -310,7 +310,7 @@ test_timed_wait (int nesting_level, // existing lock. The third parameter tells the guard that // the mutex has already been locked. ACE_Guard<ACE_TEST_MUTEX> guard (*rm, 0, 1); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. diff --git a/ACE/tests/SOCK_Send_Recv_Test_IPV6.cpp b/ACE/tests/SOCK_Send_Recv_Test_IPV6.cpp index 8a207aa19e5..b47fd383240 100644 --- a/ACE/tests/SOCK_Send_Recv_Test_IPV6.cpp +++ b/ACE/tests/SOCK_Send_Recv_Test_IPV6.cpp @@ -119,7 +119,7 @@ client (void *arg) Test_Result = 1; } else - ACE_ASSERT (len == 255); + ACE_TEST_ASSERT (len == 255); //******************* TEST 2 ****************************** // @@ -140,7 +140,7 @@ client (void *arg) ACE_TEXT ("(%P|%t) %p; len is %d, but should be 255!\n"), len)); } - ACE_ASSERT (len == 255); + ACE_TEST_ASSERT (len == 255); for (i = 0; i < 255; i++) if (buffer2[i] != buffer[i]) @@ -161,7 +161,7 @@ client (void *arg) ssize_t sent; char buff[Test3_Send_Size]; - ACE_ASSERT (cli_stream.enable (ACE_NONBLOCK) != -1); + ACE_TEST_ASSERT (cli_stream.enable (ACE_NONBLOCK) != -1); for (i = 0; i < Test3_Loops; ++i) { errno = 0; @@ -237,7 +237,7 @@ server (void *arg) Test_Result = 1; } - ACE_ASSERT (len == 255); + ACE_TEST_ASSERT (len == 255); for (i = 0; i < 255; i++) if (buffer[i] != i) { @@ -260,7 +260,7 @@ server (void *arg) 189, &buffer[231], 24); - ACE_ASSERT (len == 255); + ACE_TEST_ASSERT (len == 255); //******************* TEST 3 ****************************** // diff --git a/ACE/tests/SOCK_Test.cpp b/ACE/tests/SOCK_Test.cpp index 5c6f7b0c148..730f0afffec 100644 --- a/ACE/tests/SOCK_Test.cpp +++ b/ACE/tests/SOCK_Test.cpp @@ -122,7 +122,7 @@ server (void *arg) int result = ACE::handle_read_ready (peer_acceptor->get_handle (), &tv); - ACE_ASSERT (tv == def_timeout); + ACE_TEST_ASSERT (tv == def_timeout); if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("handle_read_ready")), 0); @@ -147,7 +147,7 @@ server (void *arg) while ((r_bytes = new_stream.recv (buf, 1)) > 0) { - ACE_ASSERT (*t == buf[0]); + ACE_TEST_ASSERT (*t == buf[0]); t++; } diff --git a/ACE/tests/SOCK_Test_IPv6.cpp b/ACE/tests/SOCK_Test_IPv6.cpp index 4da69395d6d..86e9f765a85 100644 --- a/ACE/tests/SOCK_Test_IPv6.cpp +++ b/ACE/tests/SOCK_Test_IPv6.cpp @@ -126,7 +126,7 @@ server (void *arg) int result = ACE_OS::select (select_width, handle_set, 0, 0, &tv); - ACE_ASSERT (tv == def_timeout); + ACE_TEST_ASSERT (tv == def_timeout); if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("select")), 0); @@ -169,7 +169,7 @@ server (void *arg) while ((r_bytes = new_stream.recv (buf, 1)) > 0) { - ACE_ASSERT (*t == buf[0]); + ACE_TEST_ASSERT (*t == buf[0]); t++; } diff --git a/ACE/tests/SPIPE_Test.cpp b/ACE/tests/SPIPE_Test.cpp index c7b71cc09bd..eb5b2d37df4 100644 --- a/ACE/tests/SPIPE_Test.cpp +++ b/ACE/tests/SPIPE_Test.cpp @@ -125,7 +125,7 @@ server (void *) while (new_stream.recv (buf, 1) > 0) { - ACE_ASSERT (*t == buf[0]); + ACE_TEST_ASSERT (*t == buf[0]); t++; } ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("End of connection. Closing handle\n"))); @@ -158,7 +158,7 @@ server (void *) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n%a"), ACE_TEXT ("recv"), 1)); break; } - ACE_ASSERT (*t == buf[0]); + ACE_TEST_ASSERT (*t == buf[0]); } // Wait for the client to stream in the buffer one byte at a time. @@ -170,7 +170,7 @@ server (void *) if (new_stream.recv (buf, sizeof(buf)) != (ssize_t) ACE_OS::strlen (ACE_ALPHABET)) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n%a"), ACE_TEXT ("recv"), 1)); else - ACE_ASSERT(ACE_OS::memcmp(ACE_ALPHABET, buf, ACE_OS::strlen (ACE_ALPHABET)) == 0); + ACE_TEST_ASSERT(ACE_OS::memcmp(ACE_ALPHABET, buf, ACE_OS::strlen (ACE_ALPHABET)) == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("End of connection. Closing handle\n"))); new_stream.close (); diff --git a/ACE/tests/SV_Shared_Memory_Test.cpp b/ACE/tests/SV_Shared_Memory_Test.cpp index 84f25220b48..022a1a06ddb 100644 --- a/ACE/tests/SV_Shared_Memory_Test.cpp +++ b/ACE/tests/SV_Shared_Memory_Test.cpp @@ -69,19 +69,19 @@ parent (char *shm) int result; result = parent_mutex->release (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); result = parent_synch->acquire (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); result = myallocator ().remove (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); result = parent_mutex->remove (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); result = parent_synch->remove (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); return 0; } @@ -98,7 +98,7 @@ child (char *shm) result = mutex.open (SEM_KEY_1, ACE_SV_Semaphore_Complex::ACE_CREATE, 0); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_SV_Semaphore_Complex synch; // This semaphore is initially created with a count of 0, i.e., it @@ -106,7 +106,7 @@ child (char *shm) result = synch.open (SEM_KEY_2, ACE_SV_Semaphore_Complex::ACE_CREATE, 0); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // Perform "busy waiting" here until we acquire the semaphore. This // isn't really a good design -- it's just to illustrate that you @@ -120,14 +120,14 @@ child (char *shm) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P) child mutex.tryacquire"))); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } for (int i = 0; i < SHMSZ; i++) - ACE_ASSERT (SHMDATA[i] == shm[i]); + ACE_TEST_ASSERT (SHMDATA[i] == shm[i]); result = synch.release (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); return 0; } @@ -166,14 +166,14 @@ run_main (int, ACE_TCHAR *[]) int result = parent_mutex->open (SEM_KEY_1, ACE_SV_Semaphore_Complex::ACE_CREATE, 0); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // This semaphore is initially created with a count of 0, i.e., it // is "locked." result = parent_synch->open (SEM_KEY_2, ACE_SV_Semaphore_Complex::ACE_CREATE, 0); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); switch (ACE_OS::fork (ACE_TEXT ("SV_Shared_Memory_Test.cpp"))) { diff --git a/ACE/tests/Sig_Handlers_Test.cpp b/ACE/tests/Sig_Handlers_Test.cpp index 16c3c10f9be..7fbab077ce7 100644 --- a/ACE/tests/Sig_Handlers_Test.cpp +++ b/ACE/tests/Sig_Handlers_Test.cpp @@ -46,12 +46,12 @@ public: ~Test_SIGINT_Handler() { - ACE_ASSERT (Test_SIGINT_Handler::handle_signal_count_ == Test_SIGINT_Handler::registration_count_); + ACE_TEST_ASSERT (Test_SIGINT_Handler::handle_signal_count_ == Test_SIGINT_Handler::registration_count_); } virtual int handle_signal (int signal, siginfo_t *, ucontext_t *) { - ACE_ASSERT (signal == SIGINT); + ACE_TEST_ASSERT (signal == SIGINT); ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Main::Test_SIGINT_Handler (%u) - %s\n"), this, @@ -85,7 +85,7 @@ public: virtual int handle_signal (int signal, siginfo_t *, ucontext_t *) { - ACE_ASSERT (signal == SIGINT); + ACE_TEST_ASSERT (signal == SIGINT); ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Main::Test_SIGINT_Shutdown_Handler (%u)\n"), this)); diff --git a/ACE/tests/Signal_Test.cpp b/ACE/tests/Signal_Test.cpp index 2e5401c9faf..89f983e1b82 100644 --- a/ACE/tests/Signal_Test.cpp +++ b/ACE/tests/Signal_Test.cpp @@ -104,7 +104,7 @@ handle_signal (int signum) #endif int const result = ACE_OS::kill (child_pid, SIGTERM); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); return -1; } @@ -236,7 +236,7 @@ worker_child (void *arg) ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("kill"))); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } } } @@ -250,7 +250,7 @@ worker_child (void *arg) // We need to do this to dislodge the signal handling thread if // it hasn't shut down on its own accord yet. int const result = ACE_OS::kill (ACE_OS::getpid (), SIGINT); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } } ACE_DEBUG ((LM_DEBUG, @@ -362,7 +362,7 @@ run_test (ACE_THR_FUNC worker, (worker, reinterpret_cast <void *> (handle_signals_synchronously), THR_DETACHED); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); if (handle_signals_in_separate_thread) { @@ -373,7 +373,7 @@ run_test (ACE_THR_FUNC worker, (synchronous_signal_handler, 0, THR_DETACHED); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } else { @@ -382,7 +382,7 @@ run_test (ACE_THR_FUNC worker, // Wait for the thread(s) to finish. result = ACE_Thread_Manager::instance ()->wait (); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } else #else diff --git a/ACE/tests/Sigset_Ops_Test.cpp b/ACE/tests/Sigset_Ops_Test.cpp index 94da36d24ee..397e5911042 100644 --- a/ACE/tests/Sigset_Ops_Test.cpp +++ b/ACE/tests/Sigset_Ops_Test.cpp @@ -48,7 +48,7 @@ siglistset (sigset_t x, int *sigset, int can_miss = 0) i)); result = 1; } - ACE_ASSERT ((sigset [i] ? result > 0 : result <= 0)) ; + ACE_TEST_ASSERT ((sigset [i] ? result > 0 : result <= 0)) ; } if (empty) @@ -140,7 +140,7 @@ run_main (int, ACE_TCHAR *[]) // that fall into this catagory, please let me know. Thanks. ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Now testing invalid sigset. If your platform gets a \nsegmentation fault, then it doesn't check the error properly.\n"))) ; - ACE_ASSERT (ACE_OS::sigfillset (0) < 0 && ACE_OS::last_error () == EFAULT) ; + ACE_TEST_ASSERT (ACE_OS::sigfillset (0) < 0 && ACE_OS::last_error () == EFAULT) ; */ ACE_END_TEST; diff --git a/ACE/tests/TP_Reactor_Test.cpp b/ACE/tests/TP_Reactor_Test.cpp index 1decbbedcef..c6f4536905d 100644 --- a/ACE/tests/TP_Reactor_Test.cpp +++ b/ACE/tests/TP_Reactor_Test.cpp @@ -158,7 +158,7 @@ MyTask::create_reactor (void) this->lock_, -1); - ACE_ASSERT (this->my_reactor_ == 0); + ACE_TEST_ASSERT (this->my_reactor_ == 0); ACE_TP_Reactor * pImpl = 0; diff --git a/ACE/tests/TSS_Test.cpp b/ACE/tests/TSS_Test.cpp index eb7aa00e770..1426d799101 100644 --- a/ACE/tests/TSS_Test.cpp +++ b/ACE/tests/TSS_Test.cpp @@ -163,7 +163,7 @@ worker (void *c) { // Use the guard to serialize access ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, output_lock, 0)); - ACE_ASSERT ((*tss_error)->flags () == ITERATIONS); + ACE_TEST_ASSERT ((*tss_error)->flags () == ITERATIONS); } // Demonstrate use of ACE_TSS_Type_Adapter to wrap built-in diff --git a/ACE/tests/Task_Ex_Test.cpp b/ACE/tests/Task_Ex_Test.cpp index e2b33b8ecd3..332cf4b4118 100644 --- a/ACE/tests/Task_Ex_Test.cpp +++ b/ACE/tests/Task_Ex_Test.cpp @@ -73,7 +73,7 @@ int Consumer::svc () User_Defined_Msg* pMsg=0; while(this->getq (pMsg)!=-1) { - ACE_ASSERT (pMsg!=0); + ACE_TEST_ASSERT (pMsg!=0); auto_ptr<User_Defined_Msg> pAuto(pMsg); ACE_DEBUG((LM_DEBUG, ACE_TEXT("Consumer::svc got msg id=%d\n"), @@ -93,7 +93,7 @@ int Consumer::svc () ACE_THR_FUNC_RETURN producer (void *arg) { Consumer* c = static_cast<Consumer*> (arg); - ACE_ASSERT(c!=0); + ACE_TEST_ASSERT(c!=0); if (c==0) { ACE_ERROR((LM_ERROR, diff --git a/ACE/tests/Thread_Manager_Test.cpp b/ACE/tests/Thread_Manager_Test.cpp index c11ea2fd16b..697b645685d 100644 --- a/ACE/tests/Thread_Manager_Test.cpp +++ b/ACE/tests/Thread_Manager_Test.cpp @@ -331,7 +331,7 @@ run_main (int, ACE_TCHAR *[]) #endif /* ACE_HAS_VXTHREADS */ ); - ACE_ASSERT (grp_id != -1); + ACE_TEST_ASSERT (grp_id != -1); thread_start->wait (); // Wait for 1 second and then suspend every thread in the group. @@ -403,16 +403,16 @@ run_main (int, ACE_TCHAR *[]) SIGINT); #elif !defined (ACE_HAS_PTHREADS_DRAFT4) && !defined(ACE_LACKS_PTHREAD_KILL) #if defined (CHORUS) - ACE_ASSERT (thr_mgr->kill_grp (grp_id, + ACE_TEST_ASSERT (thr_mgr->kill_grp (grp_id, SIGTHREADKILL) != -1); #else - ACE_ASSERT (thr_mgr->kill_grp (grp_id, + ACE_TEST_ASSERT (thr_mgr->kill_grp (grp_id, SIGINT) != -1); #endif /* CHORUS */ #else if (thr_mgr->kill_grp (grp_id, SIGINT) == -1) - ACE_ASSERT (errno == ENOTSUP); + ACE_TEST_ASSERT (errno == ENOTSUP); #endif /* ACE_HAS_WTHREADS */ // Wait and then cancel all the threads. @@ -421,7 +421,7 @@ run_main (int, ACE_TCHAR *[]) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) cancelling group\n"))); - ACE_ASSERT (thr_mgr->cancel_grp (grp_id) != -1); + ACE_TEST_ASSERT (thr_mgr->cancel_grp (grp_id) != -1); // Perform a barrier wait until all the threads have shut down. // But, wait for a limited time, just in case. diff --git a/ACE/tests/Thread_Mutex_Test.cpp b/ACE/tests/Thread_Mutex_Test.cpp index 601548558a9..73893c8a8d3 100644 --- a/ACE/tests/Thread_Mutex_Test.cpp +++ b/ACE/tests/Thread_Mutex_Test.cpp @@ -101,7 +101,7 @@ test (void *args) else { result = mutex->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } // Now try the standard mutex. @@ -110,7 +110,7 @@ test (void *args) ACE_TEXT ("(%P|%t) = trying to acquire on iteration %d\n"), i)); result = mutex->acquire (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) = acquired on iteration %d\n"), i)); @@ -121,7 +121,7 @@ test (void *args) ACE_OS::sleep (ACE_OS::rand () % 2); result = mutex->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) = released on iteration %d\n"), i)); @@ -133,7 +133,7 @@ test (void *args) { // Construct an ACE_Guard to implicitly acquire the mutex. ACE_Guard<ACE_TEST_MUTEX> guard (*mutex); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. @@ -148,7 +148,7 @@ test (void *args) { // Construct an ACE_Guard to implicitly acquire the mutex. ACE_Guard<ACE_TEST_MUTEX> guard (*mutex); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. @@ -156,7 +156,7 @@ test (void *args) // Release the mutex since we no longer need it. guard.release (); - ACE_ASSERT (guard.locked () == 0); + ACE_TEST_ASSERT (guard.locked () == 0); // Do something else which does not require the mutex to be locked. // ... @@ -173,7 +173,7 @@ test (void *args) { // Construct an ACE_Guard to implicitly acquire the mutex. ACE_Guard<ACE_TEST_MUTEX> guard (*mutex); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. @@ -182,13 +182,13 @@ test (void *args) // Relinquish ownership of the mutex lock. Someone else must // now release it. guard.disown (); - ACE_ASSERT (guard.locked () == 0); + ACE_TEST_ASSERT (guard.locked () == 0); // ACE_Guard object's destructor will not release the mutex. } // We are now responsible for releasing the mutex. result = mutex->release (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Construct an ACE_Guard without automatically acquiring the lock. { @@ -197,13 +197,13 @@ test (void *args) // lock. The third parameter tells the guard that the mutex // has not been locked. ACE_Guard<ACE_TEST_MUTEX> guard (*mutex, 0, 0); - ACE_ASSERT (guard.locked () == 0); + ACE_TEST_ASSERT (guard.locked () == 0); // Conditionally acquire the mutex. if (i % 2 == 0) { guard.acquire (); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); } // Perform some operation that might exit the current scope @@ -225,7 +225,7 @@ test (void *args) // existing lock. The third parameter tells the guard that // the mutex has already been locked. ACE_Guard<ACE_TEST_MUTEX> guard (*mutex, 0, 1); - ACE_ASSERT (guard.locked () != 0); + ACE_TEST_ASSERT (guard.locked () != 0); // Perform some operation which might exit the current scope // prematurely, e.g. by returning or throwing an exception. diff --git a/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp b/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp index dccb2e7bda9..aae9b72f1a7 100644 --- a/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp +++ b/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp @@ -310,7 +310,7 @@ worker (void *) int grp = ACE_Thread_Manager::instance ()->spawn_n (cli_thrno, &cli_worker, buf); - ACE_ASSERT (grp != -1); + ACE_TEST_ASSERT (grp != -1); ACE_Thread_Manager::instance ()->wait_grp (grp); diff --git a/ACE/tests/Thread_Pool_Reactor_Test.cpp b/ACE/tests/Thread_Pool_Reactor_Test.cpp index 02dc4a45169..a1a54fd8203 100644 --- a/ACE/tests/Thread_Pool_Reactor_Test.cpp +++ b/ACE/tests/Thread_Pool_Reactor_Test.cpp @@ -268,7 +268,7 @@ worker (void *) int grp = ACE_Thread_Manager::instance ()->spawn_n (cli_thrno, &cli_worker, buf); - ACE_ASSERT (grp != -1); + ACE_TEST_ASSERT (grp != -1); ACE_Thread_Manager::instance ()->wait_grp (grp); diff --git a/ACE/tests/Thread_Pool_Test.cpp b/ACE/tests/Thread_Pool_Test.cpp index 3284d571ebb..1544503131b 100644 --- a/ACE/tests/Thread_Pool_Test.cpp +++ b/ACE/tests/Thread_Pool_Test.cpp @@ -127,7 +127,7 @@ Thread_Pool::svc (void) int result = this->getq (mb); - ACE_ASSERT (result != -1 || errno == ESHUTDOWN); + ACE_TEST_ASSERT (result != -1 || errno == ESHUTDOWN); if (result == -1 && errno == ESHUTDOWN) { diff --git a/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp b/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp index 6b74e4a81da..4531451ac83 100644 --- a/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp +++ b/ACE/tests/Thread_Timer_Queue_Adapter_Test.cpp @@ -201,7 +201,7 @@ run_main (int, ACE_TCHAR *[]) ACE_OS::gettimeofday() + ACE_Time_Value(1, 0)); ACE_OS::sleep(ACE_Time_Value(1, 100 * 1000)); - ACE_ASSERT(iCallCount == 1); + ACE_TEST_ASSERT(iCallCount == 1); delete p_TestEventHandler; @@ -228,7 +228,7 @@ run_main (int, ACE_TCHAR *[]) ACE_OS::sleep(ACE_Time_Value(1, 100 * 1000)); - ACE_ASSERT(iCallCount == 0); + ACE_TEST_ASSERT(iCallCount == 0); // Test event handler was deleted by the timer. @@ -253,12 +253,12 @@ run_main (int, ACE_TCHAR *[]) ACE_Time_Value(1, 0)); ACE_OS::sleep(ACE_Time_Value(3, 500 * 1000)); - ACE_ASSERT(iCallCount == 3); + ACE_TEST_ASSERT(iCallCount == 3); // Cancel the repeating timer TimerWheelThreadAdapter.cancel(lTimerHandle); - ACE_ASSERT(iCallCount == 3); + ACE_TEST_ASSERT(iCallCount == 3); ACE_DEBUG((LM_DEBUG, ACE_TEXT("%I(%t) Success in Repeating timer with cancellation test.\n"))); @@ -290,7 +290,7 @@ run_main (int, ACE_TCHAR *[]) ACE_OS::gettimeofday() + ACE_Time_Value(2, 0)); ACE_OS::sleep(ACE_Time_Value(3, 0)); - ACE_ASSERT(iCallCount == 3); + ACE_TEST_ASSERT(iCallCount == 3); delete p_TestEventHandler; diff --git a/ACE/tests/Time_Value_Test.cpp b/ACE/tests/Time_Value_Test.cpp index f7508a881a5..04bdde58e22 100644 --- a/ACE/tests/Time_Value_Test.cpp +++ b/ACE/tests/Time_Value_Test.cpp @@ -59,70 +59,70 @@ run_main (int, ACE_TCHAR *[]) ACE_Time_Value tv9; tv9 = tv6; - ACE_ASSERT (tv1 == ACE_Time_Value (0)); - ACE_ASSERT (tv2 < tv3); - ACE_ASSERT (tv2 <= tv2); - ACE_ASSERT (tv2 >= tv4); - ACE_ASSERT (tv5 >= tv6); - ACE_ASSERT (tv2 == ACE_Time_Value (1, 1000000)); - ACE_ASSERT (tv5 == tv4); - ACE_ASSERT (tv2 == tv4); - ACE_ASSERT (tv1 != tv2); - ACE_ASSERT (tv6 == tv1); - ACE_ASSERT (tv5 == tv7); - ACE_ASSERT (tv7 == tv8); // That's right! See above . . . - ACE_ASSERT (tv9 == tv6); + ACE_TEST_ASSERT (tv1 == ACE_Time_Value (0)); + ACE_TEST_ASSERT (tv2 < tv3); + ACE_TEST_ASSERT (tv2 <= tv2); + ACE_TEST_ASSERT (tv2 >= tv4); + ACE_TEST_ASSERT (tv5 >= tv6); + ACE_TEST_ASSERT (tv2 == ACE_Time_Value (1, 1000000)); + ACE_TEST_ASSERT (tv5 == tv4); + ACE_TEST_ASSERT (tv2 == tv4); + ACE_TEST_ASSERT (tv1 != tv2); + ACE_TEST_ASSERT (tv6 == tv1); + ACE_TEST_ASSERT (tv5 == tv7); + ACE_TEST_ASSERT (tv7 == tv8); // That's right! See above . . . + ACE_TEST_ASSERT (tv9 == tv6); ACE_Time_Value tv10 (1); - ACE_ASSERT (tv10.sec() == 1); + ACE_TEST_ASSERT (tv10.sec() == 1); // test multiplication by double // test simple multiplication tv1.set (1, 1); tv2.set (2, 2); tv1 *= 2.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); tv1.set (1, 1); tv2.set (static_cast<time_t> (-2), static_cast<suseconds_t> (-2)); tv1 *= -2.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); // test usec shift tv1.set (1, 999999); tv2.set (19, 999990); tv1 *= 10.0; - ACE_ASSERT ( tv1 == tv2); + ACE_TEST_ASSERT ( tv1 == tv2); tv1.set (1, 999999); tv2.set (static_cast<time_t> (-19), -999990); tv1 *= -10.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); const time_t max_time_t = ACE_Numeric_Limits<time_t>::max (); const time_t min_time_t = ACE_Numeric_Limits<time_t>::min (); // test protection against overflows - // ACE_ASSERT( ACE_Time_Value(max_time_t,ACE_ONE_SECOND_IN_USECS) != ACE_Time_Value(ACE_Numeric_Limits<time_t>::min()) ); + // ACE_TEST_ASSERT( ACE_Time_Value(max_time_t,ACE_ONE_SECOND_IN_USECS) != ACE_Time_Value(ACE_Numeric_Limits<time_t>::min()) ); // test saturated result tv1.set (max_time_t - 1, 499999); tv2.set (max_time_t, 999999); // ACE_Time_Value::max_time tv1 *= 10.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); tv1.set (max_time_t - 1, 499999); tv2.set (min_time_t, -999999); tv1 *= -10.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); // test results near limits tv1.set ((max_time_t >> 1), 499999); tv2.set ((-(max_time_t >> 1) << 1), -999998); tv1 *= -2.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); tv1.set (max_time_t >> 1, 499999); tv2.set (((max_time_t >> 1) << 1), 999998); tv1 *= 2.0; - ACE_ASSERT (tv1 == tv2); + ACE_TEST_ASSERT (tv1 == tv2); // Test correct msec() convert; also checks for compile error reported in // Bugzilla 3336. @@ -163,22 +163,22 @@ run_main (int, ACE_TCHAR *[]) #ifdef ACE_HAS_CPP98_IOSTREAMS std::ostringstream ost; ost << ACE_Time_Value(1); - ACE_ASSERT( ost.str() == "1" ); + ACE_TEST_ASSERT( ost.str() == "1" ); ost.str(""); ost << ACE_Time_Value(1,1); - ACE_ASSERT( ost.str() == "1.000001" ); + ACE_TEST_ASSERT( ost.str() == "1.000001" ); ost.str(""); ost << ACE_Time_Value(static_cast<time_t>(-1),-1); - ACE_ASSERT( ost.str() == "-1.000001" ); + ACE_TEST_ASSERT( ost.str() == "-1.000001" ); ost.str(""); ost << ACE_Time_Value(0,1); - ACE_ASSERT( ost.str() == "0.000001" ); + ACE_TEST_ASSERT( ost.str() == "0.000001" ); ost.str(""); ost << ACE_Time_Value(0,-1); - ACE_ASSERT( ost.str() == "-0.000001" ); + ACE_TEST_ASSERT( ost.str() == "-0.000001" ); ost.str(""); ost << ACE_Time_Value(); - ACE_ASSERT( ost.str() == "0" ); + ACE_TEST_ASSERT( ost.str() == "0" ); #endif ACE_END_TEST; diff --git a/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp b/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp index 52b41929bec..0faa97b9b2f 100644 --- a/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp +++ b/ACE/tests/Timer_Queue_Reference_Counting_Test.cpp @@ -87,7 +87,7 @@ Reference_Counted_Event_Handler::~Reference_Counted_Event_Handler (void) this->reference_count_.value ())); if (this->expected_number_of_handle_close_calls_ != -1) - ACE_ASSERT (this->number_of_handle_close_calls_ == + ACE_TEST_ASSERT (this->number_of_handle_close_calls_ == this->expected_number_of_handle_close_calls_); } @@ -157,7 +157,7 @@ cancellation (ACE_Timer_Queue &timer_queue, one_second_timeout, ACE_Time_Value (1) + timer_queue.gettimeofday (), ACE_Time_Value (1)); - ACE_ASSERT (first_timer_id != -1); + ACE_TEST_ASSERT (first_timer_id != -1); } else { @@ -165,7 +165,7 @@ cancellation (ACE_Timer_Queue &timer_queue, timer_queue.schedule (handler, one_second_timeout, ACE_Time_Value (1) + timer_queue.gettimeofday ()); - ACE_ASSERT (first_timer_id != -1); + ACE_TEST_ASSERT (first_timer_id != -1); } if (second_timer) @@ -175,7 +175,7 @@ cancellation (ACE_Timer_Queue &timer_queue, two_second_timeout, ACE_Time_Value (2) + timer_queue.gettimeofday (), ACE_Time_Value (2)); - ACE_ASSERT (second_timer_id != -1); + ACE_TEST_ASSERT (second_timer_id != -1); } if (cancel_handler) @@ -185,9 +185,9 @@ cancellation (ACE_Timer_Queue &timer_queue, dont_call_handle_close); if (second_timer) - ACE_ASSERT (result == 2); + ACE_TEST_ASSERT (result == 2); else - ACE_ASSERT (result == 1); + ACE_TEST_ASSERT (result == 1); } else { @@ -195,7 +195,7 @@ cancellation (ACE_Timer_Queue &timer_queue, timer_queue.cancel (first_timer_id, 0, dont_call_handle_close); - ACE_ASSERT (result == 1); + ACE_TEST_ASSERT (result == 1); if (second_timer) { @@ -203,7 +203,7 @@ cancellation (ACE_Timer_Queue &timer_queue, timer_queue.cancel (second_timer_id, 0, dont_call_handle_close); - ACE_ASSERT (result == 1); + ACE_TEST_ASSERT (result == 1); } } } @@ -317,13 +317,13 @@ expire (ACE_Timer_Queue &timer_queue, one_second_timeout, ACE_Time_Value (1) + timer_queue.gettimeofday (), ACE_Time_Value (1)); - ACE_ASSERT (timer_id != -1); + ACE_TEST_ASSERT (timer_id != -1); result = timer_queue.schedule (handler, two_second_timeout, ACE_Time_Value (2) + timer_queue.gettimeofday ()); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); events += 4; @@ -334,7 +334,7 @@ expire (ACE_Timer_Queue &timer_queue, result = expire_function (timer_queue); - ACE_ASSERT (result >= 0); + ACE_TEST_ASSERT (result >= 0); i += result; } @@ -453,13 +453,13 @@ simple (ACE_Timer_Queue &timer_queue) one_second_timeout, ACE_Time_Value (1) + timer_queue.gettimeofday (), ACE_Time_Value (1)); - ACE_ASSERT (timer_id != -1); + ACE_TEST_ASSERT (timer_id != -1); result = timer_queue.cancel (timer_id, 0, 0); - ACE_ASSERT (result == 1); + ACE_TEST_ASSERT (result == 1); } { @@ -471,7 +471,7 @@ simple (ACE_Timer_Queue &timer_queue) one_second_timeout, ACE_Time_Value (1) + timer_queue.gettimeofday (), ACE_Time_Value (1)); - ACE_ASSERT (timer_id != -1); + ACE_TEST_ASSERT (timer_id != -1); events += 3; } @@ -483,7 +483,7 @@ simple (ACE_Timer_Queue &timer_queue) result = timer_queue.expire (); - ACE_ASSERT (result >= 0); + ACE_TEST_ASSERT (result >= 0); i += result; } diff --git a/ACE/tests/Timer_Queue_Test.cpp b/ACE/tests/Timer_Queue_Test.cpp index a16e3ecfcc0..88e1f6b7c02 100644 --- a/ACE/tests/Timer_Queue_Test.cpp +++ b/ACE/tests/Timer_Queue_Test.cpp @@ -64,7 +64,7 @@ public: virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask mask) { - ACE_ASSERT (mask == ACE_Event_Handler::TIMER_MASK); + ACE_TEST_ASSERT (mask == ACE_Event_Handler::TIMER_MASK); this->close_count_++; return 0; } @@ -73,7 +73,7 @@ public: const void *arg) { int *act = (int *) arg; - ACE_ASSERT (*act == 42 || *act == 007); + ACE_TEST_ASSERT (*act == 42 || *act == 007); int result = 0; if (*act == 007) @@ -118,7 +118,7 @@ test_interval_timer (ACE_Timer_Queue *tq) NUM_INTERVAL_FIRINGS + 1 /* for the first immediate firing */; long id = tq->schedule (&ih, 0 /* no act */, ACE_Time_Value::zero, interval); - ACE_ASSERT (id != -1); + ACE_TEST_ASSERT (id != -1); do { @@ -142,8 +142,8 @@ test_functionality (ACE_Timer_Queue *tq) { Example_Handler eh; - ACE_ASSERT (tq->is_empty () != 0); - ACE_ASSERT (ACE_Time_Value::zero == ACE_Time_Value (0)); + ACE_TEST_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (ACE_Time_Value::zero == ACE_Time_Value (0)); long timer_id; long timer_id2; @@ -160,68 +160,68 @@ test_functionality (ACE_Timer_Queue *tq) timer_id2 = tq->schedule (&eh, timer_act, tq->gettimeofday ()); long result = tq->earliest_time () == earliest_time; - ACE_ASSERT (result != 0); + ACE_TEST_ASSERT (result != 0); tq->cancel (timer_id, &timer_act); delete (int *) timer_act; tq->cancel (timer_id2, &timer_act); delete (int *) timer_act; - ACE_ASSERT (tq->is_empty () == 1); - ACE_ASSERT (eh.close_count_ == 0); + ACE_TEST_ASSERT (tq->is_empty () == 1); + ACE_TEST_ASSERT (eh.close_count_ == 0); ACE_NEW (timer_act, int (1)); timer_id = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (timer_id != -1); - ACE_ASSERT (tq->is_empty () == 0); //== + ACE_TEST_ASSERT (timer_id != -1); + ACE_TEST_ASSERT (tq->is_empty () == 0); //== ACE_NEW (timer_act, int (42)); result = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (result != -1); - ACE_ASSERT (tq->is_empty () == 0); //== + ACE_TEST_ASSERT (result != -1); + ACE_TEST_ASSERT (tq->is_empty () == 0); //== ACE_NEW (timer_act, int (42)); result = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (result != -1); - ACE_ASSERT (tq->is_empty () == 0); //== + ACE_TEST_ASSERT (result != -1); + ACE_TEST_ASSERT (tq->is_empty () == 0); //== // The following method will trigger a call to <handle_close>. - ACE_ASSERT (eh.close_count_ == 0); + ACE_TEST_ASSERT (eh.close_count_ == 0); result = tq->cancel (timer_id, &timer_act, 0); - ACE_ASSERT (result == 1); + ACE_TEST_ASSERT (result == 1); delete (int *) timer_act; - ACE_ASSERT (tq->is_empty () == 0); - ACE_ASSERT (eh.close_count_ == 1); + ACE_TEST_ASSERT (tq->is_empty () == 0); + ACE_TEST_ASSERT (eh.close_count_ == 1); result = tq->expire (); - ACE_ASSERT (result == 2); + ACE_TEST_ASSERT (result == 2); ACE_NEW (timer_act, int (007)); result = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); const void *timer_act1 = 0; ACE_NEW (timer_act1, int (42)); result = tq->schedule (&eh, timer_act1, tq->gettimeofday () + ACE_Time_Value (100)); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); const void *timer_act2 = 0; ACE_NEW (timer_act2, int (42)); result = tq->schedule (&eh, timer_act2, tq->gettimeofday () + ACE_Time_Value (100)); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); // The following will trigger a call to <handle_close> when it // cancels the second timer. This happens because the first timer @@ -229,13 +229,13 @@ test_functionality (ACE_Timer_Queue *tq) // -1. Since -1 is returned, all timers that use <eh> will be // cancelled (and <handle_close> will only be called on the first // timer that is cancelled). - ACE_ASSERT (eh.close_count_ == 1); + ACE_TEST_ASSERT (eh.close_count_ == 1); result = tq->expire (); - ACE_ASSERT (result == 1); - ACE_ASSERT (eh.close_count_ == 2); + ACE_TEST_ASSERT (result == 1); + ACE_TEST_ASSERT (eh.close_count_ == 2); - ACE_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (tq->is_empty () != 0); delete (int *) timer_act2; delete (int *) timer_act1; @@ -243,71 +243,71 @@ test_functionality (ACE_Timer_Queue *tq) timer_id = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (timer_id != -1); + ACE_TEST_ASSERT (timer_id != -1); ACE_NEW (timer_act, int (4)); timer_id2 = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (timer_id2 != -1); + ACE_TEST_ASSERT (timer_id2 != -1); // The following method will trigger a call to <handle_close>. - ACE_ASSERT (eh.close_count_ == 2); + ACE_TEST_ASSERT (eh.close_count_ == 2); result = tq->cancel (timer_id, &timer_act); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); delete (int *) timer_act; result = tq->cancel (timer_id2, &timer_act); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); delete (int *) timer_act; - ACE_ASSERT (eh.close_count_ == 2); // Only one call to handle_close() even though two timers - ACE_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (eh.close_count_ == 2); // Only one call to handle_close() even though two timers + ACE_TEST_ASSERT (tq->is_empty () != 0); result = tq->expire (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // This tests to make sure that <handle_close> is called when there // is only one timer of the type in the queue - ACE_ASSERT (eh.close_count_ == 2); + ACE_TEST_ASSERT (eh.close_count_ == 2); ACE_NEW (timer_act, int (007)); result = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); result = tq->expire (); - ACE_ASSERT (result == 1); - ACE_ASSERT (eh.close_count_ == 3); + ACE_TEST_ASSERT (result == 1); + ACE_TEST_ASSERT (eh.close_count_ == 3); ACE_NEW (timer_act, int (6)); timer_id = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (timer_id != -1); + ACE_TEST_ASSERT (timer_id != -1); ACE_NEW (timer_act, int (7)); timer_id2 = tq->schedule (&eh, timer_act, tq->gettimeofday ()); - ACE_ASSERT (timer_id2 != -1); + ACE_TEST_ASSERT (timer_id2 != -1); - ACE_ASSERT (eh.close_count_ == 3); + ACE_TEST_ASSERT (eh.close_count_ == 3); result = tq->cancel (timer_id, &timer_act); - ACE_ASSERT (result == 1); - ACE_ASSERT (eh.close_count_ == 3); + ACE_TEST_ASSERT (result == 1); + ACE_TEST_ASSERT (eh.close_count_ == 3); delete (int *) timer_act; result = tq->cancel (timer_id2, &timer_act); - ACE_ASSERT (result == 1); - ACE_ASSERT (eh.close_count_ == 3); + ACE_TEST_ASSERT (result == 1); + ACE_TEST_ASSERT (eh.close_count_ == 3); delete (int *) timer_act; result = tq->expire (); - ACE_ASSERT (result == 0); - ACE_ASSERT (eh.close_count_ == 3); + ACE_TEST_ASSERT (result == 0); + ACE_TEST_ASSERT (eh.close_count_ == 3); } static void @@ -319,8 +319,8 @@ test_performance (ACE_Timer_Queue *tq, int i; const void *timer_act = 0; - ACE_ASSERT (tq->is_empty () != 0); - ACE_ASSERT (ACE_Time_Value::zero == ACE_Time_Value (0)); + ACE_TEST_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (ACE_Time_Value::zero == ACE_Time_Value (0)); // Test the amount of time required to schedule all the timers. @@ -341,10 +341,10 @@ test_performance (ACE_Timer_Queue *tq, timer_ids[i] = tq->schedule (&eh, timer_act, times[i]); - ACE_ASSERT (timer_ids[i] != -1); + ACE_TEST_ASSERT (timer_ids[i] != -1); } - ACE_ASSERT (tq->is_empty () == 0); + ACE_TEST_ASSERT (tq->is_empty () == 0); timer.stop (); @@ -374,7 +374,7 @@ test_performance (ACE_Timer_Queue *tq, timer.stop (); - ACE_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (tq->is_empty () != 0); timer.elapsed_time (et); @@ -397,17 +397,17 @@ test_performance (ACE_Timer_Queue *tq, { ACE_NEW (timer_act, int (42)); long result = tq->schedule (&eh, timer_act, times[i]); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); } - ACE_ASSERT (tq->is_empty () == 0); + ACE_TEST_ASSERT (tq->is_empty () == 0); // Expire all the timers. tq->expire (last_time + ACE_Time_Value(1)); timer.stop (); - ACE_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (tq->is_empty () != 0); timer.elapsed_time (et); @@ -434,10 +434,10 @@ test_performance (ACE_Timer_Queue *tq, timer_ids[i] = tq->schedule (&eh, timer_act, times[i]); - ACE_ASSERT (timer_ids[i] != -1); + ACE_TEST_ASSERT (timer_ids[i] != -1); } - ACE_ASSERT (tq->is_empty () == 0); + ACE_TEST_ASSERT (tq->is_empty () == 0); timer.start (); @@ -447,7 +447,7 @@ test_performance (ACE_Timer_Queue *tq, delete (int *) timer_act; } - ACE_ASSERT (tq->is_empty () != 0); + ACE_TEST_ASSERT (tq->is_empty () != 0); timer.stop (); @@ -476,12 +476,12 @@ test_performance (ACE_Timer_Queue *tq, timer_ids[i] = tq->schedule (&eh, timer_act, times[i]); - ACE_ASSERT (timer_ids[i] != -1); + ACE_TEST_ASSERT (timer_ids[i] != -1); } timer.stop (); - ACE_ASSERT (tq->is_empty () == 0); + ACE_TEST_ASSERT (tq->is_empty () == 0); timer.elapsed_time (et); @@ -503,7 +503,7 @@ test_performance (ACE_Timer_Queue *tq, tq->expire (last_time + ACE_Time_Value(1)); - ACE_ASSERT (tq->is_empty ()); + ACE_TEST_ASSERT (tq->is_empty ()); timer.stop (); diff --git a/ACE/tests/Tokens_Test.cpp b/ACE/tests/Tokens_Test.cpp index cc97a1f5585..5c2f715d365 100644 --- a/ACE/tests/Tokens_Test.cpp +++ b/ACE/tests/Tokens_Test.cpp @@ -14,7 +14,7 @@ // collections. This is accomplished with the ACE Token Invariant // utilities that allow and application to check that // readers/writer and mutex lock invariants are always satisfied. -// Throughout this test, ACE_ASSERTs are used in conjunction with +// Throughout this test, ACE_TEST_ASSERTs are used in conjunction with // Token Invariant operations, so that errors are reported using // the ACE tests convention. This application performs a local // test and then fork_execs a token server and performs the same @@ -88,7 +88,7 @@ run_thread (void *vp) return (void *) -1; } - ACE_ASSERT ((TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1) || + ACE_TEST_ASSERT ((TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1) || (TOKEN_INVARIANTS::instance ()->acquired (tp->token2_) == 1)); ACE_DEBUG ((LM_DEBUG, @@ -111,7 +111,7 @@ run_thread (void *vp) return (void *) -1; } - ACE_ASSERT (TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1 || + ACE_TEST_ASSERT (TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1 || TOKEN_INVARIANTS::instance ()->acquired (tp->token2_) == 1); ACE_DEBUG ((LM_DEBUG, diff --git a/ACE/tests/UPIPE_SAP_Test.cpp b/ACE/tests/UPIPE_SAP_Test.cpp index c278d1a8df3..0c059cde7b3 100644 --- a/ACE/tests/UPIPE_SAP_Test.cpp +++ b/ACE/tests/UPIPE_SAP_Test.cpp @@ -60,7 +60,7 @@ connector (void *) if (c_stream.recv (mb) == -1) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) error connector recv\n"))); - ACE_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), "thanks") == 0); + ACE_TEST_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), "thanks") == 0); // Free up the memory block. mb->release (); @@ -88,7 +88,7 @@ connector (void *) conbuf[i] = '\0'; ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) conbuf = %s\n"), conbuf)); - ACE_ASSERT (ACE_OS::strcmp (conbuf, "this is the acceptor response!") == 0); + ACE_TEST_ASSERT (ACE_OS::strcmp (conbuf, "this is the acceptor response!") == 0); c_stream.close (); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) exiting thread\n"))); @@ -110,7 +110,7 @@ acceptor (void *args) if (s_stream.recv (mb) == -1) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) acceptor recv failed\n"))); - ACE_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), "hello") == 0); + ACE_TEST_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), "hello") == 0); mb->wr_ptr (mb->rd_ptr ()); mb->copy ("thanks"); @@ -124,7 +124,7 @@ acceptor (void *args) if (s_stream.recv (s_buf, sizeof (s_buf)) == -1) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) acceptor recv failed\n"))); else - ACE_ASSERT (ACE_OS::strcmp (s_buf, + ACE_TEST_ASSERT (ACE_OS::strcmp (s_buf, "This string is sent by connector as a buffer") == 0); const char svr_response[] = "this is the acceptor response!"; diff --git a/ACE/tests/Vector_Test.cpp b/ACE/tests/Vector_Test.cpp index 061d9cbda56..31107386692 100644 --- a/ACE/tests/Vector_Test.cpp +++ b/ACE/tests/Vector_Test.cpp @@ -44,13 +44,13 @@ int run_main (int, ACE_TCHAR *[]) for (i = 0; i < TOP; ++i) vector.push_back (i); - ACE_ASSERT (vector.size () == TOP); + ACE_TEST_ASSERT (vector.size () == TOP); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Size: %d\n"), vector.size ())); for (i = 0; i < TOP; ++i) - ACE_ASSERT (vector[i] == i); + ACE_TEST_ASSERT (vector[i] == i); // Test to be sure the iterator gets the correct count and entries. ITERATOR iter (vector); @@ -74,14 +74,14 @@ int run_main (int, ACE_TCHAR *[]) for (i = 0; i < (TOP - LEFT); ++i) vector.pop_back (); - ACE_ASSERT (vector.size () == LEFT); + ACE_TEST_ASSERT (vector.size () == LEFT); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Size: %d\n"), vector.size ())); for (i = 0; i < LEFT; ++i) { - ACE_ASSERT (vector[i] == i); + ACE_TEST_ASSERT (vector[i] == i); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("vector[%d]:%d\n"), i, vector[i])); @@ -97,11 +97,11 @@ int run_main (int, ACE_TCHAR *[]) // second argument of the resize() call. if (i < LEFT) { - ACE_ASSERT (vector[i] == i); + ACE_TEST_ASSERT (vector[i] == i); } else { - ACE_ASSERT (vector[i] == 0); + ACE_TEST_ASSERT (vector[i] == 0); } ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("vector[%d]:%d\n"), @@ -109,7 +109,7 @@ int run_main (int, ACE_TCHAR *[]) } vector.clear (); - ACE_ASSERT (vector.size () == 0); + ACE_TEST_ASSERT (vector.size () == 0); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Size: %d\n"), vector.size ())); @@ -141,9 +141,9 @@ int run_main (int, ACE_TCHAR *[]) vector2.push_back (FILLER2); // now we check the result - ACE_ASSERT (vector2[0] == FILLER1); + ACE_TEST_ASSERT (vector2[0] == FILLER1); for (i = 0; i < boundary; ++i) - ACE_ASSERT (vector2[i+1] == FILLER2); + ACE_TEST_ASSERT (vector2[i+1] == FILLER2); VECTOR v1; VECTOR v2; diff --git a/ACE/tests/WFMO_Reactor_Test.cpp b/ACE/tests/WFMO_Reactor_Test.cpp index cadb1d08450..83c7475dfbe 100644 --- a/ACE/tests/WFMO_Reactor_Test.cpp +++ b/ACE/tests/WFMO_Reactor_Test.cpp @@ -55,18 +55,18 @@ Event_Handler::Event_Handler (ACE_Reactor &reactor) int result = this->pipe_.open (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_UNUSED_ARG (result); this->reactor ()->register_handler (this->pipe_.read_handle (), this, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); this->reactor ()->register_handler (this->pipe_.write_handle (), this, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } Event_Handler::~Event_Handler (void) @@ -104,7 +104,7 @@ test (void) ACE_Time_Value timeout (0, 500 * 1000); result = reactor.run_reactor_event_loop (timeout); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); for (i = 0; i < number_of_handlers; ++i) { @@ -112,14 +112,14 @@ test (void) continue; result = reactor.suspend_handler (event_handlers[i]->pipe_.read_handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = reactor.suspend_handler (event_handlers[i]->pipe_.write_handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); } result = reactor.run_reactor_event_loop (timeout); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); delete[] safe_event_handlers; delete[] event_handlers; @@ -132,7 +132,7 @@ run_main (int, ACE_TCHAR *[]) test (); - ACE_ASSERT (number_of_closes == number_of_handlers); + ACE_TEST_ASSERT (number_of_closes == number_of_handlers); ACE_END_TEST; |