summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-06-05 11:49:29 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2023-06-05 11:49:29 -0400
commitf8f3cb6c55b085fa260c7f80644d5ef057d4a070 (patch)
tree6d34cf94962758b09fe0425f39e2cdbb17e9dd01 /tests
parent59ab2a92a5902b25fbc227bab549eb6f2dd84486 (diff)
downloaddynamic-extension-f8f3cb6c55b085fa260c7f80644d5ef057d4a070.tar.gz
Test refactoring: pulled record stripping function to testing.h
Diffstat (limited to 'tests')
-rw-r--r--tests/memisam_tests.cpp11
-rw-r--r--tests/testing.h11
-rw-r--r--tests/wirs_tests.cpp11
-rw-r--r--tests/wss_tests.cpp11
4 files changed, 11 insertions, 33 deletions
diff --git a/tests/memisam_tests.cpp b/tests/memisam_tests.cpp
index aaf0b51..713a732 100644
--- a/tests/memisam_tests.cpp
+++ b/tests/memisam_tests.cpp
@@ -206,17 +206,6 @@ START_TEST(t_irs_query)
END_TEST
-template <RecordInterface R>
-std::vector<R> strip_wrapping(std::vector<Wrapped<R>> vec) {
- std::vector<R> out(vec.size());
- for (size_t i=0; i<vec.size(); i++) {
- out[i] = vec[i].rec;
- }
-
- return out;
-}
-
-
START_TEST(t_irs_query_merge)
{
size_t n=1000;
diff --git a/tests/testing.h b/tests/testing.h
index cd0045a..0be65e3 100644
--- a/tests/testing.h
+++ b/tests/testing.h
@@ -19,10 +19,21 @@
#include "util/types.h"
#include "util/base.h"
#include "framework/MutableBuffer.h"
+#include "framework/RecordInterface.h"
typedef de::WeightedRecord<uint64_t, uint32_t, uint64_t> WRec;
typedef de::Record<uint64_t, uint32_t> Rec;
+template <de::RecordInterface R>
+std::vector<R> strip_wrapping(std::vector<de::Wrapped<R>> vec) {
+ std::vector<R> out(vec.size());
+ for (size_t i=0; i<vec.size(); i++) {
+ out[i] = vec[i].rec;
+ }
+
+ return out;
+}
+
static bool initialize_test_file(std::string fname, size_t page_cnt)
{
auto flags = O_RDWR | O_CREAT | O_TRUNC;
diff --git a/tests/wirs_tests.cpp b/tests/wirs_tests.cpp
index d959347..133950d 100644
--- a/tests/wirs_tests.cpp
+++ b/tests/wirs_tests.cpp
@@ -212,17 +212,6 @@ START_TEST(t_wirs_query)
END_TEST
-template <RecordInterface R>
-std::vector<R> strip_wrapping(std::vector<Wrapped<R>> vec) {
- std::vector<R> out(vec.size());
- for (size_t i=0; i<vec.size(); i++) {
- out[i] = vec[i].rec;
- }
-
- return out;
-}
-
-
START_TEST(t_wirs_query_merge)
{
size_t n=1000;
diff --git a/tests/wss_tests.cpp b/tests/wss_tests.cpp
index c0d6f94..de62006 100644
--- a/tests/wss_tests.cpp
+++ b/tests/wss_tests.cpp
@@ -208,17 +208,6 @@ START_TEST(t_wss_query)
END_TEST
-template <RecordInterface R>
-std::vector<R> strip_wrapping(std::vector<Wrapped<R>> vec) {
- std::vector<R> out(vec.size());
- for (size_t i=0; i<vec.size(); i++) {
- out[i] = vec[i].rec;
- }
-
- return out;
-}
-
-
START_TEST(t_wss_query_merge)
{
size_t n=1000;