diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-23 04:43:59 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-23 04:43:59 +0000 |
commit | a7c03cabf931b077d70c6f80ec02c7728a429f49 (patch) | |
tree | 61d38d262d43ac77fc2ad94c9e7e850cd5607622 /tests/Hash_Map_Manager_Test.cpp | |
parent | 2aa7b10780ad7c670f588dce4ec341351a0646aa (diff) | |
download | ATCD-a7c03cabf931b077d70c6f80ec02c7728a429f49.tar.gz |
ChangeLogTag:Sat Apr 22 20:53:11 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'tests/Hash_Map_Manager_Test.cpp')
-rw-r--r-- | tests/Hash_Map_Manager_Test.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/tests/Hash_Map_Manager_Test.cpp b/tests/Hash_Map_Manager_Test.cpp index 32150c2735c..a346686f92a 100644 --- a/tests/Hash_Map_Manager_Test.cpp +++ b/tests/Hash_Map_Manager_Test.cpp @@ -30,8 +30,8 @@ ACE_RCSID(tests, Hash_Map_Manager_Test, "$Id$") static const size_t STRING_TABLE_ENTRIES = 3; static const size_t MAX_HASH = 6; -typedef ACE_Hash_Map_Entry<LPCTSTR, - LPCTSTR> HASH_STRING_ENTRY; +typedef ACE_Hash_Map_Entry<const ACE_TCHAR *, + const ACE_TCHAR *> HASH_STRING_ENTRY; // @@ The following requires too much internal implementation // information about the <ACE_Hash_Map_Manager>. We need to figure @@ -40,45 +40,45 @@ static const size_t STRING_TABLE_SIZE = sizeof (HASH_STRING_ENTRY) * (STRING_TABLE_ENTRIES + MAX_HASH); #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Hash_Map_Entry<LPCTSTR, LPCTSTR>; -template class ACE_Hash_Map_Manager_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Entry<const ACE_TCHAR *, const ACE_TCHAR *>; +template class ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex>; template class ACE_Static_Allocator<STRING_TABLE_SIZE>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Entry<LPCTSTR, LPCTSTR> -#pragma instantiate ACE_Hash_Map_Manager_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Entry<const ACE_TCHAR *, const ACE_TCHAR *> +#pragma instantiate ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<const ACE_TCHAR *, const ACE_TCHAR *, ACE_Hash<const ACE_TCHAR *>, ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> #pragma instantiate ACE_Static_Allocator<STRING_TABLE_SIZE> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ static ACE_Static_Allocator<STRING_TABLE_SIZE> alloc; -typedef ACE_Hash_Map_Manager_Ex<LPCTSTR, - LPCTSTR, - ACE_Hash<LPCTSTR>, - ACE_Equal_To<LPCTSTR>, +typedef ACE_Hash_Map_Manager_Ex<const ACE_TCHAR *, + const ACE_TCHAR *, + ACE_Hash<const ACE_TCHAR *>, + ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> HASH_STRING_MAP; -typedef ACE_Hash_Map_Iterator_Ex<LPCTSTR, - LPCTSTR, - ACE_Hash<LPCTSTR>, - ACE_Equal_To<LPCTSTR>, +typedef ACE_Hash_Map_Iterator_Ex<const ACE_TCHAR *, + const ACE_TCHAR *, + ACE_Hash<const ACE_TCHAR *>, + ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> HASH_STRING_ITER; -typedef ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, - LPCTSTR, - ACE_Hash<LPCTSTR>, - ACE_Equal_To<LPCTSTR>, +typedef ACE_Hash_Map_Reverse_Iterator_Ex<const ACE_TCHAR *, + const ACE_TCHAR *, + ACE_Hash<const ACE_TCHAR *>, + ACE_Equal_To<const ACE_TCHAR *>, ACE_Null_Mutex> HASH_STRING_REVERSE_ITER; struct String_Table { - LPCTSTR key_; - LPCTSTR value_; + const ACE_TCHAR *key_; + const ACE_TCHAR *value_; }; static String_Table string_table[] = @@ -116,37 +116,37 @@ run_test (void) if (hash.bind (string_table[i].key_, string_table[i].value_) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("%p failed for %s \n"), - ASYS_TEXT ("bind"), - ASYS_MULTIBYTE_STRING (string_table[i].key_)), -1); + ACE_TEXT ("%p failed for %s \n"), + ACE_TEXT ("bind"), + string_table[i].key_), -1); - LPCTSTR entry; + const ACE_TCHAR *entry; // Check the <find> operation. for (i = 0; string_table[i].key_ != 0; i++) if (hash.find (string_table[i].key_, entry) == 0) ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("`%s' found `%s'\n"), - ASYS_MULTIBYTE_STRING (string_table[i].key_), + ACE_TEXT ("`%s' found `%s'\n"), + string_table[i].key_, entry)); else ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("`%s' not found\n"), - ASYS_MULTIBYTE_STRING (string_table[i].key_)), + ACE_TEXT ("`%s' not found\n"), + string_table[i].key_), -1); // Check the <trybind> operation. { - LPCTSTR pc = string_table[1].value_; + const ACE_TCHAR *pc = string_table[1].value_; if (hash.trybind (string_table[0].key_, pc) != 1) ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("::trybind missed existing entry.")), + ACE_TEXT ("::trybind missed existing entry.")), -1); else if (pc != string_table[0].value_) ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("::trybind doesn't return existing value.")), + ACE_TEXT ("::trybind doesn't return existing value.")), -1); } @@ -160,10 +160,10 @@ run_test (void) hash_iter.advance ()) { ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("iterating (%d): [%s, %s]\n"), + ACE_TEXT ("iterating (%d): [%s, %s]\n"), i, - ASYS_MULTIBYTE_STRING ((LPCTSTR) entry->ext_id_), - ASYS_MULTIBYTE_STRING ((LPCTSTR) entry->int_id_))); + entry->ext_id_, + entry->int_id_)); i++; } } @@ -175,13 +175,13 @@ run_test (void) if (hash.find (string_table[i].key_, entry) == 0) ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("`%s' found `%s'\n"), - ASYS_MULTIBYTE_STRING (string_table[i].key_), - ASYS_MULTIBYTE_STRING (entry))); + ACE_TEXT ("`%s' found `%s'\n"), + string_table[i].key_, + entry)); else if (i != 2) ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("`%s' not found\n"), - ASYS_MULTIBYTE_STRING (string_table[i].key_)), + ACE_TEXT ("`%s' not found\n"), + string_table[i].key_), -1); // Let's test the iterator backwards. @@ -194,10 +194,10 @@ run_test (void) hash_iter.advance ()) { ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("iterating (%d): [%s, %s]\n"), + ACE_TEXT ("iterating (%d): [%s, %s]\n"), i, - ASYS_MULTIBYTE_STRING ((LPCTSTR) entry->ext_id_), - ASYS_MULTIBYTE_STRING ((LPCTSTR) entry->int_id_))); + entry->ext_id_, + entry->int_id_)); i++; } } @@ -207,9 +207,9 @@ run_test (void) } int -main (int, ASYS_TCHAR *[]) +main (int, ACE_TCHAR *[]) { - ACE_START_TEST (ASYS_TEXT ("Hash_Map_Manager_Test")); + ACE_START_TEST (ACE_TEXT ("Hash_Map_Manager_Test")); run_test (); |