From 943cf16f5661357086532b2241e6f85bfe43565a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 7 Apr 2010 17:44:57 +0000 Subject: Corrected a long standing yet seldom witnessed hash bug. It was triggered when a hashtable was filled, then some items were removed, then enough items were added to trigger a rehash. --- src/tests/hash2.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/tests/hash2.cpp (limited to 'src/tests') diff --git a/src/tests/hash2.cpp b/src/tests/hash2.cpp new file mode 100644 index 0000000..24c9d8c --- /dev/null +++ b/src/tests/hash2.cpp @@ -0,0 +1,28 @@ +#include +#include + +int main() +{ + Bu::Hash hCmd; + + hCmd.insert("help", 5 ); + hCmd.insert("exit", 5 ); + hCmd.insert("getkey", 5 ); + hCmd.insert("setcrypt", 5 ); + hCmd.insert("user", 5 ); + hCmd.insert("pass", 5 ); + hCmd.erase("getkey"); + hCmd.erase("setcrypt"); + hCmd.insert("user", 5 ); + hCmd.insert("pass", 5 ); + hCmd.erase("pass"); + hCmd.erase("user"); + hCmd.insert("acl", 5 ); + hCmd.insert("owner", 5 ); + hCmd.insert("operator", 5 ); + hCmd.insert("admin", 5 ); + hCmd.insert("monitor", 5 ); + hCmd.insert("shutdown", 5 ); + + return 0; +} -- cgit v1.2.3