mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-27 15:25:30 +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
33
common/src/test/scala/game/ZipLineMessageTest.scala
Normal file
33
common/src/test/scala/game/ZipLineMessageTest.scala
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// 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 ZipLineMessageTest extends Specification {
|
||||
val string = hex"BF 4B00 19 80000010 5bb4089c 52116881 cf76e840"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case ZipLineMessage(player_guid, origin_side, action, uid, x, y, z) =>
|
||||
player_guid mustEqual PlanetSideGUID(75)
|
||||
origin_side mustEqual false
|
||||
action mustEqual 0
|
||||
uid mustEqual 204
|
||||
x mustEqual 1286.9221f
|
||||
y mustEqual 1116.5276f
|
||||
z mustEqual 91.74034f
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = ZipLineMessage(PlanetSideGUID(75), false, 0, 204, 1286.9221f, 1116.5276f, 91.74034f)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue