From c313e0f375d55ea850c0c497e7d104009a327fa3 Mon Sep 17 00:00:00 2001 From: ErvinXie Date: Tue, 11 May 2021 09:04:17 +0800 Subject: [PATCH] bug fix --- ART/N48.h | 2 +- test/test_correctness.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ART/N48.h b/ART/N48.h index 6936dc8..75ca1b2 100644 --- a/ART/N48.h +++ b/ART/N48.h @@ -42,7 +42,7 @@ class N48 : public N { for (unsigned i = 0; i < 256; i++) { uint8_t index = childIndex[i].load(); #ifdef ZENTRY - auto child = getZentryPtr(zens[i].load()); + auto child = getZentryPtr(zens[index].load()); if (index != emptyMarker && child != nullptr) { // not flush n->insert(i, child, false); diff --git a/test/test_correctness.cpp b/test/test_correctness.cpp index 4b21013..52015ca 100644 --- a/test/test_correctness.cpp +++ b/test/test_correctness.cpp @@ -1,4 +1,3 @@ -#include "Tree.h" #include "generator.h" #include "threadinfo.h" #include @@ -39,7 +38,7 @@ TEST(TestCorrectness, PM_ART) { // std::string key = std::to_string(i); //// key = key + "x"; std::string key = rdm.RandomStr(); - key = "msn" + key + "msn"; + key = "ebc" + key + "ebc"; Key *k = new Key(); k->Init((char *)key.c_str(), key.size(), (char *)key.c_str(), key.size()); @@ -91,11 +90,11 @@ TEST(TestCorrectness, PM_ART) { int scan_length = (rdm.randomInt() % total_key_cnt / 4) + 1; auto start_key = new Key(), end_key = new Key(); std::string start_string = rdm.RandomStr(); - start_string = "msn" + start_string + "msn"; + start_string = "ebc" + start_string + "ebc"; start_key->Init((char *)start_string.c_str(), start_string.size(), (char *)start_string.c_str(), start_string.size()); std::string end_string = rdm.RandomStr(); - end_string = "msn" + end_string + "msn"; + end_string = "ebc" + end_string + "ebc"; end_key->Init((char *)end_string.c_str(), end_string.size(), (char *)end_string.c_str(), end_string.size()); @@ -328,7 +327,7 @@ TEST(TestCorrectness, PM_ART_INSERT_AND_READ) { std::cout << "[TEST]\tstart to build tree\n"; for (int i = 0; i < nthreads * test_iter; i++) { std::string key = rdm.RandomStr(); - key = "msn" + key + "msn"; + key = "ebc" + key + "ebc"; Key *k = new Key(); k->Init((char *)key.c_str(), key.size(), (char *)key.c_str(), key.size());