From 9876d74e503df64eb9e82e540ca41fcf593ebf64 Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Fri, 6 Dec 2024 16:54:05 -0500 Subject: Adjusted query result interfaces Now, the vector<> is part of the user-defined type, not required by the framework. This should allow for more flexibility in either using alternative containers, or for more sensible implementations of queries with single value results (like range count). --- tests/include/irs.h | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'tests/include/irs.h') diff --git a/tests/include/irs.h b/tests/include/irs.h index 1c5be2c..35a4bbb 100644 --- a/tests/include/irs.h +++ b/tests/include/irs.h @@ -18,7 +18,6 @@ #pragma once #include "query/irs.h" -#include /* * Uncomment these lines temporarily to remove errors in this file @@ -27,16 +26,16 @@ * should be included in the source file that includes this one, above the * include statement. */ -#include "shard/ISAMTree.h" -#include "query/irs.h" -#include "testing.h" -#include -#include -using namespace de; +// #include "shard/ISAMTree.h" +// #include "query/irs.h" +// #include "testing.h" +// #include +// #include +// using namespace de; -typedef Rec R; -typedef ISAMTree Shard; -typedef irs::Query> Query; +// typedef Rec R; +// typedef ISAMTree Shard; +// typedef irs::Query> Query; static gsl_rng *g_rng; @@ -60,8 +59,8 @@ START_TEST(t_irs) ck_assert_int_eq(result.size(), k); for (size_t i=0; i::distribute_query(&parms, {query1, query2}, &dummy_buffer_query); - std::vector::LocalResultType>> results(2); + std::vector::LocalResultType> results(2); results[0] = irs::Query::local_query(&shard1, query1); results[1] = irs::Query::local_query(&shard2, query2); delete query1; @@ -136,16 +135,16 @@ START_TEST(t_irs_merge) ck_assert_int_eq(results[0].size() + results[1].size(), k); - std::vector>> proc_results; + std::vector> proc_results; for (size_t j=0; j>()); + proc_results.emplace_back(std::vector()); for (size_t i=0; i::ResultType> result; + irs::Query::ResultType result; irs::Query::combine(proc_results, nullptr, result); ck_assert_int_eq(result.size(), k); @@ -154,7 +153,7 @@ START_TEST(t_irs_merge) } END_TEST -static void inject_irs_tests(Suite *suite) { +[[maybe_unused]] static void inject_irs_tests(Suite *suite) { g_rng = gsl_rng_alloc(gsl_rng_mt19937); TCase *irs = tcase_create("Independent Range Sampling Query Testing"); -- cgit v1.2.3