From fb8983cb97f0ba0279c5e0a487f39f4fb23d35be Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Fri, 6 Dec 2024 11:08:59 -0500 Subject: [PATCH] [#8047] Guarantee test users are removed if rc_switch_user test fails. --- unit_tests/src/test_rc_switch_user.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_tests/src/test_rc_switch_user.cpp b/unit_tests/src/test_rc_switch_user.cpp index 527fc7475d..0a9edf50b1 100644 --- a/unit_tests/src/test_rc_switch_user.cpp +++ b/unit_tests/src/test_rc_switch_user.cpp @@ -395,8 +395,8 @@ TEST_CASE("rc_switch_user can be called multiple times when KW_SWITCH_PROXY_USER // Create a groupadmin. const adm::user bob{"test_user_bob", env.rodsZone}; REQUIRE_NOTHROW(adm::client::add_user(conn, bob)); - REQUIRE_NOTHROW(adm::client::modify_user(conn, bob, adm::user_password_property{"rods"})); irods::at_scope_exit remove_test_user_bob{[&conn, &bob] { REQUIRE_NOTHROW(adm::client::remove_user(conn, bob)); }}; + REQUIRE_NOTHROW(adm::client::modify_user(conn, bob, adm::user_password_property{"rods"})); REQUIRE_NOTHROW(adm::client::modify_user(conn, bob, adm::user_type_property{adm::user_type::groupadmin})); //