summaryrefslogtreecommitdiff
path: root/test/mem3_test.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/mem3_test.erl')
-rw-r--r--test/mem3_test.erl22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/mem3_test.erl b/test/mem3_test.erl
index 8747cf02..d5420ba3 100644
--- a/test/mem3_test.erl
+++ b/test/mem3_test.erl
@@ -4,6 +4,9 @@
-include("../include/config.hrl").
-include_lib("eunit/include/eunit.hrl").
+-define(HINT_C1, 365375409332725729550921208179070754913983135744).
+-define(HINT_C2, 1096126227998177188652763624537212264741949407232).
+
%% TEST SETUP
all_tests_test_() ->
@@ -17,7 +20,8 @@ all_tests_test_() ->
[
fun init/1,
fun clock/1,
- fun join_first/1
+ fun join_first/1,
+ fun join_first_with_hints/1
]}
end}
]
@@ -56,3 +60,19 @@ join_first(_Pid) ->
Pmap = mem3:partitions(),
?assertEqual(8, length(Pmap)),
ok.
+
+
+join_first_with_hints(_Pid) ->
+ mem3:join(first, [{1, a, []},
+ {2, b, []},
+ {3, c, [{hints, [?HINT_C1, ?HINT_C2]}]},
+ {4, d, []},
+ {5, e, []}]),
+ Fullmap = mem3:fullmap(),
+ ?assertEqual(24, length(Fullmap)),
+ Pmap = mem3:partitions(),
+ ?assertEqual(8, length(Pmap)),
+ %?debugFmt("~nFullmap: ~p~n", [Fullmap]),
+ ?assertEqual([c,d,e], mem3:nodes_for_part(?HINT_C1)),
+ ?assertEqual([c,d,e], mem3:nodes_for_part(?HINT_C2)),
+ ok.