Skip to content

test: improve error handling in GetNetAddr tests#103

Merged
soulteary merged 2 commits intomainfrom
test-main-funcs
Jan 7, 2026
Merged

test: improve error handling in GetNetAddr tests#103
soulteary merged 2 commits intomainfrom
test-main-funcs

Conversation

@soulteary
Copy link
Copy Markdown
Owner

No description provided.

…ndling

- Added tests for NeedValidateConfig to ensure default hooks.json is added when HooksFiles is empty.
- Introduced tests for GetNetAddr to validate behavior with port 0, IPv6 addresses, and address format.
- Implemented tests for DropPrivileges to check behavior with zero and non-zero SetUID.
- Enhanced SetupLogger tests for various log path scenarios, including error handling for invalid paths.
- Added tests for NeedEchoVersionInfo and CheckPrivilegesParamsCorrect to cover edge cases and output validation.
- Updated tests for GetNetAddr to ensure proper closure of listeners by checking if the listener is not only non-nil but also valid.
- Enhanced error handling in multiple test cases to prevent potential nil pointer dereferences.
@soulteary soulteary merged commit 7291e13 into main Jan 7, 2026
3 checks passed
@soulteary soulteary deleted the test-main-funcs branch January 7, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant