Fixes assertion
This commit is contained in:
+1
-1
@@ -696,7 +696,7 @@ class ChessLobbyLogic(
|
|||||||
// Check status FIRST to avoid briefly emitting a finished game through activeGames
|
// Check status FIRST to avoid briefly emitting a finished game through activeGames
|
||||||
val gameStatus = result.liveState.gameStatus.value
|
val gameStatus = result.liveState.gameStatus.value
|
||||||
if (gameStatus is GameStatus.Finished) {
|
if (gameStatus is GameStatus.Finished) {
|
||||||
Log.d("chessdebug") { "[Lobby] refreshGame: game ${startEventId.take(8)} is FINISHED (${(gameStatus as GameStatus.Finished).result}), moving to completed" }
|
Log.d("chessdebug") { "[Lobby] refreshGame: game ${startEventId.take(8)} is FINISHED (${gameStatus.result}), moving to completed" }
|
||||||
state.moveToCompleted(startEventId, gameStatus.result.notation, null)
|
state.moveToCompleted(startEventId, gameStatus.result.notation, null)
|
||||||
pollingDelegate.removeGameId(startEventId)
|
pollingDelegate.removeGameId(startEventId)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+2
-1
@@ -24,6 +24,7 @@ import kotlin.test.Test
|
|||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertNotNull
|
import kotlin.test.assertNotNull
|
||||||
import kotlin.test.assertNull
|
import kotlin.test.assertNull
|
||||||
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
class BleChunkAssemblerTest {
|
class BleChunkAssemblerTest {
|
||||||
@Test
|
@Test
|
||||||
@@ -43,7 +44,7 @@ class BleChunkAssemblerTest {
|
|||||||
val assembler = BleChunkAssembler()
|
val assembler = BleChunkAssembler()
|
||||||
val message = """["EVENT",{"content":"hello world from nostr ble mesh networking"}]"""
|
val message = """["EVENT",{"content":"hello world from nostr ble mesh networking"}]"""
|
||||||
val chunks = BleMessageChunker.splitIntoChunks(message, chunkSize = 10)
|
val chunks = BleMessageChunker.splitIntoChunks(message, chunkSize = 10)
|
||||||
assert(chunks.size > 1)
|
assertTrue(chunks.size > 1)
|
||||||
|
|
||||||
for (i in 0 until chunks.size - 1) {
|
for (i in 0 until chunks.size - 1) {
|
||||||
val result = assembler.addChunk(chunks[i])
|
val result = assembler.addChunk(chunks[i])
|
||||||
|
|||||||
Reference in New Issue
Block a user