Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b66c49d authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

fix: StateMchineTests are failing for the latest state logic change

parent 1a30a034
Loading
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -50,14 +50,14 @@ class StateMachineTest {
    }

    @Test
    fun `Changing State from PERIODIC_SCAN to IDLE should return false`() {
    fun `Changing State from PERIODIC_SCAN to IDLE should return true`() {
        StateMachine.currentState = PERIODIC_SCAN

        val result = StateMachine.changeState(IDLE)
        Assert.assertFalse("Changing state from PERIODIC_SCAN to IDLE returned false", result)
        Assert.assertTrue("Changing state from PERIODIC_SCAN to IDLE returned true", result)

        val currentState = StateMachine.currentState
        Assert.assertEquals("Current state should remain PERIODIC_SCAN but is $currentState", PERIODIC_SCAN, currentState)
        Assert.assertEquals("Current state should be but is $currentState", IDLE, currentState)
    }

    @Test
@@ -83,14 +83,14 @@ class StateMachineTest {
    }

    @Test
    fun `Changing State from LISTENING_FILE to IDLE should return false`() {
    fun `Changing State from LISTENING_FILE to IDLE should return true`() {
        StateMachine.currentState = LISTENING_FILES

        val result = StateMachine.changeState(IDLE)
        Assert.assertFalse("Changing state from LISTENING_FILES to IDLE returned true", result)
        Assert.assertTrue("Changing state from LISTENING_FILES to IDLE returned true", result)

        val currentState = StateMachine.currentState
        Assert.assertEquals("Current state should remain LISTENING_FILES but is $currentState", LISTENING_FILES, currentState)
        Assert.assertEquals("Current state should be IDLE but is $currentState", IDLE, currentState)
    }

    @Test
@@ -138,14 +138,14 @@ class StateMachineTest {
    }

    @Test
    fun `Changing State from SYNCHRONIZING to IDLE should return false`() {
    fun `Changing State from SYNCHRONIZING to IDLE should return true`() {
        StateMachine.currentState = SYNCHRONIZING

        val result = StateMachine.changeState(IDLE)
        Assert.assertFalse("Changing state from SYNCHRONIZING to IDLE returned true", result)
        Assert.assertTrue("Changing state from SYNCHRONIZING to IDLE returned true", result)

        val currentState = StateMachine.currentState
        Assert.assertEquals("Current state should remain SYNCHRONIZING but is $currentState", SYNCHRONIZING, currentState)
        Assert.assertEquals("Current state should be IDLE but is $currentState", IDLE, currentState)
    }

    @Test