summaryrefslogtreecommitdiffstats
path: root/tests/testing.h
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/testing.h
parent59ab2a92a5902b25fbc227bab549eb6f2dd84486 (diff)
downloaddynamic-extension-f8f3cb6c55b085fa260c7f80644d5ef057d4a070.tar.gz
Test refactoring: pulled record stripping function to testing.h
Diffstat (limited to 'tests/testing.h')
-rw-r--r--tests/testing.h11
1 files changed, 11 insertions, 0 deletions
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;