Commit 024a5de
test: address five reviewer nits on tst_settings and tst_util (#1502)
Five of seven CodeRabbit findings on tst_settings.cpp and tst_util.cpp
were valid; applying them and skipping two with a rationale.
tst_settings.cpp:
- getPassStore: tighten the "plausible path" predicate. The old
`startsWith('/') || contains('/')` was redundant and Unix-only;
switch to `QDir::isAbsolutePath || contains('/') || contains('\\')`
so Windows paths with backslashes also satisfy the check.
- setAndGetSavestate (profile-keys check): loop over both profile1 and
profile2 instead of asserting just on profile1. Same git-options
assertions now cover both entries.
tst_util.cpp:
- CHI_SQUARE_PERMISSIVE_THRESHOLD_DF9: add a comment explaining the
threshold derivation (above p=0.995 critical value ~23.59 for df=9
to reduce false failures without losing real bias detection).
- isValidKeyIdInvalid: collapse the 6-line ASSUMED_MAX_KEY_ID_LENGTH /
TOO_LONG_KEY_ID_LENGTH dance into a single `kTooLongKeyIdLength = 41`
constexpr with a one-line comment.
- SshAuthSockGuard: move from `namespace {}` to a named
`namespace testutils`. Qualifies all seven usage sites.
Skipped:
- tst_settings::getPasswordConfigurationDefault: CodeRabbit wanted to
compare against a default-constructed PasswordConfiguration. Verified:
this fails when the developer's persistent QSettings hold a non-default
config (the test class itself warns "Non-portable mode detected: tests
may modify persistent user settings"). The current `>= 0` check is
intentionally permissive for non-isolated test runs. Keep it.
- tst_settings isUseGit assertion flip: CodeRabbit's suggested rewrite
changes the assertions to claim isUseGit auto-detects .git regardless
of the default arg. Verified against qtpasssettings.cpp:707 — the
auto-detect branch is guarded by `&& defaultValue`, so it only fires
when default=true. The current assertions match the production
behaviour. Suggested rewrite would break them.
Build clean, 113/113 settings + 136/136 util tests pass.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 13f7782 commit 024a5de
2 files changed
Lines changed: 34 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
512 | 513 | | |
513 | 514 | | |
514 | 515 | | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
527 | 531 | | |
528 | 532 | | |
529 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
1221 | 1224 | | |
1222 | 1225 | | |
1223 | 1226 | | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1234 | 1230 | | |
1235 | 1231 | | |
1236 | | - | |
| 1232 | + | |
1237 | 1233 | | |
1238 | 1234 | | |
1239 | 1235 | | |
| |||
2080 | 2076 | | |
2081 | 2077 | | |
2082 | 2078 | | |
2083 | | - | |
| 2079 | + | |
2084 | 2080 | | |
2085 | 2081 | | |
2086 | 2082 | | |
| |||
2103 | 2099 | | |
2104 | 2100 | | |
2105 | 2101 | | |
2106 | | - | |
| 2102 | + | |
2107 | 2103 | | |
2108 | 2104 | | |
2109 | 2105 | | |
2110 | 2106 | | |
2111 | 2107 | | |
2112 | | - | |
| 2108 | + | |
2113 | 2109 | | |
2114 | 2110 | | |
2115 | 2111 | | |
| |||
2122 | 2118 | | |
2123 | 2119 | | |
2124 | 2120 | | |
2125 | | - | |
| 2121 | + | |
2126 | 2122 | | |
2127 | 2123 | | |
2128 | 2124 | | |
| |||
2132 | 2128 | | |
2133 | 2129 | | |
2134 | 2130 | | |
2135 | | - | |
| 2131 | + | |
2136 | 2132 | | |
2137 | 2133 | | |
2138 | 2134 | | |
| |||
2147 | 2143 | | |
2148 | 2144 | | |
2149 | 2145 | | |
2150 | | - | |
| 2146 | + | |
2151 | 2147 | | |
2152 | 2148 | | |
2153 | 2149 | | |
| |||
2162 | 2158 | | |
2163 | 2159 | | |
2164 | 2160 | | |
2165 | | - | |
| 2161 | + | |
2166 | 2162 | | |
2167 | 2163 | | |
2168 | 2164 | | |
| |||
2184 | 2180 | | |
2185 | 2181 | | |
2186 | 2182 | | |
2187 | | - | |
| 2183 | + | |
2188 | 2184 | | |
2189 | 2185 | | |
2190 | 2186 | | |
| |||
2201 | 2197 | | |
2202 | 2198 | | |
2203 | 2199 | | |
2204 | | - | |
| 2200 | + | |
2205 | 2201 | | |
2206 | 2202 | | |
2207 | 2203 | | |
| |||
0 commit comments