aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libstore
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-08-01 13:42:02 -0700
committerJade Lovelace <lix@jade.fyi>2024-08-08 14:53:17 -0700
commit370ac940dd7816ad4052fafa4e0f8d17784fa16b (patch)
tree8b44ebb7e8f4e218c1b4e57edfc6aaac212b90fa /tests/unit/libstore
parentf3ef0899c744ff5256414c8539c75e798a058ee0 (diff)
refactor: make HashType and Base enum classes for type safety
Change-Id: I9fbd55a9d50464a56fe11cb42a06a206914150d8
Diffstat (limited to 'tests/unit/libstore')
-rw-r--r--tests/unit/libstore/common-protocol.cc8
-rw-r--r--tests/unit/libstore/derivation.cc4
-rw-r--r--tests/unit/libstore/serve-protocol.cc10
-rw-r--r--tests/unit/libstore/worker-protocol.cc10
4 files changed, 16 insertions, 16 deletions
diff --git a/tests/unit/libstore/common-protocol.cc b/tests/unit/libstore/common-protocol.cc
index 86ba537db..9523c9acb 100644
--- a/tests/unit/libstore/common-protocol.cc
+++ b/tests/unit/libstore/common-protocol.cc
@@ -102,15 +102,15 @@ CHARACTERIZATION_TEST(
(std::tuple<ContentAddress, ContentAddress, ContentAddress> {
ContentAddress {
.method = TextIngestionMethod {},
- .hash = hashString(HashType::htSHA256, "Derive(...)"),
+ .hash = hashString(HashType::SHA256, "Derive(...)"),
},
ContentAddress {
.method = FileIngestionMethod::Flat,
- .hash = hashString(HashType::htSHA1, "blob blob..."),
+ .hash = hashString(HashType::SHA1, "blob blob..."),
},
ContentAddress {
.method = FileIngestionMethod::Recursive,
- .hash = hashString(HashType::htSHA256, "(...)"),
+ .hash = hashString(HashType::SHA256, "(...)"),
},
}))
@@ -197,7 +197,7 @@ CHARACTERIZATION_TEST(
std::optional {
ContentAddress {
.method = FileIngestionMethod::Flat,
- .hash = hashString(HashType::htSHA1, "blob blob..."),
+ .hash = hashString(HashType::SHA1, "blob blob..."),
},
},
}))
diff --git a/tests/unit/libstore/derivation.cc b/tests/unit/libstore/derivation.cc
index ca0cdff71..f6401a095 100644
--- a/tests/unit/libstore/derivation.cc
+++ b/tests/unit/libstore/derivation.cc
@@ -148,7 +148,7 @@ TEST_JSON(DynDerivationTest, caFixedText,
TEST_JSON(CaDerivationTest, caFloating,
(DerivationOutput::CAFloating {
.method = FileIngestionMethod::Recursive,
- .hashType = htSHA256,
+ .hashType = HashType::SHA256,
}),
"drv-name", "output-name")
@@ -159,7 +159,7 @@ TEST_JSON(DerivationTest, deferred,
TEST_JSON(ImpureDerivationTest, impure,
(DerivationOutput::Impure {
.method = FileIngestionMethod::Recursive,
- .hashType = htSHA256,
+ .hashType = HashType::SHA256,
}),
"drv-name", "output-name")
diff --git a/tests/unit/libstore/serve-protocol.cc b/tests/unit/libstore/serve-protocol.cc
index 6cc60ca3e..c6793be74 100644
--- a/tests/unit/libstore/serve-protocol.cc
+++ b/tests/unit/libstore/serve-protocol.cc
@@ -53,15 +53,15 @@ VERSIONED_CHARACTERIZATION_TEST(
(std::tuple<ContentAddress, ContentAddress, ContentAddress> {
ContentAddress {
.method = TextIngestionMethod {},
- .hash = hashString(HashType::htSHA256, "Derive(...)"),
+ .hash = hashString(HashType::SHA256, "Derive(...)"),
},
ContentAddress {
.method = FileIngestionMethod::Flat,
- .hash = hashString(HashType::htSHA1, "blob blob..."),
+ .hash = hashString(HashType::SHA1, "blob blob..."),
},
ContentAddress {
.method = FileIngestionMethod::Recursive,
- .hash = hashString(HashType::htSHA256, "(...)"),
+ .hash = hashString(HashType::SHA256, "(...)"),
},
}))
@@ -278,7 +278,7 @@ VERSIONED_CHARACTERIZATION_TEST(
"foo",
FixedOutputInfo {
.method = FileIngestionMethod::Recursive,
- .hash = hashString(HashType::htSHA256, "(...)"),
+ .hash = hashString(HashType::SHA256, "(...)"),
.references = {
.others = {
StorePath {
@@ -348,7 +348,7 @@ VERSIONED_CHARACTERIZATION_TEST(
std::optional {
ContentAddress {
.method = FileIngestionMethod::Flat,
- .hash = hashString(HashType::htSHA1, "blob blob..."),
+ .hash = hashString(HashType::SHA1, "blob blob..."),
},
},
}))
diff --git a/tests/unit/libstore/worker-protocol.cc b/tests/unit/libstore/worker-protocol.cc
index f36de9cf9..92a33f595 100644
--- a/tests/unit/libstore/worker-protocol.cc
+++ b/tests/unit/libstore/worker-protocol.cc
@@ -55,15 +55,15 @@ VERSIONED_CHARACTERIZATION_TEST(
(std::tuple<ContentAddress, ContentAddress, ContentAddress> {
ContentAddress {
.method = TextIngestionMethod {},
- .hash = hashString(HashType::htSHA256, "Derive(...)"),
+ .hash = hashString(HashType::SHA256, "Derive(...)"),
},
ContentAddress {
.method = FileIngestionMethod::Flat,
- .hash = hashString(HashType::htSHA1, "blob blob..."),
+ .hash = hashString(HashType::SHA1, "blob blob..."),
},
ContentAddress {
.method = FileIngestionMethod::Recursive,
- .hash = hashString(HashType::htSHA256, "(...)"),
+ .hash = hashString(HashType::SHA256, "(...)"),
},
}))
@@ -417,7 +417,7 @@ VERSIONED_CHARACTERIZATION_TEST(
"foo",
FixedOutputInfo {
.method = FileIngestionMethod::Recursive,
- .hash = hashString(HashType::htSHA256, "(...)"),
+ .hash = hashString(HashType::SHA256, "(...)"),
.references = {
.others = {
StorePath {
@@ -492,7 +492,7 @@ VERSIONED_CHARACTERIZATION_TEST(
std::optional {
ContentAddress {
.method = FileIngestionMethod::Flat,
- .hash = hashString(HashType::htSHA1, "blob blob..."),
+ .hash = hashString(HashType::SHA1, "blob blob..."),
},
},
}))