summaryrefslogtreecommitdiff
path: root/examples/10-transient-0/output/java-junit
diff options
context:
space:
mode:
Diffstat (limited to 'examples/10-transient-0/output/java-junit')
-rw-r--r--examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java b/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java
index 09a23a3..ff5ca5b 100644
--- a/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java
+++ b/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java
@@ -6,11 +6,26 @@ import java.io.IOException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.zwobble.example.types.data.HobgoblinTransient0Data;
+import org.zwobble.example.types.data.StructWithBool;
import org.zwobble.example.types.data.StructWithInt32;
import org.zwobble.example.types.data.StructWithInt64;
public class Transient0Tests {
@Test
+ public void structWithBool() throws IOException {
+ var value = new StructWithBool(true, false);
+
+ var outputStream = new ByteArrayOutputStream();
+ HobgoblinTransient0Data.encodeStructWithBool(value, outputStream);
+ var bytes = outputStream.toByteArray();
+
+ var inputStream = new ByteArrayInputStream(bytes);
+ var decodedValue = HobgoblinTransient0Data.decodeStructWithBool(inputStream);
+
+ Assertions.assertEquals(value, decodedValue);
+ }
+
+ @Test
public void structWithInt32() throws IOException {
var value = new StructWithInt32(10, 25);