Add unit tests for Vector3Serializer round-trip serialization#2811
Add unit tests for Vector3Serializer round-trip serialization#2811xinzhoudev wants to merge 1 commit into
Conversation
A test case for networking.
There was a problem hiding this comment.
Code Review
This pull request introduces unit tests for the Vector3Serializer class, verifying that it correctly serializes and deserializes Vector3f objects. However, there is a package mismatch in the new test file where the declared package does not match its directory path, which will cause compilation errors. A suggestion has been provided to correct the package declaration and add the necessary import.
| package com.jme3.network.serializing.serializers; | ||
|
|
||
| import com.jme3.math.Vector3f; | ||
| import java.io.IOException; | ||
| import java.nio.ByteBuffer; | ||
| import org.junit.Test; |
There was a problem hiding this comment.
The package declaration com.jme3.network.serializing.serializers does not match the file's directory path com/jme3/network/message/. This will cause compilation errors. Please update the package declaration to com.jme3.network.message and import Vector3Serializer explicitly.
| package com.jme3.network.serializing.serializers; | |
| import com.jme3.math.Vector3f; | |
| import java.io.IOException; | |
| import java.nio.ByteBuffer; | |
| import org.junit.Test; | |
| package com.jme3.network.message; | |
| import com.jme3.math.Vector3f; | |
| import com.jme3.network.serializing.serializers.Vector3Serializer; | |
| import java.io.IOException; | |
| import java.nio.ByteBuffer; | |
| import org.junit.Test; |
This PR introduces
Vector3SerializerTest, a JUnit test class that validates the round-trip correctness ofVector3Serializer, which is responsible for encodingVector3fpositions and directions in multiplayer network messages.