Permalink
Browse files

Update tests

  • Loading branch information...
1 parent 8b613a6 commit a597e56189fdfbbccfc538000c9028b06f377e6d @ates ates committed Sep 7, 2012
Showing with 13 additions and 3 deletions.
  1. +8 −2 test/pkt_tests.erl
  2. +5 −1 test/pkt_tests.hrl
View
@@ -6,6 +6,12 @@
sctp_test() ->
{SCTP, []} = pkt:sctp(?SCTP_PACKET),
+ {SCTP1, []} = pkt:sctp(?SCTP_PACKET_WITH_PADDING),
Chunk = erlang:hd(SCTP#sctp.chunks),
- ?assertEqual(length(SCTP#sctp.chunks), 1),
- ?assertEqual(Chunk#sctp_chunk.payload#sctp_chunk_data.tsn, 2860946939).
+ Chunk1 = erlang:hd(SCTP1#sctp.chunks),
+ ?assertEqual(SCTP#sctp.sport, 7),
+ ?assertEqual(SCTP1#sctp.dport, 32837),
+ ?assertEqual(Chunk#sctp_chunk.type, 1),
+ ?assertEqual(byte_size(Chunk#sctp_chunk.payload), 28),
+ ?assertEqual(length(SCTP1#sctp.chunks), 1),
+ ?assertEqual(Chunk1#sctp_chunk.payload#sctp_chunk_data.tsn, 2860946939).
View
@@ -1,4 +1,8 @@
--define(SCTP_PACKET,
+-define(SCTP_PACKET,
+ <<0,7,0,7,0,0,0,0,55,97,167,70,1,0,0,32,67,35,37,68,0,0,255,255,0,17,0,17,
+ 92,254,55,159,192,0,0,4,0,12,0,6,0,5,0,0>>).
+
+-define(SCTP_PACKET_WITH_PADDING,
<<0,80,128,69,233,183,59,195,103,102,136,252,0,3,1,65,170,134,149,251,0,0,0,
0,0,0,0,0,72,84,84,80,47,49,46,49,32,50,48,48,32,79,75,13,10,68,97,116,101,
58,32,84,104,117,44,32,49,50,32,74,97,110,32,50,48,48,54,32,48,50,58,53,56,

0 comments on commit a597e56

Please sign in to comment.