From e6c3cc65748d90208e66b06229e7bbdf2e5d6d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Fri, 14 Nov 2014 11:31:52 -0800 Subject: [PATCH] Add very basic tests to make sure the C cuckoo table options compile and run --- db/c_test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/db/c_test.c b/db/c_test.c index 4f296f9bd..ed9a62a9d 100644 --- a/db/c_test.c +++ b/db/c_test.c @@ -801,8 +801,27 @@ int main(int argc, char** argv) { rocksdb_iter_get_error(iter, &err); CheckNoError(err); rocksdb_iter_destroy(iter); + + rocksdb_close(db); + rocksdb_destroy_db(options, dbname, &err); } + StartPhase("cuckoo_options"); + { + rocksdb_cuckoo_table_options_t* cuckoo_options; + cuckoo_options = rocksdb_cuckoo_options_create(); + rocksdb_cuckoo_options_set_hash_ratio(cuckoo_options, 0.5); + rocksdb_cuckoo_options_set_max_search_depth(cuckoo_options, 200); + rocksdb_cuckoo_options_set_cuckoo_block_size(cuckoo_options, 10); + rocksdb_cuckoo_options_set_identity_as_first_hash(cuckoo_options, 1); + rocksdb_cuckoo_options_set_use_module_hash(cuckoo_options, 0); + rocksdb_options_set_cuckoo_table_factory(options, cuckoo_options); + + db = rocksdb_open(options, dbname, &err); + CheckNoError(err); + + rocksdb_cuckoo_options_destroy(cuckoo_options); + } StartPhase("cleanup"); rocksdb_close(db);