summaryrefslogtreecommitdiff
path: root/tests/Hash_Map_Manager_Test.cpp
diff options
context:
space:
mode:
authordoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-07 14:43:37 +0000
committerdoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-07 14:43:37 +0000
commita2ef2bab6c6bed42257cd45963b4baccd2cde2b5 (patch)
tree57ea88a7495f4e69a0c75df407152b973f5da5c4 /tests/Hash_Map_Manager_Test.cpp
parent143023a3c0c9c1cfd324a6f235285f4106be9123 (diff)
downloadATCD-a2ef2bab6c6bed42257cd45963b4baccd2cde2b5.tar.gz
ChangeLogTag: Tue Aug 07 16:39:08 2001 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'tests/Hash_Map_Manager_Test.cpp')
-rw-r--r--tests/Hash_Map_Manager_Test.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/Hash_Map_Manager_Test.cpp b/tests/Hash_Map_Manager_Test.cpp
index 3f1d167ed3b..e1af3bb4a43 100644
--- a/tests/Hash_Map_Manager_Test.cpp
+++ b/tests/Hash_Map_Manager_Test.cpp
@@ -43,14 +43,18 @@ static const size_t STRING_TABLE_SIZE =
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_Const_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_Const_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<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_Const_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_Const_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 */
@@ -69,6 +73,12 @@ typedef ACE_Hash_Map_Iterator_Ex<const ACE_TCHAR *,
ACE_Equal_To<const ACE_TCHAR *>,
ACE_Null_Mutex> HASH_STRING_ITER;
+typedef ACE_Hash_Map_Const_Iterator_Ex<const ACE_TCHAR *,
+ const ACE_TCHAR *,
+ ACE_Hash<const ACE_TCHAR *>,
+ ACE_Equal_To<const ACE_TCHAR *>,
+ ACE_Null_Mutex> HASH_STRING_CONST_ITER;
+
typedef ACE_Hash_Map_Reverse_Iterator_Ex<const ACE_TCHAR *,
const ACE_TCHAR *,
ACE_Hash<const ACE_TCHAR *>,
@@ -101,7 +111,6 @@ static String_Table string_table[] =
}
};
-
static int
run_test (void)
{
@@ -168,6 +177,24 @@ run_test (void)
}
}
+ // And now test the const iterator
+ {
+ HASH_STRING_ENTRY *entry;
+ size_t i = 0;
+
+ for (HASH_STRING_CONST_ITER hash_iter (hash);
+ hash_iter.next (entry) != 0;
+ hash_iter.advance ())
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("const iterating (%d): [%s, %s]\n"),
+ i,
+ entry->ext_id_,
+ entry->int_id_));
+ i++;
+ }
+ }
+
hash.unbind (string_table[2].key_, entry);
// Check the <find> operation again.