Skip to content

Commit

Permalink
Fix eunits
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed Jul 2, 2024
1 parent 5f9afa0 commit 81b4a7f
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/hpr_routing.erl
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,9 @@ maybe_deliver_packet_to_route_locked() ->

?assertEqual(
{error, locked},
maybe_deliver_packet_to_route(PacketUp, RouteETS1, erlang:system_time(millisecond), 1)
maybe_deliver_packet_to_route(
hpr_packet_up:type(PacketUp), PacketUp, RouteETS1, erlang:system_time(millisecond), 1
)
),

?assertEqual(0, meck:num_calls(hpr_protocol_router, send, 4)),
Expand Down Expand Up @@ -925,7 +927,9 @@ maybe_deliver_packet_to_route_inactive() ->

?assertEqual(
{error, inactive},
maybe_deliver_packet_to_route(PacketUp, RouteETS1, erlang:system_time(millisecond), 1)
maybe_deliver_packet_to_route(
hpr_packet_up:type(PacketUp), PacketUp, RouteETS1, erlang:system_time(millisecond), 1
)
),

?assertEqual(0, meck:num_calls(hpr_protocol_router, send, 4)),
Expand Down Expand Up @@ -958,7 +962,9 @@ maybe_deliver_packet_to_route_in_cooldown() ->

?assertEqual(
{error, in_cooldown},
maybe_deliver_packet_to_route(PacketUp, RouteETS1, erlang:system_time(millisecond), 1)
maybe_deliver_packet_to_route(
hpr_packet_up:type(PacketUp), PacketUp, RouteETS1, erlang:system_time(millisecond), 1
)
),

?assertEqual(0, meck:num_calls(hpr_protocol_router, send, 4)),
Expand Down Expand Up @@ -995,18 +1001,24 @@ maybe_deliver_packet_to_route_multi_buy() ->
%% Packet 1 accepted using SKF Multi buy 1 (counter 1)
?assertEqual(
{ok, true},
maybe_deliver_packet_to_route(PacketUp, RouteETS1, erlang:system_time(millisecond), 1)
maybe_deliver_packet_to_route(
hpr_packet_up:type(PacketUp), PacketUp, RouteETS1, erlang:system_time(millisecond), 1
)
),
%% Packet 2 refused using SKF Multi buy 1 (counter 2)
?assertEqual(
{error, multi_buy},
maybe_deliver_packet_to_route(PacketUp, RouteETS1, erlang:system_time(millisecond), 1)
maybe_deliver_packet_to_route(
hpr_packet_up:type(PacketUp), PacketUp, RouteETS1, erlang:system_time(millisecond), 1
)
),

%% Packet 3 accepted using route multi buy 3 (counter 3)
?assertEqual(
{ok, true},
maybe_deliver_packet_to_route(PacketUp, RouteETS1, erlang:system_time(millisecond), 0)
maybe_deliver_packet_to_route(
hpr_packet_up:type(PacketUp), PacketUp, RouteETS1, erlang:system_time(millisecond), 0
)
),
%% Packet 4 refused using route multi buy 3 (counter 4)
?assertEqual(
Expand Down

0 comments on commit 81b4a7f

Please sign in to comment.