From 4dbbd721eb9db75d4968a624b8cb9e75e979a144 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Mon, 2 Sep 2024 20:09:35 +0200 Subject: treewide: consistently mark overridden settings as such Only overridden settings are sent to the daemon, and we're going to do the same for the build hook to. It needs to be ensured that overridden settings are in fact consistently marked as such, so that they actually get sent. Change-Id: I7cd58d925702f86cf2c35ad121eb191ceb62a355 --- tests/unit/libutil/config.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/unit/libutil') diff --git a/tests/unit/libutil/config.cc b/tests/unit/libutil/config.cc index 1600f4ff0..b10b288c1 100644 --- a/tests/unit/libutil/config.cc +++ b/tests/unit/libutil/config.cc @@ -57,7 +57,7 @@ namespace nix { std::map settings; Setting setting{&config, value, "name-of-the-setting", "description"}; - setting.assign("value"); + setting.override("value"); config.getSettings(settings, /* overriddenOnly = */ false); const auto iter = settings.find("name-of-the-setting"); @@ -131,7 +131,7 @@ namespace nix { { std::map settings; - setting.set("foo"); + setting.setDefault("foo"); ASSERT_EQ(setting.get(), "foo"); config.getSettings(settings, /* overriddenOnly = */ true); ASSERT_TRUE(settings.empty()); @@ -170,7 +170,7 @@ namespace nix { "name-of-the-setting", "description", }; - setting.assign("value"); + setting.override("value"); ASSERT_EQ(config.toJSON(), R"#({ @@ -197,7 +197,7 @@ namespace nix { true, Xp::Flakes, }; - setting.assign("value"); + setting.override("value"); ASSERT_EQ(config.toJSON(), R"#({ -- cgit v1.2.3