summaryrefslogtreecommitdiff
path: root/test-runner/src/main/kotlin/org
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-04-22 09:02:55 +0000
committerClaude <noreply@anthropic.com>2026-04-22 09:02:55 +0000
commit45b1b1d7aab84bbde44fbc731a1520aae9e9959a (patch)
tree3f19528a27b243a5574e7b7ed6d629db9f0b6cb8 /test-runner/src/main/kotlin/org
parentce555a54b47c5bbb8df3eb9dd9ac69bd6a65be24 (diff)
parente141e1ef46ebb2a61f452122201a77527a5a1c9e (diff)
Merge branch 'claude/hardware-source-flags'
CI fixes + hardware source feature flags. 102 tests, all GREEN. https://claude.ai/code/session_011h2dXbgXg3PesQMmQUNTCW
Diffstat (limited to 'test-runner/src/main/kotlin/org')
-rw-r--r--test-runner/src/main/kotlin/org/terst/nav/settings/HardwareSource.kt23
1 files changed, 23 insertions, 0 deletions
diff --git a/test-runner/src/main/kotlin/org/terst/nav/settings/HardwareSource.kt b/test-runner/src/main/kotlin/org/terst/nav/settings/HardwareSource.kt
new file mode 100644
index 0000000..b44cb66
--- /dev/null
+++ b/test-runner/src/main/kotlin/org/terst/nav/settings/HardwareSource.kt
@@ -0,0 +1,23 @@
+package org.terst.nav.settings
+
+enum class HardwareSource(val prefKey: String, val label: String) {
+ AIS_RECEIVER("hw_ais_receiver", "AIS Receiver"),
+ NMEA_INSTRUMENTS("hw_nmea_instruments", "NMEA Instruments")
+}
+
+/** Minimal in-memory implementation for JVM tests. */
+class InMemoryFeatureFlags {
+ private val state = mutableMapOf<HardwareSource, Boolean>()
+
+ fun isEnabled(source: HardwareSource): Boolean = state[source] ?: false
+
+ fun setEnabled(source: HardwareSource, enabled: Boolean) {
+ state[source] = enabled
+ }
+
+ fun toggle(source: HardwareSource): Boolean {
+ val next = !isEnabled(source)
+ setEnabled(source, next)
+ return next
+ }
+}