mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 22:42:41 +01:00
ValidPathInfo, NarInfo, turn funky constructor into static method
This is more flexible, and needed for me to be able to reshuffle the inheritance bureaucracy to make the JSON instances more precise.
This commit is contained in:
parent
465d627f7f
commit
74be28820c
14 changed files with 44 additions and 50 deletions
|
|
@ -23,7 +23,7 @@ class NarInfoTest : public CharacterizationTest, public LibStoreTest
|
|||
|
||||
static NarInfo makeNarInfo(const Store & store, bool includeImpureInfo)
|
||||
{
|
||||
NarInfo info = ValidPathInfo{
|
||||
auto info = NarInfo::makeFromCA(
|
||||
store,
|
||||
"foo",
|
||||
FixedOutputInfo{
|
||||
|
|
@ -41,8 +41,7 @@ static NarInfo makeNarInfo(const Store & store, bool includeImpureInfo)
|
|||
.self = true,
|
||||
},
|
||||
},
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
|
||||
};
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="));
|
||||
info.narSize = 34878;
|
||||
if (includeImpureInfo) {
|
||||
info.deriver = StorePath{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static UnkeyedValidPathInfo makeEmpty()
|
|||
|
||||
static ValidPathInfo makeFullKeyed(const Store & store, bool includeImpureInfo)
|
||||
{
|
||||
ValidPathInfo info = ValidPathInfo{
|
||||
auto info = ValidPathInfo::makeFromCA(
|
||||
store,
|
||||
"foo",
|
||||
FixedOutputInfo{
|
||||
|
|
@ -47,8 +47,7 @@ static ValidPathInfo makeFullKeyed(const Store & store, bool includeImpureInfo)
|
|||
.self = true,
|
||||
},
|
||||
},
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
|
||||
};
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="));
|
||||
info.narSize = 34878;
|
||||
if (includeImpureInfo) {
|
||||
info.deriver = StorePath{
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ VERSIONED_CHARACTERIZATION_TEST(
|
|||
info;
|
||||
}),
|
||||
({
|
||||
ValidPathInfo info{
|
||||
auto info = ValidPathInfo::makeFromCA(
|
||||
store,
|
||||
"foo",
|
||||
FixedOutputInfo{
|
||||
|
|
@ -291,8 +291,7 @@ VERSIONED_CHARACTERIZATION_TEST(
|
|||
.self = true,
|
||||
},
|
||||
},
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
|
||||
};
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="));
|
||||
info.deriver = StorePath{
|
||||
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ VERSIONED_CHARACTERIZATION_TEST(
|
|||
info;
|
||||
}),
|
||||
({
|
||||
ValidPathInfo info{
|
||||
auto info = ValidPathInfo::makeFromCA(
|
||||
store,
|
||||
"foo",
|
||||
FixedOutputInfo{
|
||||
|
|
@ -532,8 +532,7 @@ VERSIONED_CHARACTERIZATION_TEST(
|
|||
.self = true,
|
||||
},
|
||||
},
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
|
||||
};
|
||||
Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="));
|
||||
info.registrationTime = 23423;
|
||||
info.narSize = 34878;
|
||||
info;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue