diff options
| author | Stefan Boberg <[email protected]> | 2021-10-29 18:41:26 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-29 18:41:26 +0200 |
| commit | 7b2afa7e5791d2b401e32911362ac9f1e1106598 (patch) | |
| tree | a537a2d47b8b985f393400ce8fc785d6ad5999a5 /zenserver/cache/structuredcachestore.cpp | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-7b2afa7e5791d2b401e32911362ac9f1e1106598.tar.xz zen-7b2afa7e5791d2b401e32911362ac9f1e1106598.zip | |
Minor cleanup
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index 02ec43115..e1d77a088 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -22,11 +22,12 @@ #include <zenstore/cas.h> #include <zenstore/caslog.h> #include <zenstore/cidstore.h> +#include <zenstore/gc.h> #include <concepts> #include <filesystem> -#include <unordered_map> #include <ranges> +#include <unordered_map> ZEN_THIRD_PARTY_INCLUDES_START #include <fmt/core.h> @@ -1116,42 +1117,6 @@ TEST_CASE("z$.store") } } -TEST_CASE("z$.gc") -{ - using namespace fmt::literals; - using namespace std::literals; - - ScopedTemporaryDirectory TempDir; - - CasStoreConfiguration Config{.RootDirectory = TempDir.Path()}; - std::unique_ptr<CasStore> Cas{CreateCasStore()}; - Cas->Initialize(Config); - - CidStore Cid(*Cas, TempDir.Path()); - - ZenCacheStore Zcs(TempDir.Path() / "cache"); - - const int kIterationCount = 100; - - for (int i = 0; i < kIterationCount; ++i) - { - const IoHash Key = IoHash::HashBuffer(&i, sizeof i); - - CompressedBuffer CompBuf = CompressedBuffer::Compress(SharedBuffer::MakeView("abcd"sv)); - Cid.AddChunk(CompBuf); - - CbObjectWriter Cbo; - Cbo << "hey" << i << "ref" << CbAttachment(CompBuf); - CbObject Obj = Cbo.Save(); - - ZenCacheValue Value; - Value.Value = Obj.GetBuffer().AsIoBuffer(); - Value.Value.SetContentType(ZenContentType::kCbObject); - - Zcs.Put("test_bucket"sv, Key, Value); - } -} - #endif void |