1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 09:19:36 +01:00

Make a few more things use StoreDirConfig instead of Store

This commit is contained in:
John Ericson 2025-08-15 14:55:47 -04:00
parent 316fef35dc
commit 79fb9b0d3c
11 changed files with 45 additions and 38 deletions

View file

@ -10,7 +10,7 @@
namespace nix {
template<class Proto, const char * protocolDir>
class ProtoTest : public CharacterizationTest, public LibStoreTest
class ProtoTest : public CharacterizationTest
{
std::filesystem::path unitTestData = getUnitTestData() / protocolDir;
@ -18,6 +18,10 @@ class ProtoTest : public CharacterizationTest, public LibStoreTest
{
return unitTestData / (std::string{testStem + ".bin"});
}
public:
Path storeDir = "/nix/store";
StoreDirConfig store{storeDir};
};
template<class Proto, const char * protocolDir>
@ -34,7 +38,7 @@ public:
T got = ({
StringSource from{encoded};
Proto::template Serialise<T>::read(
*LibStoreTest::store,
this->store,
typename Proto::ReadConn{
.from = from,
.version = version,
@ -54,7 +58,7 @@ public:
CharacterizationTest::writeTest(testStem, [&]() {
StringSink to;
Proto::template Serialise<T>::write(
*LibStoreTest::store,
this->store,
typename Proto::WriteConn{
.to = to,
.version = version,