summaryrefslogtreecommitdiff
path: root/test/helpers.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-08-08 16:14:50 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-08-08 16:15:07 +0100
commitbdb5c897087d3588f456c020b3633cbd694003da (patch)
treeef09420dad64a438e097645850b8596eebe28a97 /test/helpers.cpp
parentSimplify some bits with concepts (diff)
downloadmygrate-bdb5c897087d3588f456c020b3633cbd694003da.tar.bz2
mygrate-bdb5c897087d3588f456c020b3633cbd694003da.tar.xz
mygrate-bdb5c897087d3588f456c020b3633cbd694003da.zip
Tests, fixes, improvements to WritePqCopyStream
Diffstat (limited to 'test/helpers.cpp')
-rw-r--r--test/helpers.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/helpers.cpp b/test/helpers.cpp
new file mode 100644
index 0000000..f4fc030
--- /dev/null
+++ b/test/helpers.cpp
@@ -0,0 +1,15 @@
+#include "helpers.h"
+
+MemStream::MemStream() : out {nullptr}, len {}, s {open_memstream(&out, &len)} { }
+
+MemStream::~MemStream()
+{
+ fclose(s);
+ free(out);
+}
+
+void
+MemStream::flush()
+{
+ fflush(s);
+}