From b25beb13773072c3b143842b45a7c32a1108f347 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 15 Apr 2024 14:00:27 -0400 Subject: Updated FSTrie to use const char * instead of std::string Note: this requires the caller to manage the memory of the strings --- tests/include/shard_string.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/include/shard_string.h') 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); -- cgit v1.2.3