[quality] Unit tests needed for bluefin-dynamic-wallpaper (hemisphere/month logic)
kind/tech-debtarea/testingstatus/queued
## Finding
`system_files/bluefin/usr/libexec/bluefin-dynamic-wallpaper` contains non-trivial seasonal wallpaper logic:
- Southern hemisphere month offset: `(MONTH_NUM + 5) % 12 + 1`
- Personal wallpaper detection (regex matching against current gsettings)
- Latitude parsing and validation
- Error handling for location service failures (exit codes 0, 2, non-zero)
- Month padding and wallpaper file existence checks
An off-by-one in the month calculation silently delivers the wrong wallpaper for all southern-hemisphere users. The latitude parsing has edge cases around negative numbers and validation.
## Recommendation
Add `tests/test_dynamic_wallpaper.bats` testing:
1. Northern hemisphere month→wallpaper mapping (months 1-12)
2. Southern hemisphere offset (month 7 → wallpaper 01, etc.)
3. Personal wallpaper detection (non-bluefin wallpaper → early exit)
4. Invalid latitude handling (non-numeric, empty)
5. Location service failure modes (exit code 2 vs other errors)
6. Missing wallpaper file → exit 1
Mock `gsettings`, `date`, and `/usr/libexec/get-geoclue-latitude` with PATH-based stubs.
## Priority
- Impact: **medium** — wrong wallpaper for half the user base if broken
- Effort: **low** — straightforward mocking, self-contained logic
---
*Filed by quality agent (hold-gated mode)*
<!-- factory-pipeline-start -->
**Common · issue pipeline**
```text
▶ triage needs kind/ + area/ then /approve
· discussing —
· queued —
· claimed —
· done —
```
**area:** — **priority:** —
**maintainer:** set kind/ + area/ labels, then comment /approve
**reporter:** answer questions; add repro steps if a bug
<!-- factory-pipeline-end -->
1 条评论