What changed, and why it matters
This commit fixes two compiler warnings about 'dangling else' statements in test code. It adds curly braces so that the intended code is clearly grouped with the 'if' statement. There is no change to the actual behavior of the tests or the Monero software, and no security issue is present.
No security action needed. This is a routine code-quality/test fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch resolves -Wdangling-else warnings in tests/unit_tests/epee_http_server.cpp and tests/unit_tests/wallet_pool.cpp by wrapping single EXPECT_EQ/EXPECT_TRUE macro calls in braces. In both cases the macro expands to a conditional statement, and the prior indentation could mislead a reader about which branch the following statement belongs to. The change is purely syntactic and confined to unit tests; it does not alter runtime logic or affect production code.
Changed components
tests/unit_tests/epee_http_server.cpptests/unit_tests/wallet_pool.cppInspect captured patch +2 / −2
### tests/unit_tests/epee_http_server.cpp
@@ -233,7 +233,7 @@ TEST(http_server, initial_timeout_releases_capacity)
ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &file_limit));
const epee::scope_guard restore_file_limit([file_limit]{
if (file_limit.rlim_cur < 1024)
- EXPECT_EQ(0, setrlimit(RLIMIT_NOFILE, &file_limit));
+ { EXPECT_EQ(0, setrlimit(RLIMIT_NOFILE, &file_limit)); }
});
if (file_limit.rlim_cur < 1024)
{
### tests/unit_tests/wallet_pool.cpp
@@ -550,7 +550,7 @@ TEST(wallet_pool, preserves_daemon_reset_during_pool_processing)
{
EXPECT_TRUE(w.set_daemon("http://127.0.0.1:28081"));
if (switch_back)
- EXPECT_TRUE(w.set_daemon("http://127.0.0.1:18081"));
+ { EXPECT_TRUE(w.set_daemon("http://127.0.0.1:18081")); }
};
w.callback(&callback);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.