test(android): add unit test baseline + fix socksPort import validation - #14
Merged
Conversation
Add JUnit4/Truth test dependencies and 15 unit tests covering ConfigGenerator.generateConfig and ProfilesViewModel.parseProfileFromJson, establishing a regression baseline for the Android client. - ConfigGeneratorTest (8 tests): default fields, socks_port/user/pass omitempty, script_keys id|account parsing, sni handling, idle_slots_per_bucket always-present, coalesce_step_ms omitempty. - ProfilesViewModelParseTest (7 tests): empty/invalid JSON rejection, idleSlotsPerBucket clamping, socksPort privileged-port rejection, script_keys object+primitive forms, remoteUrl/name defaults. Bug fixes found during baseline creation: - parseProfileFromJson accepted invalid socks_port values (0, 99999, privileged ports 1-1023) without bounds checking. Clamp to non-privileged range 1024-65535 so malformed imports cannot produce a config that fails at SOCKS5 bind time. - Add testOptions.isReturnDefaultValues=true so android.util.Log calls in ConfigGenerator do not crash JVM unit tests. CI: add a 'Run unit tests' step to android-ci.yml that runs ./gradlew :app:testDebugUnitTest on every push and PR.
Hidden-Node
force-pushed
the
advisor/001-test-baseline
branch
from
July 18, 2026 19:50
defa4e5 to
fddf3bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.