From 405bf4a20b4a22a6bb4b60b730b6a7e901fdccf6 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 19 Mar 2024 11:10:02 -0400 Subject: FST Shard w/ tests Needs some debugging--some methods currently fail within the library itself. The build system doesn't currently build the FST library. To compile, you'll first need to manually build it, and then place the libFST.so file in your LIBRARY_PATH and LD_LIBRARY_PATH. --- tests/fst_tests.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/fst_tests.cpp (limited to 'tests/fst_tests.cpp') diff --git a/tests/fst_tests.cpp b/tests/fst_tests.cpp new file mode 100644 index 0000000..298c104 --- /dev/null +++ b/tests/fst_tests.cpp @@ -0,0 +1,55 @@ +/* + * tests/isam_tests.cpp + * + * Unit tests for ISAM Tree shard + * + * Copyright (C) 2023 Douglas Rumbaugh + * Dong Xie + * + * Distributed under the Modified BSD License. + * + */ + +#include "shard/FSTrie.h" +#include "include/testing.h" +#include + +using namespace de; + +typedef Rec R; +typedef FSTrie Shard; + +#include "include/shard_standard.h" +#include "include/rangequery.h" + +Suite *unit_testing() +{ + Suite *unit = suite_create("Fast-succinct Trie Shard Unit Testing"); + + inject_rangequery_tests(unit); + inject_shard_tests(unit); + + return unit; +} + + +int shard_unit_tests() +{ + int failed = 0; + Suite *unit = unit_testing(); + SRunner *unit_shardner = srunner_create(unit); + + srunner_run_all(unit_shardner, CK_NORMAL); + failed = srunner_ntests_failed(unit_shardner); + srunner_free(unit_shardner); + + return failed; +} + + +int main() +{ + int unit_failed = shard_unit_tests(); + + return (unit_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} -- cgit v1.2.3 From 9fe190f5d500e22b0894095e7c917f9c652e0a64 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 20 Mar 2024 17:30:14 -0400 Subject: Updates/progress towards succinct trie support --- tests/fst_tests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/fst_tests.cpp') diff --git a/tests/fst_tests.cpp b/tests/fst_tests.cpp index 298c104..4c8da4a 100644 --- a/tests/fst_tests.cpp +++ b/tests/fst_tests.cpp @@ -16,17 +16,17 @@ using namespace de; -typedef Rec R; +typedef StringRec R; typedef FSTrie Shard; -#include "include/shard_standard.h" -#include "include/rangequery.h" +#include "include/shard_string.h" +//#include "include/rangequery.h" Suite *unit_testing() { Suite *unit = suite_create("Fast-succinct Trie Shard Unit Testing"); - inject_rangequery_tests(unit); + // inject_rangequery_tests(unit); inject_shard_tests(unit); return unit; -- cgit v1.2.3 From fb4312a883dd0e382ecbcfe1119479e6f44d32a6 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 22 Mar 2024 15:35:14 -0400 Subject: PointLookup: added a point lookup query for unique indexes, and some tests --- tests/fst_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/fst_tests.cpp') diff --git a/tests/fst_tests.cpp b/tests/fst_tests.cpp index 4c8da4a..778f64a 100644 --- a/tests/fst_tests.cpp +++ b/tests/fst_tests.cpp @@ -20,14 +20,14 @@ typedef StringRec R; typedef FSTrie Shard; #include "include/shard_string.h" -//#include "include/rangequery.h" +#include "include/pointlookup.h" Suite *unit_testing() { Suite *unit = suite_create("Fast-succinct Trie Shard Unit Testing"); - // inject_rangequery_tests(unit); inject_shard_tests(unit); + inject_pointlookup_tests(unit); return unit; } -- cgit v1.2.3