diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 75bb31c9b..06124bf15 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -9,6 +9,10 @@ #include +#ifdef NDEBUG +#error "Nix may not be built with assertions disabled (i.e. with -DNDEBUG)." +#endif + namespace nix { void initLibUtil() { diff --git a/tests/unit/libstore/outputs-spec.cc b/tests/unit/libstore/outputs-spec.cc index 456196be1..63cde681b 100644 --- a/tests/unit/libstore/outputs-spec.cc +++ b/tests/unit/libstore/outputs-spec.cc @@ -6,11 +6,9 @@ namespace nix { -#ifndef NDEBUG TEST(OutputsSpec, no_empty_names) { ASSERT_DEATH(OutputsSpec::Names { std::set { } }, ""); } -#endif #define TEST_DONT_PARSE(NAME, STR) \ TEST(OutputsSpec, bad_ ## NAME) { \