fix: preserve camera permission intent and distinguish unknown reply expression
This commit is contained in:
@@ -8,11 +8,11 @@ fun main() {
|
||||
}
|
||||
listOf("other" to 1, "neutral" to 2, "happy" to 0, "sad" to 3).forEach { (kind, strength) ->
|
||||
val parsed = checkNotNull(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(7L, 10L, kind, strength, "model"))
|
||||
check(parsed.label == "中立" && parsed.source == com.gorios.lanvoice.dialogue.EmotionSource.FALLBACK)
|
||||
check(parsed.label == "表达未判定(格式回退)" && parsed.source == com.gorios.lanvoice.dialogue.EmotionSource.FALLBACK)
|
||||
}
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(null, 1, "happy", 2, "model") == null)
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", true, "model")?.label == "中立")
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", 2.0, "model")?.label == "中立")
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", true, "model")?.label == "表达未判定(格式回退)")
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", 2.0, "model")?.label == "表达未判定(格式回退)")
|
||||
|
||||
val pcm = ByteArray(640) { (it % 256).toByte() }
|
||||
val uplink = DialogueProtocol.uplink(pcm, 0x81234567L, 0xffffffffL)
|
||||
|
||||
Reference in New Issue
Block a user