Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 35 lines (27 sloc) 0.933 kB
7c3aece @trung amf3 test cases
authored
1 -module(amf3_test).
2 -author("trung@mdkt.org").
3
4 -include_lib("eunit/include/eunit.hrl").
5 -include("../include/types.hrl").
6 -include("../include/messages.hrl").
7 -compile(export_all).
8
9 uint29_verify(ExpectedValue) ->
10 {ok, Bin} = amf3:write_uint_29(ExpectedValue),
11 ?assert(Bin /= <<>>),
2dc34a7 @trung print bin
authored
12 ?debugFmt("~p~n", [Bin]),
7c3aece @trung amf3 test cases
authored
13 {ok, ActualValue, _} = amf3:read_uint_29(Bin),
14 ?assertEqual(ExpectedValue, ActualValue).
15
16 uint29_less_128_test() ->
17 ExpectedValue = 123,
18 uint29_verify(ExpectedValue).
19
20 uint29_less_16384_test() ->
21 ExpectedValue = 15384,
22 uint29_verify(ExpectedValue).
23
24 uint29_less_2097152_test() ->
25 ExpectedValue = 1097152,
26 uint29_verify(ExpectedValue).
27
14203ac @trung fixed amf3 write uint29
authored
28 uint29_less_536870911_test() ->
29 ExpectedValue = 536870911,
7c3aece @trung amf3 test cases
authored
30 uint29_verify(ExpectedValue).
31
32 uint29_out_of_range_test() ->
14203ac @trung fixed amf3 write uint29
authored
33 ExpectedValue = 536870912,
7c3aece @trung amf3 test cases
authored
34 {bad, _} = amf3:write_uint_29(ExpectedValue).
Something went wrong with that request. Please try again.