mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-05 05:00:20 +00:00
Split Up GamePacketTest (#102)
* split up GamePacketTest into separate testing files * PR wants this file?
This commit is contained in:
parent
b00748727e
commit
6001446cd5
68 changed files with 4061 additions and 3597 deletions
28
common/src/test/scala/game/GenericObjectStateMsgTest.scala
Normal file
28
common/src/test/scala/game/GenericObjectStateMsgTest.scala
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class GenericObjectStateMsgTest extends Specification {
|
||||
val string = hex"1D 6401 10000000"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case GenericObjectStateMsg(object_guid, state) =>
|
||||
object_guid mustEqual PlanetSideGUID(356)
|
||||
state mustEqual 16
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = GenericObjectStateMsg(PlanetSideGUID(356), 16)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue