diff options
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/tests/derived-path.cc | 6 | ||||
-rw-r--r-- | src/libstore/tests/outputs-spec.cc | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/tests/derived-path.cc b/src/libstore/tests/derived-path.cc index e6d32dbd0..160443ec1 100644 --- a/src/libstore/tests/derived-path.cc +++ b/src/libstore/tests/derived-path.cc @@ -27,11 +27,13 @@ Gen<DerivedPath::Built> Arbitrary<DerivedPath::Built>::arbitrary() Gen<DerivedPath> Arbitrary<DerivedPath>::arbitrary() { - switch (*gen::inRange<uint8_t>(0, 1)) { + switch (*gen::inRange<uint8_t>(0, std::variant_size_v<DerivedPath::Raw>)) { case 0: return gen::just<DerivedPath>(*gen::arbitrary<DerivedPath::Opaque>()); - default: + case 1: return gen::just<DerivedPath>(*gen::arbitrary<DerivedPath::Built>()); + default: + assert(false); } } diff --git a/src/libstore/tests/outputs-spec.cc b/src/libstore/tests/outputs-spec.cc index 984d1d963..bf8deaa9d 100644 --- a/src/libstore/tests/outputs-spec.cc +++ b/src/libstore/tests/outputs-spec.cc @@ -206,15 +206,17 @@ using namespace nix; Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary() { - switch (*gen::inRange<uint8_t>(0, 1)) { + switch (*gen::inRange<uint8_t>(0, std::variant_size_v<OutputsSpec::Raw>)) { case 0: return gen::just((OutputsSpec) OutputsSpec::All { }); - default: + case 1: return gen::just((OutputsSpec) OutputsSpec::Names { *gen::nonEmpty(gen::container<StringSet>(gen::map( gen::arbitrary<StorePathName>(), [](StorePathName n) { return n.name; }))), }); + default: + assert(false); } } |