summaryrefslogtreecommitdiff
path: root/test/io_test_helper.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-01-02 22:42:31 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-01-02 22:42:31 +0100
commit6ed8f5151719fbc14ec0ac6d28a346d1f74cf2ca (patch)
treeebe7588e89e1aa2ae5376acf85f3a3a7b2ec7e10 /test/io_test_helper.hh
Initial commitHEADmain
Diffstat (limited to 'test/io_test_helper.hh')
-rw-r--r--test/io_test_helper.hh27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/io_test_helper.hh b/test/io_test_helper.hh
new file mode 100644
index 0000000..eb7bbb3
--- /dev/null
+++ b/test/io_test_helper.hh
@@ -0,0 +1,27 @@
+#ifndef IO_TEST_HELPER_HH
+#define IO_TEST_HELPER_HH
+
+#include "io.hh" // IWYU pragma: export
+
+#include <cstddef>
+#include <memory>
+
+[[nodiscard]]
+std::unique_ptr<io::Reader> io_make_breaking(
+ std::unique_ptr<io::Reader> reader, size_t offset = 0,
+ io::ReadError error = io::ReadError::Error);
+
+[[nodiscard]]
+std::unique_ptr<io::Writer> io_make_breaking(
+ std::unique_ptr<io::Writer> writer, size_t offset = 0,
+ io::WriteError error = io::WriteError::Error);
+
+[[nodiscard]]
+std::unique_ptr<io::Reader> io_make_max_block(
+ std::unique_ptr<io::Reader> reader, size_t max_block_size);
+
+[[nodiscard]]
+std::unique_ptr<io::Writer> io_make_max_block(
+ std::unique_ptr<io::Writer> writer, size_t max_block_size);
+
+#endif // IO_TEST_HELPER_HH