mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-06 05:30:21 +00:00
tests and corrections
This commit is contained in:
parent
74863858f7
commit
72b7c35b3f
4 changed files with 54 additions and 2 deletions
31
common/src/test/scala/game/SpawnRequestMessageTest.scala
Normal file
31
common/src/test/scala/game/SpawnRequestMessageTest.scala
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class SpawnRequestMessageTest extends Specification {
|
||||
val string = hex"4a000007000000000000000200"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case SpawnRequestMessage(unk1,unk2,unk3,unk4,unk5) =>
|
||||
unk1 mustEqual 0
|
||||
unk2 mustEqual 7
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 0
|
||||
unk5 mustEqual 2
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = SpawnRequestMessage(0, 7, 0, 0, 2)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue