memgraph/tests/concurrent/sl_memory.cpp
Kruno Tomola Fabro e16b576a6e Added support for multiset.
Minor fixes to tests.

MultiIterator & MultiMap work.
There are some unfinished optimizations in the code commented.

All tests pass. Some common parts from tests have been moved.
2016-08-02 13:23:39 +01:00

25 lines
480 B
C++

#include "common.h"
#define THREADS_NO 8
constexpr size_t elements = 2e6;
// Test for simple memory leaks
int main()
{
memory_check(THREADS_NO, [] {
map_t skiplist;
auto futures = run<size_t>(THREADS_NO, skiplist, [](auto acc, auto index) {
for (size_t i = 0; i < elements; i++) {
acc.insert(i, index);
}
return index;
});
collect(futures);
auto accessor = skiplist.access();
check_size<map_t>(accessor, elements);
});
}