Skip to content

Commit 1cd137d

Browse files
committed
fix: add tests for deserializing unsigned shorts in wire protocol
1 parent 99243b0 commit 1cd137d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

projects/Unit/TestFieldTableFormatting.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public void TestQpidJmsTypes()
143143
["f"] = (float)123, // 2+5
144144
["l"] = (long)123, // 2+9
145145
["s"] = (short)123, // 2+2
146+
["u"] = (ushort)123
146147
["t"] = true // 2+2
147148
};
148149
byte[] xbytes = { 0xaa, 0x55 };
@@ -159,6 +160,7 @@ public void TestQpidJmsTypes()
159160
Assert.Equal(typeof(float), nt["f"].GetType()); Assert.Equal((float)123, nt["f"]);
160161
Assert.Equal(typeof(long), nt["l"].GetType()); Assert.Equal((long)123, nt["l"]);
161162
Assert.Equal(typeof(short), nt["s"].GetType()); Assert.Equal((short)123, nt["s"]);
163+
Assert.Equal(typeof(ushort), nt["u"].GetType()); Assert.Equal((ushort)123, nt["u"]);
162164
Assert.Equal(true, nt["t"]);
163165
Assert.Equal(xbytes, ((BinaryTableValue)nt["x"]).Bytes);
164166
Assert.Null(nt["V"]);

projects/Unit/TestFieldTableFormattingGeneric.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public void TestQpidJmsTypes()
131131
["f"] = (float)123,
132132
["l"] = (long)123,
133133
["s"] = (short)123,
134+
["u"] = (ushort)123,
134135
["t"] = true
135136
};
136137
byte[] xbytes = new byte[] { 0xaa, 0x55 };
@@ -147,6 +148,7 @@ public void TestQpidJmsTypes()
147148
Assert.Equal(typeof(float), nt["f"].GetType()); Assert.Equal((float)123, nt["f"]);
148149
Assert.Equal(typeof(long), nt["l"].GetType()); Assert.Equal((long)123, nt["l"]);
149150
Assert.Equal(typeof(short), nt["s"].GetType()); Assert.Equal((short)123, nt["s"]);
151+
Assert.Equal(typeof(ushort), nt["u"].GetType()); Assert.Equal((ushort)123, nt["u"]);
150152
Assert.Equal(true, nt["t"]);
151153
Assert.Equal(xbytes, ((BinaryTableValue)nt["x"]).Bytes);
152154
Assert.Null(nt["V"]);

0 commit comments

Comments
 (0)