Skip to content

Commit

Permalink
Fixed broken integration tests for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Martomate committed Oct 13, 2024
1 parent 0625296 commit bf8c874
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
12 changes: 12 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,12 @@ 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)
Thread.sleep(20)
gameScene.tick(tickContext)

// start listening for audio events
val audioTracker = Tracker.withStorage[AudioSystem.Event]
Expand Down Expand Up @@ -211,6 +217,12 @@ 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)
Thread.sleep(20)
gameScene.tick(tickContext)

// start listening for audio events
val audioTracker = Tracker.withStorage[AudioSystem.Event]
Expand Down
18 changes: 18 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,12 @@ 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())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())

// The chunk should be loaded
assert(world.getChunk(cCoords).isDefined)
Expand All @@ -99,6 +105,12 @@ 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())
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 +144,12 @@ 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())
Thread.sleep(20)
world.tick(Seq(camera), Seq(), Seq())

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

Expand Down

0 comments on commit bf8c874

Please sign in to comment.