diff options
| author | Stefan Boberg <[email protected]> | 2023-04-19 10:43:28 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2023-04-19 10:52:48 +0200 |
| commit | 9fb9d6ce5aaedd4ecf4f7bdc9c33a94b1e6597b2 (patch) | |
| tree | 924c8ede64e087a5bdfeeb87862bc08e325f4ddc /zenstore/gc.cpp | |
| parent | added missing #pragma once (diff) | |
| download | zen-9fb9d6ce5aaedd4ecf4f7bdc9c33a94b1e6597b2.tar.xz zen-9fb9d6ce5aaedd4ecf4f7bdc9c33a94b1e6597b2.zip | |
tweaks for enabling unity builds
mostly changes to make sure anonymous namespaces don't clash and a change to avoid windows headers from leaking into other compilation units
unity builds are not yet enabled by default, but can be enabled by uncommenting this line in the root `xmake.lua`
```
--add_rules("c++.unity_build")
```
Diffstat (limited to 'zenstore/gc.cpp')
| -rw-r--r-- | zenstore/gc.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp index 8d3b8d018..370c3c965 100644 --- a/zenstore/gc.cpp +++ b/zenstore/gc.cpp @@ -888,7 +888,7 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& ExpireTime, bool Delete, b #if ZEN_WITH_TESTS -namespace { +namespace gc::impl { static IoBuffer CreateChunk(uint64_t Size) { static std::random_device rd; @@ -909,10 +909,12 @@ namespace { { return CompressedBuffer::Compress(SharedBuffer::MakeView(Buffer.GetData(), Buffer.GetSize())); } -} // namespace +} // namespace gc::impl TEST_CASE("gc.basic") { + using namespace gc::impl; + ScopedTemporaryDirectory TempDir; CidStoreConfiguration CasConfig; @@ -940,6 +942,8 @@ TEST_CASE("gc.basic") TEST_CASE("gc.full") { + using namespace gc::impl; + ScopedTemporaryDirectory TempDir; CidStoreConfiguration CasConfig; @@ -1140,6 +1144,8 @@ TEST_CASE("gc.full") TEST_CASE("gc.diskusagewindow") { + using namespace gc::impl; + DiskUsageWindow Stats; Stats.Append({.SampleTime = 0, .DiskUsage = 0}); // 0 0 Stats.Append({.SampleTime = 10, .DiskUsage = 10}); // 1 10 |