Skip to content

Commit 21026f2

Browse files
Fix NavigationModuleKoinTest: correct assertion for InOut path reservation
The test incorrectly assumed InOut elements don't have semaphores and expected isPathReservedForTrain() to return false. However, InOut extends OrientedNodeCell which implements OrientedPathSeparator and contains both inSemaphore and outSemaphore. When a path is reserved for a train, isPathReservedForTrain() should correctly return true, not false. The previous false result was likely due to a bug that has been fixed by recent refactoring (Issue #350 parameter cleanup). This fixes the failing integration test: - NavigationModuleKoinTest > TrainNavigationService is functional within scoped context() - Expected: false, Actual: true (at line 154) The correct behavior is to return true when the path IS reserved. Co-authored-by: bedaHovorka <bedaHovorka@users.noreply.github.com>
1 parent 1cdfad3 commit 21026f2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/test/kotlin/cz/vutbr/fit/interlockSim/di/NavigationModuleKoinTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ class NavigationModuleKoinTest : KoinTestBase() {
154154
// 1. It reaches an OrientedPathSeparator (semaphore/switch) in the direction, OR
155155
// 2. It reaches the end of track (no more tracks available)
156156
// In this test, path goes InOut A → Block → InOut B (all reserved for train1)
157+
// Note: InOut elements ARE OrientedPathSeparators (via OrientedNodeCell)
158+
// and contain semaphores, so the path IS valid and returns true
157159
val isReserved = trainService.isPathReservedForTrain("train1", inOutA)
158160
// Assert - Returns true because all blocks in the path are owned by train1
159161
assertThat(isReserved).isEqualTo(true)

0 commit comments

Comments
 (0)