From ea76271ca6475765f58a8a2f8633250fd0123cd0 Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Tue, 16 Feb 2021 21:50:19 +0100
Subject: [PATCH] Cleanup test utilities

---
 .../protocol/io/ChainedByteBuffer.kt          |   8 ++
 .../handshake/ClientInitSerializerTest.kt     |   2 -
 .../serializers/qt/BoolSerializerTest.kt      |   6 +-
 .../qt/ByteBufferSerializerTest.kt            |  12 +-
 .../serializers/qt/ByteSerializerTest.kt      |  10 +-
 .../serializers/qt/DoubleSerializerTest.kt    |  14 +--
 .../serializers/qt/FloatSerializerTest.kt     |  14 +--
 .../qt/HandshakeMapSerializerTest.kt          |   8 +-
 .../serializers/qt/IntSerializerTest.kt       |  10 +-
 .../serializers/qt/LongSerializerTest.kt      |  10 +-
 .../serializers/qt/QCharSerializerTest.kt     |  18 +--
 .../serializers/qt/QDateSerializerTest.kt     |   6 +-
 .../serializers/qt/QDateTimeSerializerTest.kt |  20 ++--
 .../serializers/qt/QTimeSerializerTest.kt     |   6 +-
 .../qt/QVariantListSerializerTest.kt          |   6 +-
 .../qt/QVariantMapSerializerTest.kt           |   8 +-
 .../serializers/qt/QVariantSerializerTest.kt  |  26 ++---
 .../serializers/qt/ShortSerializerTest.kt     |  10 +-
 .../serializers/qt/StringSerializerTest.kt    |  24 ++--
 .../serializers/qt/UByteSerializerTest.kt     |  10 +-
 .../serializers/qt/UIntSerializerTest.kt      |  10 +-
 .../serializers/qt/ULongSerializerTest.kt     |  10 +-
 .../serializers/qt/UShortSerializerTest.kt    |  10 +-
 .../serializers/qt/VoidSerializerTest.kt      |   4 +-
 .../quassel/BufferIdSerializerTest.kt         |  10 +-
 .../quassel/BufferInfoSerializerTest.kt       |   6 +-
 .../DccIpDetectionModeSerializerTest.kt       |   8 +-
 .../DccPortSelectionModeSerializerTest.kt     |   8 +-
 .../quassel/IdentityIdSerializerTest.kt       |  10 +-
 .../quassel/MessageSerializerTest.kt          |  10 +-
 .../quassel/MsgIdSerializerTest.kt            |  10 +-
 .../quassel/NetworkIdSerializerTest.kt        |  10 +-
 .../quassel/PeerPtrSerializerTest.kt          |  10 +-
 .../quassel/QHostAddressSerializerTest.kt     |   6 +-
 .../protocol/testutil/deserialize.kt          | 106 ------------------
 .../testutil/handshakeSerializerTest.kt       |  37 ++++--
 ...izerTest.kt => primitiveSerializerTest.kt} |  66 +++++++----
 .../protocol/testutil/qtSerializerTest.kt     |  78 -------------
 .../libquassel/protocol/testutil/serialize.kt |  74 ------------
 .../protocol/testutil/serializerTest.kt       |  16 ++-
 .../testutil/signalProxySerializerTest.kt     |  37 ++++--
 .../testutil/testHandshakeSerializerDirect.kt |  38 -------
 .../testHandshakeSerializerEncoded.kt         |  46 --------
 ...t.kt => testPrimitiveSerializerVariant.kt} |  22 +++-
 .../testutil/testQtSerializerVariant.kt       |  47 --------
 .../testSignalProxySerializerDirect.kt        |  38 -------
 .../testSignalProxySerializerEncoded.kt       |  46 --------
 47 files changed, 311 insertions(+), 690 deletions(-)
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/deserialize.kt
 rename libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/{quasselSerializerTest.kt => primitiveSerializerTest.kt} (57%)
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/qtSerializerTest.kt
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serialize.kt
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerDirect.kt
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerEncoded.kt
 rename libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/{testQuasselSerializerVariant.kt => testPrimitiveSerializerVariant.kt} (71%)
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQtSerializerVariant.kt
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerDirect.kt
 delete mode 100644 libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerEncoded.kt

diff --git a/libquassel-protocol/src/main/kotlin/de/justjanne/libquassel/protocol/io/ChainedByteBuffer.kt b/libquassel-protocol/src/main/kotlin/de/justjanne/libquassel/protocol/io/ChainedByteBuffer.kt
index d0b1726..c92022c 100644
--- a/libquassel-protocol/src/main/kotlin/de/justjanne/libquassel/protocol/io/ChainedByteBuffer.kt
+++ b/libquassel-protocol/src/main/kotlin/de/justjanne/libquassel/protocol/io/ChainedByteBuffer.kt
@@ -204,3 +204,11 @@ class ChainedByteBuffer(
       buffer.bufferList[index++].duplicate().flip()
   }
 }
+
+inline fun ChainedByteBuffer.use(
+  function: (ChainedByteBuffer) -> Unit
+): ByteBuffer {
+  val buffer = ChainedByteBuffer()
+  function(buffer)
+  return buffer.toBuffer()
+}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/handshake/ClientInitSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/handshake/ClientInitSerializerTest.kt
index 3076033..3af0e4b 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/handshake/ClientInitSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/handshake/ClientInitSerializerTest.kt
@@ -29,7 +29,6 @@ import org.junit.jupiter.api.Test
 class ClientInitSerializerTest {
   @Test
   fun testSimple() = handshakeSerializerTest(
-    ClientInitSerializer,
     HandshakeMessage.ClientInit(
       clientVersion = "Quasseldroid test",
       buildDate = "Never",
@@ -68,7 +67,6 @@ class ClientInitSerializerTest {
 
   @Test
   fun testRealistic() = handshakeSerializerTest(
-    ClientInitSerializer,
     HandshakeMessage.ClientInit(
       clientVersion = "Quasseldroid <a href=\"https://git.kuschku.de/justJanne/QuasselDroid-ng/commit/" +
         "b622ad63056b6054b06e09f8e1f1ef2b0c3aaf9a\">v1.3.3</a>",
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/BoolSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/BoolSerializerTest.kt
index 02eff4c..21a9955 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/BoolSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/BoolSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,14 +34,14 @@ class BoolSerializerTest {
   }
 
   @Test
-  fun testTrue() = qtSerializerTest(
+  fun testTrue() = primitiveSerializerTest(
     BoolSerializer,
     true,
     byteBufferOf(1)
   )
 
   @Test
-  fun testFalse() = qtSerializerTest(
+  fun testFalse() = primitiveSerializerTest(
     BoolSerializer,
     false,
     byteBufferOf(0)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteBufferSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteBufferSerializerTest.kt
index 89e14f8..20917e5 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteBufferSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteBufferSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import java.nio.ByteBuffer
@@ -36,7 +36,7 @@ class ByteBufferSerializerTest {
   }
 
   @Test
-  fun testBaseCase() = qtSerializerTest(
+  fun testBaseCase() = primitiveSerializerTest(
     ByteBufferSerializer,
     byteBufferOf(0),
     byteBufferOf(0, 0, 0, 1, 0),
@@ -44,7 +44,7 @@ class ByteBufferSerializerTest {
   )
 
   @Test
-  fun testNormal() = qtSerializerTest(
+  fun testNormal() = primitiveSerializerTest(
     ByteBufferSerializer,
     byteBufferOf(1, 2, 3, 4, 5, 6, 7, 8, 9),
     byteBufferOf(0, 0, 0, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9),
@@ -52,7 +52,7 @@ class ByteBufferSerializerTest {
   )
 
   @Test
-  fun testEmpty() = qtSerializerTest(
+  fun testEmpty() = primitiveSerializerTest(
     ByteBufferSerializer,
     ByteBuffer.allocate(0),
     byteBufferOf(0, 0, 0, 0),
@@ -61,7 +61,7 @@ class ByteBufferSerializerTest {
 
   @Test
   fun testNull() {
-    qtSerializerTest(
+    primitiveSerializerTest(
       ByteBufferSerializer,
       null,
       byteBufferOf(0, 0, 0, 0),
@@ -69,7 +69,7 @@ class ByteBufferSerializerTest {
       serializeFeatureSet = null
     )
 
-    qtSerializerTest(
+    primitiveSerializerTest(
       ByteBufferSerializer,
       null,
       byteBufferOf(-1, -1, -1, -1),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteSerializerTest.kt
index 91d293f..28548e9 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ByteSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import kotlin.experimental.inv
@@ -35,28 +35,28 @@ class ByteSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     ByteSerializer,
     0.toByte(),
     byteBufferOf(0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     ByteSerializer,
     Byte.MIN_VALUE,
     byteBufferOf(-128)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     ByteSerializer,
     Byte.MAX_VALUE,
     byteBufferOf(127)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     ByteSerializer,
     0.toByte().inv(),
     byteBufferOf(-1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/DoubleSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/DoubleSerializerTest.kt
index 29ad800..f3dc9af 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/DoubleSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/DoubleSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,42 +34,42 @@ class DoubleSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     DoubleSerializer,
     0.0,
     byteBufferOf(0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     DoubleSerializer,
     Double.MIN_VALUE,
     byteBufferOf(0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     DoubleSerializer,
     Double.MAX_VALUE,
     byteBufferOf(0x7Fu, 0xEFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu)
   )
 
   @Test
-  fun testInfinityPositive() = qtSerializerTest(
+  fun testInfinityPositive() = primitiveSerializerTest(
     DoubleSerializer,
     Double.POSITIVE_INFINITY,
     byteBufferOf(0x7Fu, 0xF0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u)
   )
 
   @Test
-  fun testInfinityNegative() = qtSerializerTest(
+  fun testInfinityNegative() = primitiveSerializerTest(
     DoubleSerializer,
     Double.NEGATIVE_INFINITY,
     byteBufferOf(0xFFu, 0xF0u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u)
   )
 
   @Test
-  fun testNotANumber() = qtSerializerTest(
+  fun testNotANumber() = primitiveSerializerTest(
     DoubleSerializer,
     Double.NaN,
     byteBufferOf(0x7Fu, 0xF8u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/FloatSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/FloatSerializerTest.kt
index 942343e..7b6b445 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/FloatSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/FloatSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,42 +34,42 @@ class FloatSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     FloatSerializer,
     0f,
     byteBufferOf(0x00u, 0x00u, 0x00u, 0x00u)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     FloatSerializer,
     Float.MIN_VALUE,
     byteBufferOf(0x00u, 0x00u, 0x00u, 0x01u)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     FloatSerializer,
     Float.MAX_VALUE,
     byteBufferOf(0x7Fu, 0x7Fu, 0xFFu, 0xFFu)
   )
 
   @Test
-  fun testInfinityPositive() = qtSerializerTest(
+  fun testInfinityPositive() = primitiveSerializerTest(
     FloatSerializer,
     Float.POSITIVE_INFINITY,
     byteBufferOf(0x7Fu, 0x80u, 0x00u, 0x00u)
   )
 
   @Test
-  fun testInfinityNegative() = qtSerializerTest(
+  fun testInfinityNegative() = primitiveSerializerTest(
     FloatSerializer,
     Float.NEGATIVE_INFINITY,
     byteBufferOf(0xFFu, 0x80u, 0x00u, 0x00u)
   )
 
   @Test
-  fun testNotANumber() = qtSerializerTest(
+  fun testNotANumber() = primitiveSerializerTest(
     FloatSerializer,
     Float.NaN,
     byteBufferOf(0x7Fu, 0xC0u, 0x00u, 0x00u)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/HandshakeMapSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/HandshakeMapSerializerTest.kt
index 2add2ed..108d4f5 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/HandshakeMapSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/HandshakeMapSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.MapMatcher
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import de.justjanne.libquassel.protocol.variant.qVariant
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
@@ -36,14 +36,14 @@ class HandshakeMapSerializerTest {
   }
 
   @Test
-  fun testEmpty() = qtSerializerTest(
+  fun testEmpty() = primitiveSerializerTest(
     HandshakeMapSerializer,
     mapOf(),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testNormal() = qtSerializerTest(
+  fun testNormal() = primitiveSerializerTest(
     HandshakeMapSerializer,
     mapOf(
       "Username" to qVariant("AzureDiamond", QtType.QString),
@@ -74,7 +74,7 @@ class HandshakeMapSerializerTest {
   )
 
   @Test
-  fun testNullKey() = qtSerializerTest(
+  fun testNullKey() = primitiveSerializerTest(
     HandshakeMapSerializer,
     mapOf(
       "" to qVariant<String?>(null, QtType.QString)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/IntSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/IntSerializerTest.kt
index 8deb51a..9131635 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/IntSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/IntSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,28 +34,28 @@ class IntSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     IntSerializer,
     0,
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     IntSerializer,
     Int.MIN_VALUE,
     byteBufferOf(-128, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     IntSerializer,
     Int.MAX_VALUE,
     byteBufferOf(127, -1, -1, -1)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     IntSerializer,
     0.inv(),
     byteBufferOf(-1, -1, -1, -1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/LongSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/LongSerializerTest.kt
index 69f0191..ea5455a 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/LongSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/LongSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,28 +34,28 @@ class LongSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     LongSerializer,
     0L,
     byteBufferOf(0, 0, 0, 0, 0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     LongSerializer,
     Long.MIN_VALUE,
     byteBufferOf(-128, 0, 0, 0, 0, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     LongSerializer,
     Long.MAX_VALUE,
     byteBufferOf(127, -1, -1, -1, -1, -1, -1, -1)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     LongSerializer,
     0L.inv(),
     byteBufferOf(-1, -1, -1, -1, -1, -1, -1, -1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QCharSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QCharSerializerTest.kt
index fa99dff..4fa348e 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QCharSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QCharSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.BomMatcherChar
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,7 +35,7 @@ class QCharSerializerTest {
   }
 
   @Test
-  fun testNull() = qtSerializerTest(
+  fun testNull() = primitiveSerializerTest(
     QCharSerializer,
     '\u0000',
     byteBufferOf(0, 0),
@@ -43,7 +43,7 @@ class QCharSerializerTest {
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     QCharSerializer,
     '\uFFFF',
     byteBufferOf(-1, -1),
@@ -51,7 +51,7 @@ class QCharSerializerTest {
   )
 
   @Test
-  fun testBOM1() = qtSerializerTest(
+  fun testBOM1() = primitiveSerializerTest(
     QCharSerializer,
     '\uFFFE',
     byteBufferOf(-1, -2),
@@ -59,7 +59,7 @@ class QCharSerializerTest {
   )
 
   @Test
-  fun testBOM2() = qtSerializerTest(
+  fun testBOM2() = primitiveSerializerTest(
     QCharSerializer,
     '\uFEFF',
     byteBufferOf(-2, -1),
@@ -68,17 +68,17 @@ class QCharSerializerTest {
 
   @Test
   fun testAlphabet() {
-    for (value in 'a'..'z') qtSerializerTest(
+    for (value in 'a'..'z') primitiveSerializerTest(
       QCharSerializer,
       value,
       byteBufferOf(0, value.toByte())
     )
-    for (value in 'A'..'Z') qtSerializerTest(
+    for (value in 'A'..'Z') primitiveSerializerTest(
       QCharSerializer,
       value,
       byteBufferOf(0, value.toByte())
     )
-    for (value in '0'..'9') qtSerializerTest(
+    for (value in '0'..'9') primitiveSerializerTest(
       QCharSerializer,
       value,
       byteBufferOf(0, value.toByte())
@@ -87,7 +87,7 @@ class QCharSerializerTest {
 
   @Test
   fun testAlphabetExtended() {
-    for (value in listOf('ä', 'ö', 'ü', 'ß', 'æ', 'ø', 'µ')) qtSerializerTest(
+    for (value in listOf('ä', 'ö', 'ü', 'ß', 'æ', 'ø', 'µ')) primitiveSerializerTest(
       QCharSerializer,
       value
     )
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateSerializerTest.kt
index f5a2b9a..02a3b23 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.TemporalMatcher
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import org.threeten.bp.LocalDate
@@ -37,7 +37,7 @@ class QDateSerializerTest {
   }
 
   @Test
-  fun testEpoch() = qtSerializerTest(
+  fun testEpoch() = primitiveSerializerTest(
     QDateSerializer,
     LocalDate
       .of(1970, 1, 1),
@@ -46,7 +46,7 @@ class QDateSerializerTest {
   )
 
   @Test
-  fun testNormalCase() = qtSerializerTest(
+  fun testNormalCase() = primitiveSerializerTest(
     QDateSerializer,
     LocalDate
       .of(2019, Month.JANUARY, 15),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateTimeSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateTimeSerializerTest.kt
index 6aa5104..872359b 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateTimeSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QDateTimeSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.TemporalMatcher
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.assertThrows
@@ -43,7 +43,7 @@ class QDateTimeSerializerTest {
   }
 
   @Test
-  fun testEpoch() = qtSerializerTest(
+  fun testEpoch() = primitiveSerializerTest(
     QDateTimeSerializer,
     Instant.EPOCH,
     byteBufferOf(0, 37, 61, -116, 0, 0, 0, 0, 2),
@@ -51,7 +51,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testEpochAtTimezone() = qtSerializerTest(
+  fun testEpochAtTimezone() = primitiveSerializerTest(
     QDateTimeSerializer,
     Instant.EPOCH.atOffset(ZoneOffset.ofTotalSeconds(1234)),
     byteBufferOf(0x00u, 0x25u, 0x3Du, 0x8Cu, 0x00u, 0x12u, 0xD4u, 0x50u, 0x03u, 0x00u, 0x00u, 0x04u, 0xD2u),
@@ -59,7 +59,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testEpochByCalendarAtTimezone() = qtSerializerTest(
+  fun testEpochByCalendarAtTimezone() = primitiveSerializerTest(
     QDateTimeSerializer,
     LocalDateTime
       .of(1970, 1, 1, 0, 0)
@@ -70,7 +70,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testNormalCase() = qtSerializerTest(
+  fun testNormalCase() = primitiveSerializerTest(
     QDateTimeSerializer,
     LocalDateTime
       .of(2019, Month.JANUARY, 15, 20, 25)
@@ -81,7 +81,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testLocalDateTime() = qtSerializerTest(
+  fun testLocalDateTime() = primitiveSerializerTest(
     QDateTimeSerializer,
     LocalDateTime
       .of(2019, Month.JANUARY, 15, 20, 25),
@@ -90,7 +90,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testZonedDateTime() = qtSerializerTest(
+  fun testZonedDateTime() = primitiveSerializerTest(
     QDateTimeSerializer,
     LocalDateTime
       .of(2019, Month.JANUARY, 15, 20, 25)
@@ -99,7 +99,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testUnknownDateTime() = qtSerializerTest(
+  fun testUnknownDateTime() = primitiveSerializerTest(
     QDateTimeSerializer,
     LocalDateTime
       .of(2019, Month.JANUARY, 15, 20, 25),
@@ -108,7 +108,7 @@ class QDateTimeSerializerTest {
   )
 
   @Test
-  fun testInvalidDateTime() = qtSerializerTest(
+  fun testInvalidDateTime() = primitiveSerializerTest(
     QDateTimeSerializer,
     LocalDateTime
       .of(2019, Month.JANUARY, 15, 20, 25),
@@ -121,7 +121,7 @@ class QDateTimeSerializerTest {
   @Test
   fun testOldJavaDate() {
     assertThrows<IllegalArgumentException>("Unsupported Format: org.threeten.bp.chrono.JapaneseDate") {
-      qtSerializerTest(
+      primitiveSerializerTest(
         QDateTimeSerializer,
         JapaneseDate.now(),
         matcher = ::TemporalMatcher
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QTimeSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QTimeSerializerTest.kt
index e7a3ffd..22a12aa 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QTimeSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QTimeSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.TemporalMatcher
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import org.threeten.bp.LocalTime
@@ -36,7 +36,7 @@ class QTimeSerializerTest {
   }
 
   @Test
-  fun testEpoch() = qtSerializerTest(
+  fun testEpoch() = primitiveSerializerTest(
     QTimeSerializer,
     LocalTime
       .of(0, 0),
@@ -45,7 +45,7 @@ class QTimeSerializerTest {
   )
 
   @Test
-  fun testNormalCase() = qtSerializerTest(
+  fun testNormalCase() = primitiveSerializerTest(
     QTimeSerializer,
     LocalTime
       .of(20, 25),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantListSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantListSerializerTest.kt
index ce824fc..68cf646 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantListSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantListSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import de.justjanne.libquassel.protocol.variant.QVariantList
 import de.justjanne.libquassel.protocol.variant.qVariant
 import org.junit.jupiter.api.Assertions.assertEquals
@@ -36,14 +36,14 @@ class QVariantListSerializerTest {
   }
 
   @Test
-  fun testEmpty() = qtSerializerTest(
+  fun testEmpty() = primitiveSerializerTest(
     QVariantListSerializer,
     listOf(),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testNormal() = qtSerializerTest(
+  fun testNormal() = primitiveSerializerTest(
     QVariantListSerializer,
     listOf(
       qVariant("AzureDiamond", QtType.QString),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantMapSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantMapSerializerTest.kt
index 3a1715a..5f3b816 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantMapSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantMapSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
 import de.justjanne.libquassel.protocol.testutil.matchers.MapMatcher
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import de.justjanne.libquassel.protocol.variant.QVariantMap
 import de.justjanne.libquassel.protocol.variant.qVariant
 import org.junit.jupiter.api.Assertions.assertEquals
@@ -37,14 +37,14 @@ class QVariantMapSerializerTest {
   }
 
   @Test
-  fun testEmpty() = qtSerializerTest(
+  fun testEmpty() = primitiveSerializerTest(
     QVariantMapSerializer,
     mapOf(),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testNormal() = qtSerializerTest(
+  fun testNormal() = primitiveSerializerTest(
     QVariantMapSerializer,
     mapOf(
       "Username" to qVariant("AzureDiamond", QtType.QString),
@@ -156,7 +156,7 @@ class QVariantMapSerializerTest {
   )
 
   @Test
-  fun testNullKey() = qtSerializerTest(
+  fun testNullKey() = primitiveSerializerTest(
     QVariantMapSerializer,
     mapOf(
       "" to qVariant<String?>(null, QtType.QString)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantSerializerTest.kt
index 13584d0..832f9cc 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/QVariantSerializerTest.kt
@@ -18,10 +18,10 @@
  */
 package de.justjanne.libquassel.protocol.serializers.qt
 
+import de.justjanne.libquassel.protocol.features.FeatureSet
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.serializers.NoSerializerForTypeException
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.deserialize
 import de.justjanne.libquassel.protocol.variant.QVariant_
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
@@ -39,9 +39,9 @@ class QVariantSerializerTest {
   @Test
   fun testUnregisteredQtType() {
     assertThrows<NoSerializerForTypeException> {
-      deserialize(
-        QVariantSerializer,
-        byteBufferOf(0x00u, 0x00u, 0x01u, 0x00u, 0x00u)
+      QVariantSerializer.deserialize(
+        byteBufferOf(0x00u, 0x00u, 0x01u, 0x00u, 0x00u),
+        FeatureSet.all()
       )
     }
   }
@@ -49,9 +49,9 @@ class QVariantSerializerTest {
   @Test
   fun testUnknownQtType() {
     assertThrows<NoSerializerForTypeException> {
-      deserialize(
-        QVariantSerializer,
-        byteBufferOf(0x00u, 0xFFu, 0x00u, 0x00u, 0x00u)
+      QVariantSerializer.deserialize(
+        byteBufferOf(0x00u, 0xFFu, 0x00u, 0x00u, 0x00u),
+        FeatureSet.all()
       )
     }
   }
@@ -59,8 +59,7 @@ class QVariantSerializerTest {
   @Test
   fun testUnregisteredQuasselType() {
     assertThrows<NoSerializerForTypeException> {
-      deserialize(
-        QVariantSerializer,
+      QVariantSerializer.deserialize(
         byteBufferOf(
           // QtType
           0x00u, 0x00u, 0x00u, 0x7Fu,
@@ -68,7 +67,8 @@ class QVariantSerializerTest {
           0x00u,
           // QuasselType length
           0x00u, 0x00u, 0x00u, 0x00u,
-        )
+        ),
+        FeatureSet.all()
       )
     }
   }
@@ -76,8 +76,7 @@ class QVariantSerializerTest {
   @Test
   fun testUnknownQuasselType() {
     assertThrows<NoSerializerForTypeException> {
-      deserialize(
-        QVariantSerializer,
+      QVariantSerializer.deserialize(
         byteBufferOf(
           // QtType
           0x00u, 0x00u, 0x00u, 0x7Fu,
@@ -87,7 +86,8 @@ class QVariantSerializerTest {
           0x00u, 0x00u, 0x00u, 0x03u,
           // "foo"
           0x66u, 0x6fu, 0x6fu
-        )
+        ),
+        FeatureSet.all()
       )
     }
   }
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ShortSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ShortSerializerTest.kt
index 37bb3e5..ddd0833 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ShortSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ShortSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import kotlin.experimental.inv
@@ -35,28 +35,28 @@ class ShortSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     ShortSerializer,
     0.toShort(),
     byteBufferOf(0, 0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     ShortSerializer,
     Short.MIN_VALUE,
     byteBufferOf(-128, 0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     ShortSerializer,
     Short.MAX_VALUE,
     byteBufferOf(127, -1)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     ShortSerializer,
     0.toShort().inv(),
     byteBufferOf(-1, -1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/StringSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/StringSerializerTest.kt
index acdccf8..e89b2c9 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/StringSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/StringSerializerTest.kt
@@ -18,13 +18,13 @@
  */
 package de.justjanne.libquassel.protocol.serializers.qt
 
+import de.justjanne.libquassel.protocol.features.FeatureSet
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.deserialize
 import de.justjanne.libquassel.protocol.testutil.matchers.BomMatcherString
 import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
 import de.justjanne.libquassel.protocol.testutil.testPrimitiveSerializerDirect
-import de.justjanne.libquassel.protocol.testutil.testQtSerializerVariant
+import de.justjanne.libquassel.protocol.testutil.testPrimitiveSerializerVariant
 import org.hamcrest.MatcherAssert.assertThat
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
@@ -45,16 +45,16 @@ class StringSerializerTest {
       if (!it.startsWith('#')) {
         testPrimitiveSerializerDirect(StringSerializerUtf8, it, matcher = BomMatcherString(it))
         testPrimitiveSerializerDirect(StringSerializerUtf16, it, matcher = BomMatcherString(it))
-        testQtSerializerVariant(QtType.QString, it, matcher = BomMatcherString(it))
+        testPrimitiveSerializerVariant(QtType.QString, it, matcher = BomMatcherString(it))
 
         val bufferUtf8 = StringSerializerUtf8.serializeRaw(it)
         testPrimitiveSerializerDirect(ByteBufferSerializer, bufferUtf8, matcher = ByteBufferMatcher(bufferUtf8))
-        testQtSerializerVariant(QtType.QByteArray, bufferUtf8, matcher = ByteBufferMatcher(bufferUtf8))
+        testPrimitiveSerializerVariant(QtType.QByteArray, bufferUtf8, matcher = ByteBufferMatcher(bufferUtf8))
         assertEquals(it, StringSerializerUtf8.deserializeRaw(bufferUtf8.rewind()))
 
         val bufferUtf16 = StringSerializerUtf16.serializeRaw(it)
         testPrimitiveSerializerDirect(ByteBufferSerializer, bufferUtf16, matcher = ByteBufferMatcher(bufferUtf16))
-        testQtSerializerVariant(QtType.QByteArray, bufferUtf16, matcher = ByteBufferMatcher(bufferUtf16))
+        testPrimitiveSerializerVariant(QtType.QByteArray, bufferUtf16, matcher = ByteBufferMatcher(bufferUtf16))
         assertThat(StringSerializerUtf16.deserializeRaw(bufferUtf16.rewind()), BomMatcherString(it))
       }
     }
@@ -79,7 +79,7 @@ class StringSerializerTest {
 
     val bufferAscii = StringSerializerAscii.serializeRaw(data)
     testPrimitiveSerializerDirect(ByteBufferSerializer, bufferAscii, matcher = ByteBufferMatcher(bufferAscii))
-    testQtSerializerVariant(QtType.QByteArray, bufferAscii, matcher = ByteBufferMatcher(bufferAscii))
+    testPrimitiveSerializerVariant(QtType.QByteArray, bufferAscii, matcher = ByteBufferMatcher(bufferAscii))
     assertEquals(data, StringSerializerAscii.deserializeRaw(bufferAscii.rewind()))
 
     testUtf(data)
@@ -1301,8 +1301,8 @@ class StringSerializerTest {
       46
     )
 
-    assertEquals(value, deserialize(StringSerializerUtf8, utf8Buffer))
-    assertEquals(value, deserialize(StringSerializerUtf16, utf16Buffer))
+    assertEquals(value, StringSerializerUtf8.deserialize(utf8Buffer, FeatureSet.all()))
+    assertEquals(value, StringSerializerUtf16.deserialize(utf16Buffer, FeatureSet.all()))
   }
 
   @Test
@@ -1313,7 +1313,7 @@ class StringSerializerTest {
 
     val bufferAscii = StringSerializerAscii.serializeRaw(data)
     testPrimitiveSerializerDirect(ByteBufferSerializer, bufferAscii, matcher = ByteBufferMatcher(bufferAscii))
-    testQtSerializerVariant(QtType.QByteArray, bufferAscii, matcher = ByteBufferMatcher(bufferAscii))
+    testPrimitiveSerializerVariant(QtType.QByteArray, bufferAscii, matcher = ByteBufferMatcher(bufferAscii))
     assertEquals(data, StringSerializerAscii.deserializeRaw(bufferAscii.rewind()))
   }
 
@@ -1322,15 +1322,15 @@ class StringSerializerTest {
 
     val bufferUtf8 = StringSerializerUtf8.serializeRaw(data)
     testPrimitiveSerializerDirect(ByteBufferSerializer, bufferUtf8, matcher = ByteBufferMatcher(bufferUtf8))
-    testQtSerializerVariant(QtType.QByteArray, bufferUtf8, matcher = ByteBufferMatcher(bufferUtf8))
+    testPrimitiveSerializerVariant(QtType.QByteArray, bufferUtf8, matcher = ByteBufferMatcher(bufferUtf8))
     assertEquals(data, StringSerializerUtf8.deserializeRaw(bufferUtf8.rewind()))
 
     // testPrimitiveSerializerDirect(StringSerializerUtf16, data, matcher = BomMatcherString(data))
-    // testQtSerializerVariant(StringSerializerUtf16, data, matcher = BomMatcherString(data))
+    // testPrimitiveSerializerVariant(StringSerializerUtf16, data, matcher = BomMatcherString(data))
 
     // val bufferUtf16 = StringSerializerUtf16.serializeRaw(data)
     // testPrimitiveSerializerDirect(ByteBufferSerializer, bufferUtf16, matcher = ByteBufferMatcher(bufferUtf16))
-    // testQtSerializerVariant(ByteBufferSerializer, bufferUtf16, matcher = ByteBufferMatcher(bufferUtf16))
+    // testPrimitiveSerializerVariant(ByteBufferSerializer, bufferUtf16, matcher = ByteBufferMatcher(bufferUtf16))
     // assertEquals(data, StringSerializerUtf16.deserializeRaw(bufferUtf16.rewind()))
   }
 }
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UByteSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UByteSerializerTest.kt
index ce5a2d7..7f388a6 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UByteSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UByteSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,28 +34,28 @@ class UByteSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     UByteSerializer,
     0.toUByte(),
     byteBufferOf(0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     UByteSerializer,
     UByte.MIN_VALUE,
     byteBufferOf(0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     UByteSerializer,
     UByte.MAX_VALUE,
     byteBufferOf(255u)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     UByteSerializer,
     0.toUByte().inv(),
     byteBufferOf(255u)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UIntSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UIntSerializerTest.kt
index 0bbae1c..843ca87 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UIntSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UIntSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,28 +34,28 @@ class UIntSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     UIntSerializer,
     0.toUInt(),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     UIntSerializer,
     UInt.MIN_VALUE,
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     UIntSerializer,
     UInt.MAX_VALUE,
     byteBufferOf(255u, 255u, 255u, 255u)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     UIntSerializer,
     0.toUInt().inv(),
     byteBufferOf(255u, 255u, 255u, 255u)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ULongSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ULongSerializerTest.kt
index 714e57c..071663b 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ULongSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/ULongSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,28 +34,28 @@ class ULongSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     ULongSerializer,
     0.toULong(),
     byteBufferOf(0, 0, 0, 0, 0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     ULongSerializer,
     ULong.MIN_VALUE,
     byteBufferOf(0, 0, 0, 0, 0, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     ULongSerializer,
     ULong.MAX_VALUE,
     byteBufferOf(255u, 255u, 255u, 255u, 255u, 255u, 255u, 255u)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     ULongSerializer,
     0.toULong().inv(),
     byteBufferOf(255u, 255u, 255u, 255u, 255u, 255u, 255u, 255u)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UShortSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UShortSerializerTest.kt
index 121d451..0471334 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UShortSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/UShortSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,28 +34,28 @@ class UShortSerializerTest {
   }
 
   @Test
-  fun testZero() = qtSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     UShortSerializer,
     0.toUShort(),
     byteBufferOf(0, 0)
   )
 
   @Test
-  fun testMinimal() = qtSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     UShortSerializer,
     UShort.MIN_VALUE,
     byteBufferOf(0, 0)
   )
 
   @Test
-  fun testMaximal() = qtSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     UShortSerializer,
     UShort.MAX_VALUE,
     byteBufferOf(255u, 255u)
   )
 
   @Test
-  fun testAllOnes() = qtSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     UShortSerializer,
     0.toUShort().inv(),
     byteBufferOf(255u, 255u)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/VoidSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/VoidSerializerTest.kt
index 78103b3..cccac85 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/VoidSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/qt/VoidSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.qt
 
 import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.qtSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -34,7 +34,7 @@ class VoidSerializerTest {
   }
 
   @Test
-  fun test() = qtSerializerTest(
+  fun test() = primitiveSerializerTest(
     VoidSerializer,
     Unit,
     byteBufferOf()
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferIdSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferIdSerializerTest.kt
index 8d2c308..5a8ef9b 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferIdSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferIdSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 import de.justjanne.libquassel.protocol.models.ids.BufferId
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,28 +35,28 @@ class BufferIdSerializerTest {
   }
 
   @Test
-  fun testZero() = quasselSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     BufferIdSerializer,
     BufferId(0),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = quasselSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     BufferIdSerializer,
     BufferId.MIN_VALUE,
     byteBufferOf(-128, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = quasselSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     BufferIdSerializer,
     BufferId.MAX_VALUE,
     byteBufferOf(127, -1, -1, -1)
   )
 
   @Test
-  fun testAllOnes() = quasselSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     BufferIdSerializer,
     BufferId(0.inv()),
     byteBufferOf(-1, -1, -1, -1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferInfoSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferInfoSerializerTest.kt
index ecd3283..7860f42 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferInfoSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/BufferInfoSerializerTest.kt
@@ -26,7 +26,7 @@ import de.justjanne.libquassel.protocol.models.ids.BufferId
 import de.justjanne.libquassel.protocol.models.ids.NetworkId
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -40,7 +40,7 @@ class BufferInfoSerializerTest {
   }
 
   @Test
-  fun testBaseCase() = quasselSerializerTest(
+  fun testBaseCase() = primitiveSerializerTest(
     BufferInfoSerializer,
     BufferInfo(
       BufferId(-1),
@@ -72,7 +72,7 @@ class BufferInfoSerializerTest {
   )
 
   @Test
-  fun testNormal() = quasselSerializerTest(
+  fun testNormal() = primitiveSerializerTest(
     BufferInfoSerializer,
     BufferInfo(
       BufferId.MAX_VALUE,
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccIpDetectionModeSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccIpDetectionModeSerializerTest.kt
index 3751192..4742872 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccIpDetectionModeSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccIpDetectionModeSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 import de.justjanne.libquassel.protocol.models.DccIpDetectionMode
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,21 +35,21 @@ class DccIpDetectionModeSerializerTest {
   }
 
   @Test
-  fun testAutomatic() = quasselSerializerTest(
+  fun testAutomatic() = primitiveSerializerTest(
     DccIpDetectionModeSerializer,
     DccIpDetectionMode.Automatic,
     byteBufferOf(0x00u)
   )
 
   @Test
-  fun testManual() = quasselSerializerTest(
+  fun testManual() = primitiveSerializerTest(
     DccIpDetectionModeSerializer,
     DccIpDetectionMode.Manual,
     byteBufferOf(0x01u)
   )
 
   @Test
-  fun testNull() = quasselSerializerTest(
+  fun testNull() = primitiveSerializerTest(
     DccIpDetectionModeSerializer,
     null,
     byteBufferOf(0x00u),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccPortSelectionModeSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccPortSelectionModeSerializerTest.kt
index 571d7db..0d8dbc5 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccPortSelectionModeSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/DccPortSelectionModeSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 import de.justjanne.libquassel.protocol.models.DccPortSelectionMode
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,21 +35,21 @@ class DccPortSelectionModeSerializerTest {
   }
 
   @Test
-  fun testAutomatic() = quasselSerializerTest(
+  fun testAutomatic() = primitiveSerializerTest(
     DccPortSelectionModeSerializer,
     DccPortSelectionMode.Automatic,
     byteBufferOf(0x00u)
   )
 
   @Test
-  fun testManual() = quasselSerializerTest(
+  fun testManual() = primitiveSerializerTest(
     DccPortSelectionModeSerializer,
     DccPortSelectionMode.Manual,
     byteBufferOf(0x01u)
   )
 
   @Test
-  fun testNull() = quasselSerializerTest(
+  fun testNull() = primitiveSerializerTest(
     DccPortSelectionModeSerializer,
     null,
     byteBufferOf(0x00u),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/IdentityIdSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/IdentityIdSerializerTest.kt
index 7f2eec3..2b2d56e 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/IdentityIdSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/IdentityIdSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 import de.justjanne.libquassel.protocol.models.ids.IdentityId
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,28 +35,28 @@ class IdentityIdSerializerTest {
   }
 
   @Test
-  fun testZero() = quasselSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     IdentityIdSerializer,
     IdentityId(0),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = quasselSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     IdentityIdSerializer,
     IdentityId.MIN_VALUE,
     byteBufferOf(-128, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = quasselSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     IdentityIdSerializer,
     IdentityId.MAX_VALUE,
     byteBufferOf(127, -1, -1, -1)
   )
 
   @Test
-  fun testAllOnes() = quasselSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     IdentityIdSerializer,
     IdentityId(0.inv()),
     byteBufferOf(-1, -1, -1, -1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MessageSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MessageSerializerTest.kt
index 66016ad..e9d770d 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MessageSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MessageSerializerTest.kt
@@ -32,7 +32,7 @@ import de.justjanne.libquassel.protocol.models.ids.MsgId
 import de.justjanne.libquassel.protocol.models.ids.NetworkId
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import org.threeten.bp.Instant
@@ -47,7 +47,7 @@ class MessageSerializerTest {
   }
 
   @Test
-  fun testEmpty() = quasselSerializerTest(
+  fun testEmpty() = primitiveSerializerTest(
     MessageSerializer,
     Message(
       MsgId(-1),
@@ -102,7 +102,7 @@ class MessageSerializerTest {
   )
 
   @Test
-  fun testBaseCase() = quasselSerializerTest(
+  fun testBaseCase() = primitiveSerializerTest(
     MessageSerializer,
     Message(
       MsgId(-1),
@@ -168,7 +168,7 @@ class MessageSerializerTest {
   )
 
   @Test
-  fun testNormal() = quasselSerializerTest(
+  fun testNormal() = primitiveSerializerTest(
     MessageSerializer,
     Message(
       MsgId(Int.MAX_VALUE.toLong()),
@@ -261,7 +261,7 @@ class MessageSerializerTest {
   )
 
   @Test
-  fun testExtreme() = quasselSerializerTest(
+  fun testExtreme() = primitiveSerializerTest(
     MessageSerializer,
     Message(
       MsgId.MAX_VALUE,
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MsgIdSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MsgIdSerializerTest.kt
index 8407a42..03b58bc 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MsgIdSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/MsgIdSerializerTest.kt
@@ -22,7 +22,7 @@ import de.justjanne.libquassel.protocol.features.FeatureSet
 import de.justjanne.libquassel.protocol.models.ids.MsgId
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -36,7 +36,7 @@ class MsgIdSerializerTest {
   }
 
   @Test
-  fun testZero() = quasselSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     MsgIdSerializer,
     MsgId(0),
     byteBufferOf(0, 0, 0, 0, 0, 0, 0, 0),
@@ -44,7 +44,7 @@ class MsgIdSerializerTest {
   )
 
   @Test
-  fun testMinimal() = quasselSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     MsgIdSerializer,
     MsgId.MIN_VALUE,
     byteBufferOf(-128, 0, 0, 0, 0, 0, 0, 0),
@@ -52,7 +52,7 @@ class MsgIdSerializerTest {
   )
 
   @Test
-  fun testMaximal() = quasselSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     MsgIdSerializer,
     MsgId.MAX_VALUE,
     byteBufferOf(127, -1, -1, -1, -1, -1, -1, -1),
@@ -60,7 +60,7 @@ class MsgIdSerializerTest {
   )
 
   @Test
-  fun testAllOnes() = quasselSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     MsgIdSerializer,
     MsgId(0.inv()),
     byteBufferOf(-1, -1, -1, -1, -1, -1, -1, -1),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/NetworkIdSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/NetworkIdSerializerTest.kt
index 79edb08..33e9f22 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/NetworkIdSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/NetworkIdSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 import de.justjanne.libquassel.protocol.models.ids.NetworkId
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,28 +35,28 @@ class NetworkIdSerializerTest {
   }
 
   @Test
-  fun testZero() = quasselSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     NetworkIdSerializer,
     NetworkId(0),
     byteBufferOf(0, 0, 0, 0)
   )
 
   @Test
-  fun testMinimal() = quasselSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     NetworkIdSerializer,
     NetworkId.MIN_VALUE,
     byteBufferOf(-128, 0, 0, 0)
   )
 
   @Test
-  fun testMaximal() = quasselSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     NetworkIdSerializer,
     NetworkId.MAX_VALUE,
     byteBufferOf(127, -1, -1, -1)
   )
 
   @Test
-  fun testAllOnes() = quasselSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     NetworkIdSerializer,
     NetworkId(0.inv()),
     byteBufferOf(-1, -1, -1, -1)
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/PeerPtrSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/PeerPtrSerializerTest.kt
index a435396..9659e02 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/PeerPtrSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/PeerPtrSerializerTest.kt
@@ -21,7 +21,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 import de.justjanne.libquassel.protocol.features.FeatureSet
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 
@@ -35,7 +35,7 @@ class PeerPtrSerializerTest {
   }
 
   @Test
-  fun testZero() = quasselSerializerTest(
+  fun testZero() = primitiveSerializerTest(
     PeerPtrSerializer,
     0uL,
     byteBufferOf(0, 0, 0, 0, 0, 0, 0, 0),
@@ -43,7 +43,7 @@ class PeerPtrSerializerTest {
   )
 
   @Test
-  fun testMinimal() = quasselSerializerTest(
+  fun testMinimal() = primitiveSerializerTest(
     PeerPtrSerializer,
     ULong.MIN_VALUE,
     byteBufferOf(0, 0, 0, 0, 0, 0, 0, 0),
@@ -51,7 +51,7 @@ class PeerPtrSerializerTest {
   )
 
   @Test
-  fun testMaximal() = quasselSerializerTest(
+  fun testMaximal() = primitiveSerializerTest(
     PeerPtrSerializer,
     ULong.MAX_VALUE,
     byteBufferOf(-1, -1, -1, -1, -1, -1, -1, -1),
@@ -59,7 +59,7 @@ class PeerPtrSerializerTest {
   )
 
   @Test
-  fun testAllOnes() = quasselSerializerTest(
+  fun testAllOnes() = primitiveSerializerTest(
     PeerPtrSerializer,
     0uL.inv(),
     byteBufferOf(-1, -1, -1, -1, -1, -1, -1, -1),
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/QHostAddressSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/QHostAddressSerializerTest.kt
index 794be1e..d938356 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/QHostAddressSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/serializers/quassel/QHostAddressSerializerTest.kt
@@ -20,7 +20,7 @@ package de.justjanne.libquassel.protocol.serializers.quassel
 
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.testutil.byteBufferOf
-import de.justjanne.libquassel.protocol.testutil.quasselSerializerTest
+import de.justjanne.libquassel.protocol.testutil.primitiveSerializerTest
 import org.junit.jupiter.api.Assertions.assertEquals
 import org.junit.jupiter.api.Test
 import java.net.Inet4Address
@@ -37,7 +37,7 @@ class QHostAddressSerializerTest {
   }
 
   @Test
-  fun testIpv4() = quasselSerializerTest(
+  fun testIpv4() = primitiveSerializerTest(
     QHostAddressSerializer,
     Inet4Address.getByAddress(
       byteArrayOf(
@@ -51,7 +51,7 @@ class QHostAddressSerializerTest {
   )
 
   @Test
-  fun testIpv6() = quasselSerializerTest(
+  fun testIpv6() = primitiveSerializerTest(
     QHostAddressSerializer,
     Inet6Address.getByAddress(
       ubyteArrayOf(
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/deserialize.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/deserialize.kt
deleted file mode 100644
index a4f64c1..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/deserialize.kt
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.features.FeatureSet
-import de.justjanne.libquassel.protocol.models.HandshakeMessage
-import de.justjanne.libquassel.protocol.models.SignalProxyMessage
-import de.justjanne.libquassel.protocol.serializers.HandshakeSerializer
-import de.justjanne.libquassel.protocol.serializers.PrimitiveSerializer
-import de.justjanne.libquassel.protocol.serializers.SignalProxySerializer
-import de.justjanne.libquassel.protocol.serializers.qt.HandshakeMapSerializer
-import de.justjanne.libquassel.protocol.serializers.qt.QVariantListSerializer
-import org.hamcrest.Matcher
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.jupiter.api.Assertions.assertEquals
-import java.nio.ByteBuffer
-
-fun <T> deserialize(
-  serializer: PrimitiveSerializer<T>,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-): T {
-  val result = serializer.deserialize(buffer, featureSet)
-  assertEquals(0, buffer.remaining())
-  return result
-}
-
-fun <T> testDeserialize(
-  serializer: PrimitiveSerializer<T>,
-  matcher: Matcher<in T>,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val after = deserialize(serializer, buffer, featureSet)
-  assertThat(after, matcher)
-}
-
-fun <T> testDeserialize(
-  serializer: PrimitiveSerializer<T>,
-  data: T,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val after = deserialize(serializer, buffer, featureSet)
-  assertEquals(data, after)
-}
-
-fun <T : HandshakeMessage> testDeserialize(
-  serializer: HandshakeSerializer<T>,
-  matcher: Matcher<in T>,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val map = deserialize(HandshakeMapSerializer, buffer, featureSet)
-  val after = serializer.deserialize(map)
-  assertThat(after, matcher)
-}
-
-fun <T : HandshakeMessage> testDeserialize(
-  serializer: HandshakeSerializer<T>,
-  data: T,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val map = deserialize(HandshakeMapSerializer, buffer, featureSet)
-  val after = serializer.deserialize(map)
-  assertEquals(data, after)
-}
-
-fun <T : SignalProxyMessage> testDeserialize(
-  serializer: SignalProxySerializer<T>,
-  matcher: Matcher<in T>,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val list = deserialize(QVariantListSerializer, buffer, featureSet)
-  val after = serializer.deserialize(list)
-  assertThat(after, matcher)
-}
-
-fun <T : SignalProxyMessage> testDeserialize(
-  serializer: SignalProxySerializer<T>,
-  data: T,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val list = deserialize(QVariantListSerializer, buffer, featureSet)
-  val after = serializer.deserialize(list)
-  assertEquals(data, after)
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/handshakeSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/handshakeSerializerTest.kt
index 3e7c49f..59e47af 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/handshakeSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/handshakeSerializerTest.kt
@@ -19,34 +19,53 @@
 package de.justjanne.libquassel.protocol.testutil
 
 import de.justjanne.libquassel.protocol.features.FeatureSet
+import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
+import de.justjanne.libquassel.protocol.io.use
 import de.justjanne.libquassel.protocol.models.HandshakeMessage
-import de.justjanne.libquassel.protocol.serializers.HandshakeSerializer
+import de.justjanne.libquassel.protocol.serializers.HandshakeMessageSerializer
+import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
 import org.hamcrest.Matcher
+import org.hamcrest.MatcherAssert.assertThat
 import java.nio.ByteBuffer
+import kotlin.test.assertEquals
 
-fun <T : HandshakeMessage> handshakeSerializerTest(
-  serializer: HandshakeSerializer<T>,
+inline fun <reified T : HandshakeMessage> handshakeSerializerTest(
   value: T,
   encoded: ByteBuffer? = null,
-  matcher: ((T) -> Matcher<T>)? = null,
+  noinline matcher: ((T?) -> Matcher<T?>)? = null,
   featureSets: List<FeatureSet> = listOf(FeatureSet.none(), FeatureSet.all()),
   deserializeFeatureSet: FeatureSet? = FeatureSet.all(),
   serializeFeatureSet: FeatureSet? = FeatureSet.all(),
 ) {
   if (encoded != null) {
     if (deserializeFeatureSet != null) {
+      val after = HandshakeMessageSerializer.deserialize(encoded, deserializeFeatureSet) as? T
       if (matcher != null) {
-        testDeserialize(serializer, matcher(value), encoded.rewind(), deserializeFeatureSet)
+        assertThat(after, matcher(value))
       } else {
-        testDeserialize(serializer, value, encoded.rewind(), deserializeFeatureSet)
+        assertEquals(after, value)
       }
     }
     if (serializeFeatureSet != null) {
-      testSerialize(serializer, value, encoded.rewind(), serializeFeatureSet)
+      assertThat(
+        ChainedByteBuffer().use {
+          HandshakeMessageSerializer.serialize(it, value, serializeFeatureSet)
+        },
+        ByteBufferMatcher(encoded.rewind())
+      )
     }
   }
   for (featureSet in featureSets) {
-    testHandshakeSerializerDirect(serializer, value)
-    testHandshakeSerializerEncoded(serializer, value, featureSet)
+    val after = HandshakeMessageSerializer.deserialize(
+      ChainedByteBuffer().use {
+        HandshakeMessageSerializer.serialize(it, value, featureSet)
+      },
+      featureSet
+    ) as? T
+    if (matcher != null) {
+      assertThat(after, matcher(value))
+    } else {
+      assertEquals(value, after)
+    }
   }
 }
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/quasselSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/primitiveSerializerTest.kt
similarity index 57%
rename from libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/quasselSerializerTest.kt
rename to libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/primitiveSerializerTest.kt
index effe982..eefbafb 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/quasselSerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/primitiveSerializerTest.kt
@@ -19,12 +19,36 @@
 package de.justjanne.libquassel.protocol.testutil
 
 import de.justjanne.libquassel.protocol.features.FeatureSet
+import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
+import de.justjanne.libquassel.protocol.io.use
+import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.serializers.PrimitiveSerializer
+import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
 import org.hamcrest.Matcher
+import org.hamcrest.MatcherAssert.assertThat
+import org.junit.jupiter.api.Assertions.assertEquals
 import java.nio.ByteBuffer
 
-inline fun <reified T : Any?> quasselSerializerTest(
+inline fun <reified T : Any?> primitiveSerializerTest(
+  type: QtType,
+  value: T,
+  encoded: ByteBuffer? = null,
+  noinline matcher: ((T) -> Matcher<T>)? = null,
+  featureSets: List<FeatureSet> = listOf(FeatureSet.none(), FeatureSet.all()),
+  deserializeFeatureSet: FeatureSet? = FeatureSet.all(),
+  serializeFeatureSet: FeatureSet? = FeatureSet.all(),
+) = primitiveSerializerTest(
+  type.serializer(),
+  value,
+  encoded,
+  matcher,
+  featureSets,
+  deserializeFeatureSet,
+  serializeFeatureSet
+)
+
+inline fun <reified T : Any?> primitiveSerializerTest(
   type: QuasselType,
   value: T,
   encoded: ByteBuffer? = null,
@@ -32,26 +56,17 @@ inline fun <reified T : Any?> quasselSerializerTest(
   featureSets: List<FeatureSet> = listOf(FeatureSet.none(), FeatureSet.all()),
   deserializeFeatureSet: FeatureSet? = FeatureSet.all(),
   serializeFeatureSet: FeatureSet? = FeatureSet.all(),
-) {
-  if (encoded != null) {
-    if (deserializeFeatureSet != null) {
-      if (matcher != null) {
-        testDeserialize(type.serializer<T>(), matcher(value), encoded.rewind(), deserializeFeatureSet)
-      } else {
-        testDeserialize(type.serializer(), value, encoded.rewind(), deserializeFeatureSet)
-      }
-    }
-    if (serializeFeatureSet != null) {
-      testSerialize(type.serializer(), value, encoded.rewind(), serializeFeatureSet)
-    }
-  }
-  for (featureSet in featureSets) {
-    testPrimitiveSerializerDirect(type.serializer(), value, featureSet, matcher?.invoke(value))
-    testQuasselSerializerVariant(type, value, featureSet, matcher?.invoke(value))
-  }
-}
+) = primitiveSerializerTest(
+  type.serializer(),
+  value,
+  encoded,
+  matcher,
+  featureSets,
+  deserializeFeatureSet,
+  serializeFeatureSet
+)
 
-inline fun <reified T : Any?> quasselSerializerTest(
+inline fun <reified T : Any?> primitiveSerializerTest(
   serializer: PrimitiveSerializer<T>,
   value: T,
   encoded: ByteBuffer? = null,
@@ -62,14 +77,19 @@ inline fun <reified T : Any?> quasselSerializerTest(
 ) {
   if (encoded != null) {
     if (deserializeFeatureSet != null) {
+      val after = serializer.deserialize(encoded.rewind(), deserializeFeatureSet)
+      assertEquals(0, encoded.remaining())
       if (matcher != null) {
-        testDeserialize(serializer, matcher(value), encoded.rewind(), deserializeFeatureSet)
+        assertThat(after, matcher(value))
       } else {
-        testDeserialize(serializer, value, encoded.rewind(), deserializeFeatureSet)
+        assertEquals(value, after)
       }
     }
     if (serializeFeatureSet != null) {
-      testSerialize(serializer, value, encoded.rewind(), serializeFeatureSet)
+      val after = ChainedByteBuffer().use {
+        serializer.serialize(it, value, serializeFeatureSet)
+      }
+      assertThat(after, ByteBufferMatcher(encoded.rewind()))
     }
   }
   for (featureSet in featureSets) {
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/qtSerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/qtSerializerTest.kt
deleted file mode 100644
index 73ea9f9..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/qtSerializerTest.kt
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.features.FeatureSet
-import de.justjanne.libquassel.protocol.models.types.QtType
-import de.justjanne.libquassel.protocol.serializers.PrimitiveSerializer
-import org.hamcrest.Matcher
-import java.nio.ByteBuffer
-
-inline fun <reified T : Any?> qtSerializerTest(
-  type: QtType,
-  value: T,
-  encoded: ByteBuffer? = null,
-  noinline matcher: ((T) -> Matcher<T>)? = null,
-  featureSets: List<FeatureSet> = listOf(FeatureSet.none(), FeatureSet.all()),
-  deserializeFeatureSet: FeatureSet? = FeatureSet.all(),
-  serializeFeatureSet: FeatureSet? = FeatureSet.all(),
-) {
-  if (encoded != null) {
-    if (deserializeFeatureSet != null) {
-      if (matcher != null) {
-        testDeserialize(type.serializer<T>(), matcher(value), encoded.rewind(), deserializeFeatureSet)
-      } else {
-        testDeserialize(type.serializer(), value, encoded.rewind(), deserializeFeatureSet)
-      }
-    }
-    if (serializeFeatureSet != null) {
-      testSerialize(type.serializer(), value, encoded.rewind(), serializeFeatureSet)
-    }
-  }
-  for (featureSet in featureSets) {
-    testPrimitiveSerializerDirect(type.serializer(), value, featureSet, matcher?.invoke(value))
-    testQtSerializerVariant(type, value, featureSet, matcher?.invoke(value))
-  }
-}
-
-inline fun <reified T : Any?> qtSerializerTest(
-  serializer: PrimitiveSerializer<T>,
-  value: T,
-  encoded: ByteBuffer? = null,
-  noinline matcher: ((T) -> Matcher<T>)? = null,
-  featureSets: List<FeatureSet> = listOf(FeatureSet.none(), FeatureSet.all()),
-  deserializeFeatureSet: FeatureSet? = FeatureSet.all(),
-  serializeFeatureSet: FeatureSet? = FeatureSet.all(),
-) {
-  if (encoded != null) {
-    if (deserializeFeatureSet != null) {
-      if (matcher != null) {
-        testDeserialize(serializer, matcher(value), encoded.rewind(), deserializeFeatureSet)
-      } else {
-        testDeserialize(serializer, value, encoded.rewind(), deserializeFeatureSet)
-      }
-    }
-    if (serializeFeatureSet != null) {
-      testSerialize(serializer, value, encoded.rewind(), serializeFeatureSet)
-    }
-  }
-  for (featureSet in featureSets) {
-    testPrimitiveSerializerDirect(serializer, value, featureSet, matcher?.invoke(value))
-  }
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serialize.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serialize.kt
deleted file mode 100644
index c19cafe..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serialize.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.features.FeatureSet
-import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
-import de.justjanne.libquassel.protocol.models.HandshakeMessage
-import de.justjanne.libquassel.protocol.models.SignalProxyMessage
-import de.justjanne.libquassel.protocol.serializers.HandshakeSerializer
-import de.justjanne.libquassel.protocol.serializers.PrimitiveSerializer
-import de.justjanne.libquassel.protocol.serializers.SignalProxySerializer
-import de.justjanne.libquassel.protocol.serializers.qt.HandshakeMapSerializer
-import de.justjanne.libquassel.protocol.serializers.qt.QVariantListSerializer
-import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
-import org.hamcrest.MatcherAssert.assertThat
-import java.nio.ByteBuffer
-
-fun <T> serialize(
-  serializer: PrimitiveSerializer<T>,
-  data: T,
-  featureSet: FeatureSet = FeatureSet.all()
-): ByteBuffer {
-  val buffer = ChainedByteBuffer()
-  serializer.serialize(buffer, data, featureSet)
-  return buffer.toBuffer()
-}
-
-fun <T> testSerialize(
-  serializer: PrimitiveSerializer<T>,
-  data: T,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val after = serialize(serializer, data, featureSet)
-  assertThat(after, ByteBufferMatcher(buffer))
-}
-
-fun <T : HandshakeMessage> testSerialize(
-  serializer: HandshakeSerializer<T>,
-  data: T,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val map = serializer.serialize(data)
-  val after = serialize(HandshakeMapSerializer, map, featureSet)
-  assertThat(after, ByteBufferMatcher(buffer))
-}
-
-fun <T : SignalProxyMessage> testSerialize(
-  serializer: SignalProxySerializer<T>,
-  data: T,
-  buffer: ByteBuffer,
-  featureSet: FeatureSet = FeatureSet.all()
-) {
-  val list = serializer.serialize(data)
-  val after = serialize(QVariantListSerializer, list, featureSet)
-  assertThat(after, ByteBufferMatcher(buffer))
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serializerTest.kt
index c14bece..ff9231e 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/serializerTest.kt
@@ -19,8 +19,13 @@
 package de.justjanne.libquassel.protocol.testutil
 
 import de.justjanne.libquassel.protocol.features.FeatureSet
+import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
+import de.justjanne.libquassel.protocol.io.use
 import de.justjanne.libquassel.protocol.serializers.PrimitiveSerializer
+import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
 import org.hamcrest.Matcher
+import org.hamcrest.MatcherAssert.assertThat
+import org.junit.jupiter.api.Assertions.assertEquals
 import java.nio.ByteBuffer
 
 fun <T : Any?> serializerTest(
@@ -33,14 +38,19 @@ fun <T : Any?> serializerTest(
 ) {
   if (encoded != null) {
     if (deserializeFeatureSet != null) {
+      val after = serializer.deserialize(encoded.rewind(), deserializeFeatureSet)
+      assertEquals(0, encoded.remaining())
       if (matcher != null) {
-        testDeserialize(serializer, matcher(value), encoded.rewind(), deserializeFeatureSet)
+        assertThat(after, matcher(value))
       } else {
-        testDeserialize(serializer, value, encoded.rewind(), deserializeFeatureSet)
+        assertEquals(value, after)
       }
     }
     if (serializeFeatureSet != null) {
-      testSerialize(serializer, value, encoded.rewind(), serializeFeatureSet)
+      val after = ChainedByteBuffer().use {
+        serializer.serialize(it, value, serializeFeatureSet)
+      }
+      assertThat(after, ByteBufferMatcher(encoded.rewind()))
     }
   }
 }
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/signalProxySerializerTest.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/signalProxySerializerTest.kt
index 0fa7c85..08e0b83 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/signalProxySerializerTest.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/signalProxySerializerTest.kt
@@ -19,34 +19,53 @@
 package de.justjanne.libquassel.protocol.testutil
 
 import de.justjanne.libquassel.protocol.features.FeatureSet
+import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
+import de.justjanne.libquassel.protocol.io.use
 import de.justjanne.libquassel.protocol.models.SignalProxyMessage
-import de.justjanne.libquassel.protocol.serializers.SignalProxySerializer
+import de.justjanne.libquassel.protocol.serializers.SignalProxyMessageSerializer
+import de.justjanne.libquassel.protocol.testutil.matchers.ByteBufferMatcher
 import org.hamcrest.Matcher
+import org.hamcrest.MatcherAssert.assertThat
 import java.nio.ByteBuffer
+import kotlin.test.assertEquals
 
-fun <T : SignalProxyMessage> signalProxySerializerTest(
-  serializer: SignalProxySerializer<T>,
+inline fun <reified T : SignalProxyMessage> signalProxySerializerTest(
   value: T,
   encoded: ByteBuffer? = null,
-  matcher: ((T) -> Matcher<T>)? = null,
+  noinline matcher: ((T?) -> Matcher<T?>)? = null,
   featureSets: List<FeatureSet> = listOf(FeatureSet.none(), FeatureSet.all()),
   deserializeFeatureSet: FeatureSet? = FeatureSet.all(),
   serializeFeatureSet: FeatureSet? = FeatureSet.all(),
 ) {
   if (encoded != null) {
     if (deserializeFeatureSet != null) {
+      val after = SignalProxyMessageSerializer.deserialize(encoded, deserializeFeatureSet) as? T
       if (matcher != null) {
-        testDeserialize(serializer, matcher(value), encoded.rewind(), deserializeFeatureSet)
+        assertThat(after, matcher(value))
       } else {
-        testDeserialize(serializer, value, encoded.rewind(), deserializeFeatureSet)
+        assertEquals(after, value)
       }
     }
     if (serializeFeatureSet != null) {
-      testSerialize(serializer, value, encoded.rewind(), serializeFeatureSet)
+      assertThat(
+        ChainedByteBuffer().use {
+          SignalProxyMessageSerializer.serialize(it, value, serializeFeatureSet)
+        },
+        ByteBufferMatcher(encoded.rewind())
+      )
     }
   }
   for (featureSet in featureSets) {
-    testSignalProxySerializerDirect(serializer, value)
-    testSignalProxySerializerEncoded(serializer, value, featureSet)
+    val after = SignalProxyMessageSerializer.deserialize(
+      ChainedByteBuffer().use {
+        SignalProxyMessageSerializer.serialize(it, value, featureSet)
+      },
+      featureSet
+    ) as? T
+    if (matcher != null) {
+      assertThat(after, matcher(value))
+    } else {
+      assertEquals(value, after)
+    }
   }
 }
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerDirect.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerDirect.kt
deleted file mode 100644
index 2fd34c3..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerDirect.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.models.HandshakeMessage
-import de.justjanne.libquassel.protocol.serializers.HandshakeSerializer
-import org.hamcrest.Matcher
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.jupiter.api.Assertions.assertEquals
-
-fun <T : HandshakeMessage> testHandshakeSerializerDirect(
-  serializer: HandshakeSerializer<T>,
-  data: T,
-  matcher: Matcher<T>? = null
-) {
-  val after = serializer.deserialize(serializer.serialize(data))
-  if (matcher != null) {
-    assertThat(after, matcher)
-  } else {
-    assertEquals(data, after)
-  }
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerEncoded.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerEncoded.kt
deleted file mode 100644
index fcb03de..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testHandshakeSerializerEncoded.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.features.FeatureSet
-import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
-import de.justjanne.libquassel.protocol.models.HandshakeMessage
-import de.justjanne.libquassel.protocol.serializers.HandshakeSerializer
-import de.justjanne.libquassel.protocol.serializers.qt.HandshakeMapSerializer
-import org.hamcrest.Matcher
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.jupiter.api.Assertions.assertEquals
-
-fun <T : HandshakeMessage> testHandshakeSerializerEncoded(
-  serializer: HandshakeSerializer<T>,
-  data: T,
-  featureSet: FeatureSet = FeatureSet.all(),
-  matcher: Matcher<T>? = null
-) {
-  val buffer = ChainedByteBuffer(limit = 16384)
-  HandshakeMapSerializer.serialize(buffer, serializer.serialize(data), featureSet)
-  val result = buffer.toBuffer()
-  val after = serializer.deserialize(HandshakeMapSerializer.deserialize(result, featureSet))
-  assertEquals(0, result.remaining())
-  if (matcher != null) {
-    assertThat(after, matcher)
-  } else {
-    assertEquals(data, after)
-  }
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQuasselSerializerVariant.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testPrimitiveSerializerVariant.kt
similarity index 71%
rename from libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQuasselSerializerVariant.kt
rename to libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testPrimitiveSerializerVariant.kt
index 4355cbe..893bc59 100644
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQuasselSerializerVariant.kt
+++ b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testPrimitiveSerializerVariant.kt
@@ -20,6 +20,7 @@ package de.justjanne.libquassel.protocol.testutil
 
 import de.justjanne.libquassel.protocol.features.FeatureSet
 import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
+import de.justjanne.libquassel.protocol.models.types.QtType
 import de.justjanne.libquassel.protocol.models.types.QuasselType
 import de.justjanne.libquassel.protocol.serializers.qt.QVariantSerializer
 import de.justjanne.libquassel.protocol.variant.qVariant
@@ -27,7 +28,7 @@ import org.hamcrest.Matcher
 import org.hamcrest.MatcherAssert.assertThat
 import org.junit.jupiter.api.Assertions.assertEquals
 
-inline fun <reified T> testQuasselSerializerVariant(
+inline fun <reified T> testPrimitiveSerializerVariant(
   type: QuasselType,
   data: T,
   featureSet: FeatureSet = FeatureSet.all(),
@@ -45,3 +46,22 @@ inline fun <reified T> testQuasselSerializerVariant(
     assertEquals(data, after.data)
   }
 }
+
+inline fun <reified T> testPrimitiveSerializerVariant(
+  type: QtType,
+  data: T,
+  featureSet: FeatureSet = FeatureSet.all(),
+  matcher: Matcher<in T>? = null
+) {
+  val buffer = ChainedByteBuffer(limit = 16384)
+  QVariantSerializer.serialize(buffer, qVariant(data, type), featureSet)
+  val result = buffer.toBuffer()
+  val after = QVariantSerializer.deserialize(result, featureSet)
+  assertEquals(0, result.remaining())
+  if (matcher != null) {
+    @Suppress("UNCHECKED_CAST")
+    assertThat(after.data as T, matcher)
+  } else {
+    assertEquals(data, after.data)
+  }
+}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQtSerializerVariant.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQtSerializerVariant.kt
deleted file mode 100644
index c7d6094..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testQtSerializerVariant.kt
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.features.FeatureSet
-import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
-import de.justjanne.libquassel.protocol.models.types.QtType
-import de.justjanne.libquassel.protocol.serializers.qt.QVariantSerializer
-import de.justjanne.libquassel.protocol.variant.qVariant
-import org.hamcrest.Matcher
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.jupiter.api.Assertions.assertEquals
-
-inline fun <reified T> testQtSerializerVariant(
-  type: QtType,
-  data: T,
-  featureSet: FeatureSet = FeatureSet.all(),
-  matcher: Matcher<in T>? = null
-) {
-  val buffer = ChainedByteBuffer(limit = 16384)
-  QVariantSerializer.serialize(buffer, qVariant(data, type), featureSet)
-  val result = buffer.toBuffer()
-  val after = QVariantSerializer.deserialize(result, featureSet)
-  assertEquals(0, result.remaining())
-  if (matcher != null) {
-    @Suppress("UNCHECKED_CAST")
-    assertThat(after.data as T, matcher)
-  } else {
-    assertEquals(data, after.data)
-  }
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerDirect.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerDirect.kt
deleted file mode 100644
index 10bc255..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerDirect.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.models.SignalProxyMessage
-import de.justjanne.libquassel.protocol.serializers.SignalProxySerializer
-import org.hamcrest.Matcher
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.jupiter.api.Assertions.assertEquals
-
-fun <T : SignalProxyMessage> testSignalProxySerializerDirect(
-  serializer: SignalProxySerializer<T>,
-  data: T,
-  matcher: Matcher<T>? = null
-) {
-  val after = serializer.deserialize(serializer.serialize(data))
-  if (matcher != null) {
-    assertThat(after, matcher)
-  } else {
-    assertEquals(data, after)
-  }
-}
diff --git a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerEncoded.kt b/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerEncoded.kt
deleted file mode 100644
index 8575be4..0000000
--- a/libquassel-protocol/src/test/kotlin/de/justjanne/libquassel/protocol/testutil/testSignalProxySerializerEncoded.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Quasseldroid - Quassel client for Android
- *
- * Copyright (c) 2021 Janne Mareike Koschinski
- * Copyright (c) 2021 The Quassel Project
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package de.justjanne.libquassel.protocol.testutil
-
-import de.justjanne.libquassel.protocol.features.FeatureSet
-import de.justjanne.libquassel.protocol.io.ChainedByteBuffer
-import de.justjanne.libquassel.protocol.models.SignalProxyMessage
-import de.justjanne.libquassel.protocol.serializers.SignalProxySerializer
-import de.justjanne.libquassel.protocol.serializers.qt.QVariantListSerializer
-import org.hamcrest.Matcher
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.jupiter.api.Assertions.assertEquals
-
-fun <T : SignalProxyMessage> testSignalProxySerializerEncoded(
-  serializer: SignalProxySerializer<T>,
-  data: T,
-  featureSet: FeatureSet = FeatureSet.all(),
-  matcher: Matcher<T>? = null
-) {
-  val buffer = ChainedByteBuffer(limit = 16384)
-  QVariantListSerializer.serialize(buffer, serializer.serialize(data), featureSet)
-  val result = buffer.toBuffer()
-  val after = serializer.deserialize(QVariantListSerializer.deserialize(result, featureSet))
-  assertEquals(0, result.remaining())
-  if (matcher != null) {
-    assertThat(after, matcher)
-  } else {
-    assertEquals(data, after)
-  }
-}
-- 
GitLab