1 -module(x_plane_data_SUITE).
11 [ t_basic_sanity_check/1
14 -define(GROUP, x_plane_data).
16 %% ============================================================================
18 %% ============================================================================
26 [ t_basic_sanity_check
28 Properties = [parallel],
29 [ {?GROUP, Properties, Tests}
33 %% =============================================================================
35 %% =============================================================================
37 t_basic_sanity_check(_Cfg) ->
40 Packet = base64:decode(PacketBase64),
41 {error, packet_bad_header} =
42 x_plane_data_raw:of_bin(<<"bad-header", Packet/binary>>),
43 {error, packet_bad_length} =
44 x_plane_data_raw:of_bin(<<Packet/binary, "extra-stuff">>),
45 {ok, {Index, Groups}} =
46 x_plane_data_raw:of_bin(<<Packet/binary>>),
47 ct:log("Index: ~p", [Index]),
48 ct:log("Groups: ~p", [Groups]),
49 {some, Group3 } = kv_list_find(Groups, 3),
50 {some, Group17} = kv_list_find(Groups, 17),
51 {some, Group20} = kv_list_find(Groups, 20),
55 , 1.0040892448159866e-5
59 , 1.1554855518625118e-5
81 lists:foreach(Test, sample_packets_base64_encoded()).
83 %% =============================================================================
85 %% =============================================================================
87 sample_packets_base64_encoded() ->
88 [ <<"REFUQUADAAAAbcpGQLt81EBfZNlATnUoNwDAecSow2RAnCv6QLrbQTcRAAAA3i8VQFL3ZT6dPfFCx4IFQwDAecQAwHnEAMB5xADAecQUAAAA1ZciQg6ik8JGBv9AdDxoPgAAgD9G/o3CAAAgQgAAlsI=">>
92 %% =============================================================================
94 %% =============================================================================
96 kv_list_find(KVL, K) ->
97 case lists:keyfind(K, 1, KVL)