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 | 4dd5216d3afa9ab72b150e250a3c30a5f223ce53 (patch) | |
tree | 440656fdee4da004aff430628fba74f581dd317c /klm/util | |
parent | b6d085d66decb602e88f32fb5cef27b10e83e69e (diff) | |
parent | 805213bdb54474e2d3c67d2ac647b9365ff21415 (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; |