summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-11-21 19:52:12 +0000
committerMike Buland <eichlan@xagasoft.com>2006-11-21 19:52:12 +0000
commit8b2878e6595e40d2a37bb9983274ccb5827a9192 (patch)
tree05a902091cebcaa40fb69818b335fee99ebf1aa5 /src/tests
parent4e55dab4511ffa8307e3ae7523659e6087632f95 (diff)
downloadlibbu++-8b2878e6595e40d2a37bb9983274ccb5827a9192.tar.gz
libbu++-8b2878e6595e40d2a37bb9983274ccb5827a9192.tar.bz2
libbu++-8b2878e6595e40d2a37bb9983274ccb5827a9192.tar.xz
libbu++-8b2878e6595e40d2a37bb9983274ccb5827a9192.zip
Hash uses real exceptions now, and has a clear() function.
Diffstat (limited to '')
-rw-r--r--src/tests/hash.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/hash.cpp b/src/tests/hash.cpp
index a7f0a57..58e0112 100644
--- a/src/tests/hash.cpp
+++ b/src/tests/hash.cpp
@@ -78,6 +78,7 @@ int main()
78 printf("%d: %s\n", (*j).second, (*j).first.c_str() ); 78 printf("%d: %s\n", (*j).second, (*j).first.c_str() );
79 } 79 }
80 80
81 printf("Testing\n-------------------\n\n");
81 for( int j = 0; j < 33; j++ ) 82 for( int j = 0; j < 33; j++ )
82 { 83 {
83 if( sTest.has(names[j]) ) 84 if( sTest.has(names[j]) )
@@ -95,5 +96,16 @@ int main()
95 printf("Missing element %d, '%s'\n", j, names[j] ); 96 printf("Missing element %d, '%s'\n", j, names[j] );
96 } 97 }
97 } 98 }
99
100 printf("Clearing\n-------------------\n\n");
101
102 sTest.clear();
103
104 for( Hash<std::string, int>::iterator i = sTest.begin();
105 i != sTest.end(); i++ )
106 {
107 Hash<std::string, int>::iterator j = i;
108 printf("%d: %s\n", (*j).second, (*j).first.c_str() );
109 }
98} 110}
99 111