test: repair two stale unit tests against current APIs (#105)
Jorge Rodríguez committed
- Author
- Jorge Rodríguez · yitano@gmail.comAug 29, 2026 at 06:40
- Committer
- GitHub · noreply@github.comAug 29, 2026 at 06:40
- Parents
- b03d83df87f5
test: repair two stale unit tests against current APIs (#105) Both tests failed to compile, blocking the entire testDebugUnitTest task (Gradle compiles all of src/test before running any filtered subset). Neither is related to Android Auto work; they bit-rotted because no CI workflow runs testDebugUnitTest -- pr.yml, debug.yml, release.yml and .gitlab-ci.yml all only run assembleRelease. DialogsRecentForwardHelperTest called DialogsRecentForwardHelper.dialogIds(), which never existed on the helper. The real API is dialogIdSet(), returning an unordered HashSet, unusable for asserting recency order. Replaced with a local idsInOrder() helper that preserves list order. UserConfigAccountLimitTest asserted a "5th attempt unlocks extended slots" mechanism via SharedConfig.isExtendedAccountLimitUnlocked(), removed when the account-limit logic moved to ExtendedHelper.hasExtended() (token-based, not attempt-counted). Calling hasExtended() from a JVM test is not possible: it initialises NaConfig -> LocaleController -> MessagesController -> ConnectionsManager.native_isTestBackend(), a JNI method with no Robolectric shadow, raising UnsatisfiedLinkError. Narrowed both tests to slot assignment strictly below the cap and documented why the beyond-cap branch needs an instrumented test. 14 of 16 tests now pass. The remaining two failures (OpenCCTest, DnsFactoryTest) are pre-existing and unrelated: both need a native library extracted from app assets, absent in a plain JVM run. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2 files changed+24−32