@@ -23,14 +23,15 @@ defmodule ExRTCP.Packet.GoodbyeTest do
2323
2424 test "packet with reason" do
2525 sources = [ @ ssrc , @ ssrc + 1 , @ ssrc + 2 ]
26- reason = "1234 "
26+ reason = "123 "
2727
2828 packet = % Goodbye {
2929 sources: sources ,
3030 reason: reason
3131 }
3232
3333 assert { encoded , 3 , 203 } = Goodbye . encode ( packet )
34+ assert rem ( byte_size ( encoded ) , 4 ) == 0
3435
3536 bin = for i <- sources , do: << i :: 32 >> , into: << >>
3637 bin = << bin :: binary , byte_size ( reason ) :: 8 , reason :: binary >>
@@ -40,17 +41,18 @@ defmodule ExRTCP.Packet.GoodbyeTest do
4041
4142 test "packet with reason that's not multiple of 32 bits" do
4243 sources = [ @ ssrc , @ ssrc + 1 , @ ssrc + 2 ]
43- reason = "123456 "
44+ reason = "1234 "
4445
4546 packet = % Goodbye {
4647 sources: sources ,
4748 reason: reason
4849 }
4950
5051 assert { encoded , 3 , 203 } = Goodbye . encode ( packet )
52+ assert rem ( byte_size ( encoded ) , 4 ) == 0
5153
5254 bin = for i <- sources , do: << i :: 32 >> , into: << >>
53- bin = << bin :: binary , byte_size ( reason ) :: 8 , reason :: binary , 0 , 0 >>
55+ bin = << bin :: binary , byte_size ( reason ) :: 8 , reason :: binary , 0 , 0 , 0 >>
5456
5557 assert encoded == bin
5658 end
0 commit comments