From e101ff3e89bae30ed1065f8643318ae641d68c55 Mon Sep 17 00:00:00 2001 From: mandreyel Date: Sat, 11 May 2019 16:38:39 +0200 Subject: [PATCH] Add compile test case for file descriptor constructor overload --- test/test.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/test.cpp b/test/test.cpp index 01a9af1..b0a9c24 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -9,6 +9,12 @@ #include #include +#ifndef _WIN32 +#include +#include +#include +#endif + int handle_error(const std::error_code& error) { const auto& errmsg = error.message(); @@ -121,8 +127,8 @@ int main() CHECK_INVALID_MMAP(m); } + // Make sure these compile. { - // Make sure these compile. mio::ummap_source _1; mio::shared_ummap_source _2; // Make sure shared_mmap mapping compiles as all testing was done on @@ -139,6 +145,11 @@ int main() auto _8 = mio::make_mmap_source(wpath2, error); mio::mmap_source _9; _9.map(wpath1, error); +#else + const int fd = open(path, O_RDONLY); + mio::mmap_source _fdmmap(fd, 0, mio::map_entire_file); + _fdmmap.unmap(); + _fdmmap.map(fd, error); #endif }