#include "threadtests.h"
-#ifdef _MSC_VER
-#define alarm(a)
-#endif
-
time_t time_offset;
extern "C" {
// ----------------------------------------------------------------------
static void testHashSize() {
- HashTable h(global_stats);
+ HashTable h(global_stats, /*size*/0, /*locks*/1);
cb_assert(count(h) == 0);
std::string k = "testkey";
}
static void testHashSizeTwo() {
- HashTable h(global_stats);
+ HashTable h(global_stats, /*size*/0, /*locks*/1);
cb_assert(count(h) == 0);
std::vector<std::string> keys = generateKeys(5);
}
static void testReverseDeletions() {
- alarm(10);
size_t initialSize = global_stats.currentSize.load();
HashTable h(global_stats, 5, 1);
cb_assert(count(h) == 0);
}
static void testForwardDeletions() {
- alarm(10);
size_t initialSize = global_stats.currentSize.load();
HashTable h(global_stats, 5, 1);
cb_assert(h.getSize() == 5);
std::vector<std::string> keys;
HashTable &ht;
- size_t size;
+ AtomicValue<size_t> size;
};
static void testConcurrentAccessResize() {
putenv(strdup("ALLOW_NO_STATS_UPDATE=yeah"));
global_stats.setMaxDataSize(64*1024*1024);
HashTable::setDefaultNumBuckets(3);
- alarm(60);
testHashSize();
testHashSizeTwo();
testReverseDeletions();