summaryrefslogtreecommitdiffstats
path: root/tests/include/shard_string.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-04-15 14:00:27 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2024-04-15 14:00:27 -0400
commitb25beb13773072c3b143842b45a7c32a1108f347 (patch)
tree97f490a4b8e527e6281df2cb1ee8f1fab84f1f8d /tests/include/shard_string.h
parent2c69253f382cd0c6d41db57c45119c33c315bb9c (diff)
downloaddynamic-extension-b25beb13773072c3b143842b45a7c32a1108f347.tar.gz
Updated FSTrie to use const char * instead of std::string
Note: this requires the caller to manage the memory of the strings
Diffstat (limited to 'tests/include/shard_string.h')
-rw-r--r--tests/include/shard_string.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/include/shard_string.h b/tests/include/shard_string.h
index fa51630..2d7a72a 100644
--- a/tests/include/shard_string.h
+++ b/tests/include/shard_string.h
@@ -122,7 +122,7 @@ START_TEST(t_point_lookup)
auto result = shard.point_lookup(r);
ck_assert_ptr_nonnull(result);
- ck_assert_str_eq(result->rec.key.c_str(), r.key.c_str());
+ ck_assert_str_eq(result->rec.key, r.key);
ck_assert_int_eq(result->rec.value, r.value);
//fprintf(stderr, "%ld\n", i);
}
@@ -141,9 +141,8 @@ START_TEST(t_point_lookup_miss)
auto shard = Shard(buffer->get_buffer_view());
for (size_t i=n + 100; i<2*n; i++) {
- R r;
- r.key = std::string("computer");
- r.value = 1234;
+ const char *c = "computer";
+ R r = {c, 1234, 8};
auto result = shard.point_lookup(r);
ck_assert_ptr_null(result);