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/compactcas.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/compactcas.cpp')
| -rw-r--r-- | zenstore/compactcas.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index 70a88ecad..60644847f 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -732,7 +732,7 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) #if ZEN_WITH_TESTS namespace { - static IoBuffer CreateChunk(uint64_t Size) + static IoBuffer CreateRandomChunk(uint64_t Size) { static std::random_device rd; static std::mt19937 g(rd()); @@ -865,7 +865,7 @@ TEST_CASE("compactcas.compact.totalsize") for (int32_t Idx = 0; Idx < kChunkCount; ++Idx) { - IoBuffer Chunk = CreateChunk(kChunkSize); + IoBuffer Chunk = CreateRandomChunk(kChunkSize); const IoHash Hash = HashBuffer(Chunk); CasStore::InsertResult InsertResult = Cas.InsertChunk(Chunk, Hash); ZEN_ASSERT(InsertResult.New); @@ -904,7 +904,7 @@ TEST_CASE("compactcas.gc.basic") CasContainerStrategy Cas(Gc); Cas.Initialize(TempDir.Path(), "cb", 65536, 1 << 4, true); - IoBuffer Chunk = CreateChunk(128); + IoBuffer Chunk = CreateRandomChunk(128); IoHash ChunkHash = IoHash::HashBuffer(Chunk); const CasStore::InsertResult InsertResult = Cas.InsertChunk(Chunk, ChunkHash); @@ -923,7 +923,7 @@ TEST_CASE("compactcas.gc.removefile") { ScopedTemporaryDirectory TempDir; - IoBuffer Chunk = CreateChunk(128); + IoBuffer Chunk = CreateRandomChunk(128); IoHash ChunkHash = IoHash::HashBuffer(Chunk); { GcManager Gc; @@ -964,7 +964,7 @@ TEST_CASE("compactcas.gc.compact") Chunks.reserve(9); for (uint64_t Size : ChunkSizes) { - Chunks.push_back(CreateChunk(Size)); + Chunks.push_back(CreateRandomChunk(Size)); } std::vector<IoHash> ChunkHashes; @@ -1190,7 +1190,7 @@ TEST_CASE("compactcas.gc.deleteblockonopen") Chunks.reserve(20); for (uint64_t Size : ChunkSizes) { - Chunks.push_back(CreateChunk(Size)); + Chunks.push_back(CreateRandomChunk(Size)); } std::vector<IoHash> ChunkHashes; @@ -1256,7 +1256,7 @@ TEST_CASE("compactcas.gc.handleopeniobuffer") Chunks.reserve(20); for (const uint64_t& Size : ChunkSizes) { - Chunks.push_back(CreateChunk(Size)); + Chunks.push_back(CreateRandomChunk(Size)); } std::vector<IoHash> ChunkHashes; @@ -1308,7 +1308,7 @@ TEST_CASE("compactcas.threadedinsert") { while (true) { - IoBuffer Chunk = CreateChunk(kChunkSize); + IoBuffer Chunk = CreateRandomChunk(kChunkSize); IoHash Hash = HashBuffer(Chunk); if (Chunks.contains(Hash)) { @@ -1377,7 +1377,7 @@ TEST_CASE("compactcas.threadedinsert") for (int32_t Idx = 0; Idx < kChunkCount; ++Idx) { - IoBuffer Chunk = CreateChunk(kChunkSize); + IoBuffer Chunk = CreateRandomChunk(kChunkSize); IoHash Hash = HashBuffer(Chunk); NewChunks[Hash] = Chunk; } |