diff options
Diffstat (limited to 'test/base/platform/unix/UnixFileTest.cpp')
-rw-r--r-- | test/base/platform/unix/UnixFileTest.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/base/platform/unix/UnixFileTest.cpp b/test/base/platform/unix/UnixFileTest.cpp index d5bba0db..b18b6bce 100644 --- a/test/base/platform/unix/UnixFileTest.cpp +++ b/test/base/platform/unix/UnixFileTest.cpp @@ -1,12 +1,12 @@ -#include "cru/base/platform/unix/UnixFileStream.h" +#include "cru/base/platform/unix/UnixFile.h" #include <catch2/catch_test_macros.hpp> #include <fcntl.h> #include <filesystem> -TEST_CASE("UnixFile Work", "[unix]") { +TEST_CASE("UnixFile Auto Close", "[unix]") { using namespace cru; using namespace cru::platform::unix; @@ -36,3 +36,13 @@ TEST_CASE("UnixFile Work", "[unix]") { std::filesystem::remove(temp_file_path); } + +TEST_CASE("UnixFile NonBlock Read", "[unix]") { + using namespace cru; + using namespace cru::platform::unix; + + char buffer[1]; + + auto pipe = OpenUniDirectionalPipe(UnixPipeFlags::NonBlock); + REQUIRE(pipe.read.Read(buffer, 1) == -1); +} |