diff options
| author | Dan Engelbrecht <[email protected]> | 2024-05-29 08:54:01 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-05-29 08:54:01 +0200 |
| commit | 3d3a39d69b39d5202960ada6d3512786fa4a8c83 (patch) | |
| tree | f981eaf60b278edc84d7bd959153981fc2934b22 /src/zencore/iobuffer.cpp | |
| parent | 5.5.2 (diff) | |
| download | zen-3d3a39d69b39d5202960ada6d3512786fa4a8c83.tar.xz zen-3d3a39d69b39d5202960ada6d3512786fa4a8c83.zip | |
workspace shares (#84)
Feature: New 'workspaces' service which allows a user to share a local folder via zenserver. A workspace can have mulitple workspace shares and they provie an HTTP API that is compatible with the project oplog HTTP API. Workspaces and shares are preserved between runs. Workspaces feature is disabled by default - enable with --workspaces-enabled option when launching zenserver.
Diffstat (limited to 'src/zencore/iobuffer.cpp')
| -rw-r--r-- | src/zencore/iobuffer.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/zencore/iobuffer.cpp b/src/zencore/iobuffer.cpp index fd99a01cb..33762bdb7 100644 --- a/src/zencore/iobuffer.cpp +++ b/src/zencore/iobuffer.cpp @@ -30,6 +30,10 @@ ZEN_THIRD_PARTY_INCLUDES_END # include <unistd.h> #endif +#if ZEN_WITH_TESTS +# include <zencore/testutils.h> +#endif + #include <gsl/gsl-lite.hpp> namespace zen { @@ -723,14 +727,16 @@ TEST_CASE("IoBuffer") TEST_CASE("IoBuffer.mmap") { + zen::ScopedTemporaryDirectory TempDir; + zen::IoBuffer Buffer1{65536}; uint8_t* Mutate = Buffer1.MutableData<uint8_t>(); memcpy(Mutate, "abc123", 6); - zen::WriteFile("test_file.data", Buffer1); + zen::WriteFile(TempDir.Path() / "test_file.data", Buffer1); SUBCASE("in-range") { - zen::IoBuffer FileBuffer = IoBufferBuilder::MakeFromFile("test_file.data", 0, 65536); + zen::IoBuffer FileBuffer = IoBufferBuilder::MakeFromFile(TempDir.Path() / "test_file.data", 0, 65536); const void* Data = FileBuffer.GetData(); CHECK(Data != nullptr); CHECK_EQ(memcmp(Data, "abc123", 6), 0); @@ -741,7 +747,7 @@ TEST_CASE("IoBuffer.mmap") # if ZEN_PLATFORM_WINDOWS SUBCASE("out-of-range") { - zen::IoBuffer FileBuffer = IoBufferBuilder::MakeFromFile("test_file.data", 131072, 65536); + zen::IoBuffer FileBuffer = IoBufferBuilder::MakeFromFile(TempDir.Path() / "test_file.data", 131072, 65536); const void* Data = nullptr; CHECK_THROWS(Data = FileBuffer.GetData()); CHECK(Data == nullptr); |