diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-08-07 15:34:48 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-08-07 15:34:48 +0200 |
commit | b510da2e562c695c90d565eb295c749569c59be8 (patch) | |
tree | e5405d03df995831870414227c04f2553c621c92 /klm/util | |
parent | bb9309432fd35e95cf88b630853a928a3e3228c3 (diff) | |
parent | 9b96ffa040f6c05c4e597a34c316743425839fe0 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'klm/util')
-rw-r--r-- | klm/util/probing_hash_table_test.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/klm/util/probing_hash_table_test.cc b/klm/util/probing_hash_table_test.cc index ef68e5f2..be0fa859 100644 --- a/klm/util/probing_hash_table_test.cc +++ b/klm/util/probing_hash_table_test.cc @@ -1,10 +1,12 @@ #include "util/probing_hash_table.hh" -#include <stdint.h> - #define BOOST_TEST_MODULE ProbingHashTableTest #include <boost/test/unit_test.hpp> +#include <boost/scoped_array.hpp> #include <boost/functional/hash.hpp> +#include <stdio.h> +#include <string.h> +#include <stdint.h> namespace util { namespace { @@ -27,10 +29,11 @@ struct Entry { typedef ProbingHashTable<Entry, boost::hash<unsigned char> > Table; BOOST_AUTO_TEST_CASE(simple) { - char mem[Table::Size(10, 1.2)]; - memset(mem, 0, sizeof(mem)); + size_t size = Table::Size(10, 1.2); + boost::scoped_array<char> mem(new char[size]); + memset(mem.get(), 0, size); - Table table(mem, sizeof(mem)); + Table table(mem.get(), size); const Entry *i = NULL; BOOST_CHECK(!table.Find(2, i)); Entry to_ins; |