From 440962dbbf6dc5e30bb53598e1dee4e53d013b73 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Sun, 19 Jul 2015 18:36:08 +0200 Subject: [PATCH] tests: Run mutation source tests on memtable --- configure.py | 1 + tests/urchin/memtable_test.cc | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/urchin/memtable_test.cc diff --git a/configure.py b/configure.py index 66dbf57928..5a48541506 100755 --- a/configure.py +++ b/configure.py @@ -128,6 +128,7 @@ urchin_tests = [ 'tests/test-serialization', 'tests/urchin/sstable_test', 'tests/urchin/sstable_mutation_test', + 'tests/urchin/memtable_test', 'tests/urchin/commitlog_test', 'tests/cartesian_product_test', 'tests/urchin/hash_test', diff --git a/tests/urchin/memtable_test.cc b/tests/urchin/memtable_test.cc new file mode 100644 index 0000000000..fc84aee201 --- /dev/null +++ b/tests/urchin/memtable_test.cc @@ -0,0 +1,26 @@ +/* + * Copyright 2015 Cloudius Systems + */ + +#define BOOST_TEST_DYN_LINK + +#include +#include "tests/test-utils.hh" + +#include "core/thread.hh" +#include "memtable.hh" +#include "mutation_source_test.hh" + +SEASTAR_TEST_CASE(test_memtable_conforms_to_mutation_source) { + return seastar::async([] { + run_mutation_source_tests([](schema_ptr s, const std::vector& partitions) { + auto mt = make_lw_shared(s); + + for (auto&& m : partitions) { + mt->apply(m); + } + + return mt->as_data_source(); + }); + }); +}