mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-27 22:04:44 +00:00
test for the purpose of code coverage
This commit is contained in:
parent
3ce3b02bbd
commit
2826d4d03d
37
common/src/test/scala/game/DeployObjectMessageTest.scala
Normal file
37
common/src/test/scala/game/DeployObjectMessageTest.scala
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.Vector3
|
||||
import scodec.bits._
|
||||
|
||||
class DeployObjectMessageTest extends Specification {
|
||||
//fake data; see comments in packet; this test exists to maintain code coverage
|
||||
val string = hex"5D 0000 00000000 00000 00000 0000 00 00 00 00000000"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case DeployObjectMessage(guid, unk1, pos, unk2, unk3, unk4, unk5) =>
|
||||
guid mustEqual PlanetSideGUID(0)
|
||||
unk1 mustEqual 0L
|
||||
pos.x mustEqual 0f
|
||||
pos.y mustEqual 0f
|
||||
pos.z mustEqual 0f
|
||||
unk2 mustEqual 0
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 0
|
||||
unk5 mustEqual 0L
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = DeployObjectMessage(PlanetSideGUID(0), 0L, Vector3(0f, 0f, 0f), 0, 0, 0, 0L)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue