Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ErvinXie committed May 11, 2021
1 parent 3ce5a52 commit c313e0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ART/N48.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 4 additions & 5 deletions test/test_correctness.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "Tree.h"
#include "generator.h"
#include "threadinfo.h"
#include <boost/thread/barrier.hpp>
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit c313e0f

Please sign in to comment.