Skip to content

Commit

Permalink
Fixed broken integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Martomate committed Oct 13, 2024
1 parent 0625296 commit 44fbee6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main/src/test/scala/hexacraft/main/GameSceneTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ class GameSceneTest extends FunSuite {
gameScene.tick(tickContext)
Thread.sleep(20)
gameScene.tick(tickContext)
Thread.sleep(20)
gameScene.tick(tickContext)
Thread.sleep(20)
gameScene.tick(tickContext)

// start listening for audio events
val audioTracker = Tracker.withStorage[AudioSystem.Event]
Expand Down Expand Up @@ -211,6 +215,10 @@ class GameSceneTest extends FunSuite {
gameScene.tick(tickContext)
Thread.sleep(20)
gameScene.tick(tickContext)
Thread.sleep(20)
gameScene.tick(tickContext)
Thread.sleep(20)
gameScene.tick(tickContext)

// start listening for audio events
val audioTracker = Tracker.withStorage[AudioSystem.Event]
Expand Down
12 changes: 12 additions & 0 deletions server/src/test/scala/hexacraft/world/ServerWorldTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class ServerWorldTest extends FunSuite {
world.tick(Seq(camera), Seq(cCoords), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())

// The chunk should be loaded
assert(world.getChunk(cCoords).isDefined)
Expand All @@ -99,6 +103,10 @@ class ServerWorldTest extends FunSuite {
world.tick(Seq(camera), Seq(cCoords), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())

// The chunk should be loaded
assert(world.getChunk(cCoords).isDefined)
Expand Down Expand Up @@ -132,6 +140,10 @@ class ServerWorldTest extends FunSuite {
world.tick(Seq(camera), Seq(ChunkRelWorld(0, 0, 0)), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())

assert(world.getChunk(ChunkRelWorld(0, 0, 0)).isDefined)

Expand Down

0 comments on commit 44fbee6

Please sign in to comment.