diff --git a/cover.spec b/cover.spec index f8a5098..c37e036 100644 --- a/cover.spec +++ b/cover.spec @@ -1,3 +1,3 @@ {level, details}. {incl_app, b_trees, details}. -{incl_mods, [b_trees, test_generator]}. +{incl_mods, [b_trees, b_trees_generator]}. diff --git a/src/b_trees.app.src b/src/b_trees.app.src index a968d42..f965ecf 100644 --- a/src/b_trees.app.src +++ b/src/b_trees.app.src @@ -13,6 +13,6 @@ b_trees ] }, - {vsn, "1.3.0"} + {vsn, "1.3.1"} ] }. diff --git a/src/test_generator.erl b/src/b_trees_generator.erl similarity index 99% rename from src/test_generator.erl rename to src/b_trees_generator.erl index 084f2aa..c4099ac 100644 --- a/src/test_generator.erl +++ b/src/b_trees_generator.erl @@ -1,5 +1,5 @@ %%%------------------------------------------------------------------- -%%% File : test_generator.erl +%%% File : b_trees_generator.erl %%% Description : Generating B-trees for testing purposes. %%% %%% Created : 09.09.2016 @@ -7,7 +7,7 @@ %%% Copyright (C) 2016 Walter Weinmann %%%------------------------------------------------------------------- --module(test_generator). +-module(b_trees_generator). -include_lib("eunit/include/eunit.hrl"). diff --git a/test/b_trees_SUITE.erl b/test/b_trees_SUITE.erl index 47ec569..3825839 100644 --- a/test/b_trees_SUITE.erl +++ b/test/b_trees_SUITE.erl @@ -115,7 +115,7 @@ all() -> %%-------------------------------------------------------------------- delete_any_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -165,11 +165,11 @@ delete_any_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_any_test(_Config) -> - test_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), - test_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - test_generator:check_equal(?B_TREE_06_01, b_trees:delete_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), - test_generator:check_equal(?B_TREE_06_03, b_trees:delete_any("k_04", test_generator:prepare_template_asc(?B_TREE_06_04))), - test_generator:check_equal(?B_TREE_06_06, b_trees:delete_any("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + b_trees_generator:check_equal(?B_TREE_06_01, b_trees:delete_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + b_trees_generator:check_equal(?B_TREE_06_03, b_trees:delete_any("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + b_trees_generator:check_equal(?B_TREE_06_06, b_trees:delete_any("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), ok. @@ -178,30 +178,30 @@ delete_any_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_test(_Config) -> - test_generator:check_equal(?B_TREE_04_10_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_04_10))), + b_trees_generator:check_equal(?B_TREE_04_10_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_10))), - test_generator:check_equal(?B_TREE_04_17_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_04_17))), - test_generator:check_equal(?B_TREE_04_17_MINUS_02_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), - test_generator:check_equal(?B_TREE_04_17_MINUS_02_TILL_12, b_trees:delete("k_12", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), + b_trees_generator:check_equal(?B_TREE_04_17_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_17))), + b_trees_generator:check_equal(?B_TREE_04_17_MINUS_02_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), + b_trees_generator:check_equal(?B_TREE_04_17_MINUS_02_TILL_12, b_trees:delete("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), - test_generator:check_equal(?B_TREE_04_20_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_10, b_trees:delete("k_10", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_12, b_trees:delete("k_12", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_14, b_trees:delete("k_14", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_16, b_trees:delete("k_16", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_18, b_trees:delete("k_18", test_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_10, b_trees:delete("k_10", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_12, b_trees:delete("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_14, b_trees:delete("k_14", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_16, b_trees:delete("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_18, b_trees:delete("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_18, b_trees:delete("k_18", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_20, b_trees:delete("k_20", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_22, b_trees:delete("k_22", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_30, b_trees:delete("k_30", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_18, b_trees:delete("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_20, b_trees:delete("k_20", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_22, b_trees:delete("k_22", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_30, b_trees:delete("k_30", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), - test_generator:check_equal(?B_TREE_04_64_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_04_64))), - test_generator:check_equal(?B_TREE_04_64_MINUS_16, b_trees:delete("k_16", test_generator:prepare_template_asc(?B_TREE_04_64))), - test_generator:check_equal(?B_TREE_04_64_MINUS_32, b_trees:delete("k_32", test_generator:prepare_template_asc(?B_TREE_04_64))), + b_trees_generator:check_equal(?B_TREE_04_64_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + b_trees_generator:check_equal(?B_TREE_04_64_MINUS_16, b_trees:delete("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + b_trees_generator:check_equal(?B_TREE_04_64_MINUS_32, b_trees:delete("k_32", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), ok. @@ -210,46 +210,46 @@ delete_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_6_test(_Config) -> - test_generator:check_equal(?B_TREE_06_00, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - - test_generator:check_equal(?B_TREE_06_06_MINUS_01, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_03, b_trees:delete("k_03", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_05, b_trees:delete("k_05", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_06_06))), - - test_generator:check_equal(?B_TREE_06_09_MINUS_01, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_03, b_trees:delete("k_03", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_05, b_trees:delete("k_05", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_07, b_trees:delete("k_07", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_09, b_trees:delete("k_09", test_generator:prepare_template_asc(?B_TREE_06_09))), - - test_generator:check_equal(?B_TREE_06_10_MINUS_01, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_03, b_trees:delete("k_03", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_05, b_trees:delete("k_05", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_07, b_trees:delete("k_07", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_09, b_trees:delete("k_09", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_10, b_trees:delete("k_10", test_generator:prepare_template_asc(?B_TREE_06_10))), - - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 1, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 5, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 8, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 11, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 14, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 17, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 20, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_till(6, 100, 4)), - - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 32, 2, test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_01, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_03, b_trees:delete("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_05, b_trees:delete("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_01, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_03, b_trees:delete("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_05, b_trees:delete("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_07, b_trees:delete("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_09, b_trees:delete("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_01, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_03, b_trees:delete("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_05, b_trees:delete("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_07, b_trees:delete("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_09, b_trees:delete("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_10, b_trees:delete("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 1, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 5, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 8, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 11, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 14, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 17, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 20, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_till(6, 100, 4)), + + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 32, 2, b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -258,7 +258,7 @@ delete_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -312,46 +312,46 @@ delete_b_tree_persistence_by_ets_test(_Config) -> delete_clrs_test(_Config) -> % case 1 - _B_TREE_CLRS_500_MINUS_F = b_trees:delete("k_f", test_generator:prepare_template_asc(?B_TREE_CLRS_500)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F, _B_TREE_CLRS_500_MINUS_F), + _B_TREE_CLRS_500_MINUS_F = b_trees:delete("k_f", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F, _B_TREE_CLRS_500_MINUS_F), % case 2a - _B_TREE_CLRS_500_MINUS_F_M = b_trees:delete("k_m", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M, _B_TREE_CLRS_500_MINUS_F_M), + _B_TREE_CLRS_500_MINUS_F_M = b_trees:delete("k_m", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M, _B_TREE_CLRS_500_MINUS_F_M), % case 2b - _B_TREE_CLRS_500_MINUS_F_L = b_trees:delete("k_l", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_2)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_L, _B_TREE_CLRS_500_MINUS_F_L), + _B_TREE_CLRS_500_MINUS_F_L = b_trees:delete("k_l", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_2)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_L, _B_TREE_CLRS_500_MINUS_F_L), % case 2c - _B_TREE_CLRS_500_MINUS_F_M_G = b_trees:delete("k_g", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G, _B_TREE_CLRS_500_MINUS_F_M_G), + _B_TREE_CLRS_500_MINUS_F_M_G = b_trees:delete("k_g", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G, _B_TREE_CLRS_500_MINUS_F_M_G), % case 3a - delete left - _B_TREE_CLRS_500_MINUS_F_M_G_D_A = b_trees:delete("k_a", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_A, _B_TREE_CLRS_500_MINUS_F_M_G_D_A), - _B_TREE_CLRS_500_MINUS_F_M_G_D_B = b_trees:delete("k_b", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_B, _B_TREE_CLRS_500_MINUS_F_M_G_D_B), - _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E = b_trees:delete("k_e", test_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_E, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E), - _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J = b_trees:delete("k_j", test_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_J, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J), - _B_TREE_CLRS_500_MINUS_F_M_G_D_N = b_trees:delete("k_n", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_N, _B_TREE_CLRS_500_MINUS_F_M_G_D_N), - _B_TREE_CLRS_500_MINUS_F_M_G_D_O = b_trees:delete("k_o", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_O, _B_TREE_CLRS_500_MINUS_F_M_G_D_O), + _B_TREE_CLRS_500_MINUS_F_M_G_D_A = b_trees:delete("k_a", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_A, _B_TREE_CLRS_500_MINUS_F_M_G_D_A), + _B_TREE_CLRS_500_MINUS_F_M_G_D_B = b_trees:delete("k_b", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_B, _B_TREE_CLRS_500_MINUS_F_M_G_D_B), + _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E = b_trees:delete("k_e", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_E, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E), + _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J = b_trees:delete("k_j", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_J, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J), + _B_TREE_CLRS_500_MINUS_F_M_G_D_N = b_trees:delete("k_n", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_N, _B_TREE_CLRS_500_MINUS_F_M_G_D_N), + _B_TREE_CLRS_500_MINUS_F_M_G_D_O = b_trees:delete("k_o", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_O, _B_TREE_CLRS_500_MINUS_F_M_G_D_O), % case 3a delete right - _B_TREE_CLRS_500_MINUS_F_M_G_D_U = b_trees:delete("k_u", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_U, _B_TREE_CLRS_500_MINUS_F_M_G_D_U), - _B_TREE_CLRS_500_MINUS_F_M_G_D_V = b_trees:delete("k_v", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_V, _B_TREE_CLRS_500_MINUS_F_M_G_D_V), + _B_TREE_CLRS_500_MINUS_F_M_G_D_U = b_trees:delete("k_u", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_U, _B_TREE_CLRS_500_MINUS_F_M_G_D_U), + _B_TREE_CLRS_500_MINUS_F_M_G_D_V = b_trees:delete("k_v", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_V, _B_TREE_CLRS_500_MINUS_F_M_G_D_V), % case 3b - _B_TREE_CLRS_500_MINUS_F_M_G_D = b_trees:delete("k_d", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D, _B_TREE_CLRS_500_MINUS_F_M_G_D), - _B_TREE_CLRS_500_MINUS_F_M_G_U = b_trees:delete("k_u", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_U, _B_TREE_CLRS_500_MINUS_F_M_G_U), + _B_TREE_CLRS_500_MINUS_F_M_G_D = b_trees:delete("k_d", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D, _B_TREE_CLRS_500_MINUS_F_M_G_D), + _B_TREE_CLRS_500_MINUS_F_M_G_U = b_trees:delete("k_u", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_U, _B_TREE_CLRS_500_MINUS_F_M_G_U), ok. @@ -360,11 +360,11 @@ delete_clrs_test(_Config) -> %%-------------------------------------------------------------------- delete_error_test(_Config) -> - ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertException(error, {key_not_found, "k_10"}, b_trees:delete("k_10", test_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertException(error, {key_not_found, "k_10"}, b_trees:delete("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), ok. @@ -373,15 +373,15 @@ delete_error_test(_Config) -> %%-------------------------------------------------------------------- empty_b_tree_test(_Config) -> - test_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), ?assert(b_trees:is_empty(b_trees:empty(4))), ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(4))), - test_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), ?assert(b_trees:is_empty(b_trees:empty(6))), ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(6))), - test_generator:check_equal(?B_TREE_32_00, b_trees:empty(32)), + b_trees_generator:check_equal(?B_TREE_32_00, b_trees:empty(32)), ?assert(b_trees:is_empty(b_trees:empty(32))), ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(32))), @@ -392,7 +392,7 @@ empty_b_tree_test(_Config) -> %%-------------------------------------------------------------------- enter_b_tree_order_4_test(_Config) -> - BTree_04_15_01 = b_trees:enter("k_01", "v_01", test_generator:prepare_template_asc(?B_TREE_04_00)), + BTree_04_15_01 = b_trees:enter("k_01", "v_01", b_trees_generator:prepare_template_asc(?B_TREE_04_00)), BTree_04_15_02 = b_trees:enter("k_02", "v_02", BTree_04_15_01), BTree_04_15_03 = b_trees:enter("k_03", "v_03", BTree_04_15_02), BTree_04_15_04 = b_trees:enter("k_04", "v_04", BTree_04_15_03), @@ -407,7 +407,7 @@ enter_b_tree_order_4_test(_Config) -> BTree_04_15_13 = b_trees:enter("k_13", "v_13", BTree_04_15_12), BTree_04_15_14 = b_trees:enter("k_14", "v_14", BTree_04_15_13), BTree_04_15_15 = b_trees:enter("k_15", "v_15", BTree_04_15_14), - test_generator:check_equal(?B_TREE_04_15, BTree_04_15_15), + b_trees_generator:check_equal(?B_TREE_04_15, BTree_04_15_15), BTree_04_15_01_NEW = b_trees:enter("k_01", "v_01_new", BTree_04_15_15), BTree_04_15_02_NEW = b_trees:enter("k_02", "v_02_new", BTree_04_15_01_NEW), @@ -423,7 +423,7 @@ enter_b_tree_order_4_test(_Config) -> BTree_04_15_12_NEW = b_trees:enter("k_12", "v_12_new", BTree_04_15_11_NEW), BTree_04_15_13_NEW = b_trees:enter("k_13", "v_13_new", BTree_04_15_12_NEW), BTree_04_15_14_NEW = b_trees:enter("k_14", "v_14_new", BTree_04_15_13_NEW), - test_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:enter("k_15", "v_15_new", BTree_04_15_14_NEW)), + b_trees_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:enter("k_15", "v_15_new", BTree_04_15_14_NEW)), ok. @@ -432,7 +432,7 @@ enter_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- enter_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_30 = test_generator:generate_b_tree_from_number_ets(4, 30, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_30 = b_trees_generator:generate_b_tree_from_number_ets(4, 30, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), B_TREE_04_32_31 = b_trees:enter("k_31", "v_31", B_TREE_04_32_30), B_TREE_04_32_32 = b_trees:enter("k_32", "v_32", B_TREE_04_32_31), @@ -476,7 +476,7 @@ enter_persistence_by_ets_test(_Config) -> B_TREE_04_32_MAPPED_VALUES = b_trees:to_list(B_TREE_04_32_32_NEW), - ?assertEqual(B_TREE_04_32_MAPPED_VALUES, test_generator:generate_key_values_from_update(32, 2)), + ?assertEqual(B_TREE_04_32_MAPPED_VALUES, b_trees_generator:generate_key_values_from_update(32, 2)), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_04_32_32_NEW), @@ -491,15 +491,15 @@ enter_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- from_dict_b_tree_test(_Config) -> - ?assertException(error, {tree_not_empty, _}, b_trees:from_dict(?B_TREE_04_04, test_generator:generate_key_values_from(4, 2))), + ?assertException(error, {tree_not_empty, _}, b_trees:from_dict(?B_TREE_04_04, b_trees_generator:generate_key_values_from(4, 2))), - test_generator:check_equal(?B_TREE_04_04, b_trees:from_dict(b_trees:empty(4), test_generator:generate_key_values_from(4, 2))), - test_generator:check_equal(?B_TREE_06_01, b_trees:from_dict(b_trees:empty(6), test_generator:generate_key_values_from(1, 2))), - test_generator:check_equal(?B_TREE_06_29, b_trees:from_dict(b_trees:empty(6), test_generator:generate_key_values_from(29, 2))), - test_generator:check_equal(?B_TREE_18_19, b_trees:from_dict(b_trees:empty(18), test_generator:generate_key_values_from(19, 2))), + b_trees_generator:check_equal(?B_TREE_04_04, b_trees:from_dict(b_trees:empty(4), b_trees_generator:generate_key_values_from(4, 2))), + b_trees_generator:check_equal(?B_TREE_06_01, b_trees:from_dict(b_trees:empty(6), b_trees_generator:generate_key_values_from(1, 2))), + b_trees_generator:check_equal(?B_TREE_06_29, b_trees:from_dict(b_trees:empty(6), b_trees_generator:generate_key_values_from(29, 2))), + b_trees_generator:check_equal(?B_TREE_18_19, b_trees:from_dict(b_trees:empty(18), b_trees_generator:generate_key_values_from(19, 2))), B_TREE_06_32_00 = b_trees:set_parameter(b_trees:empty(6), sort, fun b_trees:sort_descending/2), - test_generator:check_equal(?B_TREE_06_32_DESC, b_trees:from_dict(B_TREE_06_32_00, test_generator:generate_key_values_from(32, 2))), + b_trees_generator:check_equal(?B_TREE_06_32_DESC, b_trees:from_dict(B_TREE_06_32_00, b_trees_generator:generate_key_values_from(32, 2))), ok. @@ -510,9 +510,9 @@ from_dict_b_tree_test(_Config) -> from_dict_persistence_by_ets_test(_Config) -> StateTarget = ets:new(b_trees, []), - B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), - B_TREE_06_32 = b_trees:from_dict(B_TREE_06_00, test_generator:generate_key_values_from(32, 2)), + B_TREE_06_32 = b_trees:from_dict(B_TREE_06_00, b_trees_generator:generate_key_values_from(32, 2)), ?assertEqual(32, b_trees:size_key_values(B_TREE_06_32)), @@ -528,7 +528,7 @@ from_dict_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- get_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -576,129 +576,129 @@ get_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- get_test(_Config) -> - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_04_00))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertException(error, {key_not_found, "k_05"}, b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_04_04))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertException(error, {key_not_found, "k_08"}, b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_06_07))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertException(error, {key_not_found, "k_11"}, b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_10_10))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertException(error, {key_not_found, "k_14"}, b_trees:get("k_14", test_generator:prepare_template_asc(?B_TREE_12_13))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_14", b_trees:get("k_14", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_15", b_trees:get("k_15", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_16", b_trees:get("k_16", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertException(error, {key_not_found, "k_17"}, b_trees:get("k_17", test_generator:prepare_template_asc(?B_TREE_16_16))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_14", b_trees:get("k_14", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_15", b_trees:get("k_15", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_16", b_trees:get("k_16", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_17", b_trees:get("k_17", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_18", b_trees:get("k_18", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_19", b_trees:get("k_19", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertException(error, {key_not_found, "k_20"}, b_trees:get("k_20", test_generator:prepare_template_asc(?B_TREE_18_19))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_14", b_trees:get("k_14", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_15", b_trees:get("k_15", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_16", b_trees:get("k_16", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_17", b_trees:get("k_17", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_18", b_trees:get("k_18", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_19", b_trees:get("k_19", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_20", b_trees:get("k_20", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_21", b_trees:get("k_21", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_22", b_trees:get("k_22", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_23", b_trees:get("k_23", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_24", b_trees:get("k_24", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_25", b_trees:get("k_25", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_26", b_trees:get("k_26", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_27", b_trees:get("k_27", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_28", b_trees:get("k_28", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_29", b_trees:get("k_29", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_30", b_trees:get("k_30", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_31", b_trees:get("k_31", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_32", b_trees:get("k_32", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertException(error, {key_not_found, "k_33"}, b_trees:get("k_33", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_00))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertException(error, {key_not_found, "k_05"}, b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertException(error, {key_not_found, "k_08"}, b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertException(error, {key_not_found, "k_11"}, b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertException(error, {key_not_found, "k_14"}, b_trees:get("k_14", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_14", b_trees:get("k_14", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_15", b_trees:get("k_15", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_16", b_trees:get("k_16", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertException(error, {key_not_found, "k_17"}, b_trees:get("k_17", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_14", b_trees:get("k_14", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_15", b_trees:get("k_15", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_16", b_trees:get("k_16", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_17", b_trees:get("k_17", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_18", b_trees:get("k_18", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_19", b_trees:get("k_19", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertException(error, {key_not_found, "k_20"}, b_trees:get("k_20", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_14", b_trees:get("k_14", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_15", b_trees:get("k_15", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_16", b_trees:get("k_16", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_17", b_trees:get("k_17", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_18", b_trees:get("k_18", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_19", b_trees:get("k_19", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_20", b_trees:get("k_20", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_21", b_trees:get("k_21", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_22", b_trees:get("k_22", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_23", b_trees:get("k_23", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_24", b_trees:get("k_24", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_25", b_trees:get("k_25", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_26", b_trees:get("k_26", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_27", b_trees:get("k_27", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_28", b_trees:get("k_28", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_29", b_trees:get("k_29", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_30", b_trees:get("k_30", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_31", b_trees:get("k_31", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_32", b_trees:get("k_32", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertException(error, {key_not_found, "k_33"}, b_trees:get("k_33", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -707,11 +707,11 @@ get_test(_Config) -> %%-------------------------------------------------------------------- height_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_desc(B_TREE_06_32))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_desc(B_TREE_06_32))), true = ets:delete(StateTarget), @@ -722,13 +722,13 @@ height_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- height_test(_Config) -> - ?assertException(error, {empty_tree, _}, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -737,29 +737,29 @@ height_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_4_test(_Config) -> - test_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), - test_generator:check_equal(?B_TREE_04_01, test_generator:generate_b_tree_from_number(4, 1, 2)), - test_generator:check_equal(?B_TREE_04_02, test_generator:generate_b_tree_from_number(4, 2, 2)), - test_generator:check_equal(?B_TREE_04_03, test_generator:generate_b_tree_from_number(4, 3, 2)), - test_generator:check_equal(?B_TREE_04_04, test_generator:generate_b_tree_from_number(4, 4, 2)), - test_generator:check_equal(?B_TREE_04_05, test_generator:generate_b_tree_from_number(4, 5, 2)), - test_generator:check_equal(?B_TREE_04_06, test_generator:generate_b_tree_from_number(4, 6, 2)), - test_generator:check_equal(?B_TREE_04_07, test_generator:generate_b_tree_from_number(4, 7, 2)), - test_generator:check_equal(?B_TREE_04_08, test_generator:generate_b_tree_from_number(4, 8, 2)), - test_generator:check_equal(?B_TREE_04_09, test_generator:generate_b_tree_from_number(4, 9, 2)), - test_generator:check_equal(?B_TREE_04_10, test_generator:generate_b_tree_from_number(4, 10, 2)), + b_trees_generator:check_equal(?B_TREE_04_01, b_trees_generator:generate_b_tree_from_number(4, 1, 2)), + b_trees_generator:check_equal(?B_TREE_04_02, b_trees_generator:generate_b_tree_from_number(4, 2, 2)), + b_trees_generator:check_equal(?B_TREE_04_03, b_trees_generator:generate_b_tree_from_number(4, 3, 2)), + b_trees_generator:check_equal(?B_TREE_04_04, b_trees_generator:generate_b_tree_from_number(4, 4, 2)), + b_trees_generator:check_equal(?B_TREE_04_05, b_trees_generator:generate_b_tree_from_number(4, 5, 2)), + b_trees_generator:check_equal(?B_TREE_04_06, b_trees_generator:generate_b_tree_from_number(4, 6, 2)), + b_trees_generator:check_equal(?B_TREE_04_07, b_trees_generator:generate_b_tree_from_number(4, 7, 2)), + b_trees_generator:check_equal(?B_TREE_04_08, b_trees_generator:generate_b_tree_from_number(4, 8, 2)), + b_trees_generator:check_equal(?B_TREE_04_09, b_trees_generator:generate_b_tree_from_number(4, 9, 2)), + b_trees_generator:check_equal(?B_TREE_04_10, b_trees_generator:generate_b_tree_from_number(4, 10, 2)), - test_generator:check_equal(?B_TREE_04_11, test_generator:generate_b_tree_from_number(4, 11, 2)), - test_generator:check_equal(?B_TREE_04_12, test_generator:generate_b_tree_from_number(4, 12, 2)), - test_generator:check_equal(?B_TREE_04_13, test_generator:generate_b_tree_from_number(4, 13, 2)), - test_generator:check_equal(?B_TREE_04_14, test_generator:generate_b_tree_from_number(4, 14, 2)), - test_generator:check_equal(?B_TREE_04_15, test_generator:generate_b_tree_from_number(4, 15, 2)), - test_generator:check_equal(?B_TREE_04_16, test_generator:generate_b_tree_from_number(4, 16, 2)), - test_generator:check_equal(?B_TREE_04_17, test_generator:generate_b_tree_from_number(4, 17, 2)), - test_generator:check_equal(?B_TREE_04_18, test_generator:generate_b_tree_from_number(4, 18, 2)), - test_generator:check_equal(?B_TREE_04_19, test_generator:generate_b_tree_from_number(4, 19, 2)), - test_generator:check_equal(?B_TREE_04_20, test_generator:generate_b_tree_from_number(4, 20, 2)), + b_trees_generator:check_equal(?B_TREE_04_11, b_trees_generator:generate_b_tree_from_number(4, 11, 2)), + b_trees_generator:check_equal(?B_TREE_04_12, b_trees_generator:generate_b_tree_from_number(4, 12, 2)), + b_trees_generator:check_equal(?B_TREE_04_13, b_trees_generator:generate_b_tree_from_number(4, 13, 2)), + b_trees_generator:check_equal(?B_TREE_04_14, b_trees_generator:generate_b_tree_from_number(4, 14, 2)), + b_trees_generator:check_equal(?B_TREE_04_15, b_trees_generator:generate_b_tree_from_number(4, 15, 2)), + b_trees_generator:check_equal(?B_TREE_04_16, b_trees_generator:generate_b_tree_from_number(4, 16, 2)), + b_trees_generator:check_equal(?B_TREE_04_17, b_trees_generator:generate_b_tree_from_number(4, 17, 2)), + b_trees_generator:check_equal(?B_TREE_04_18, b_trees_generator:generate_b_tree_from_number(4, 18, 2)), + b_trees_generator:check_equal(?B_TREE_04_19, b_trees_generator:generate_b_tree_from_number(4, 19, 2)), + b_trees_generator:check_equal(?B_TREE_04_20, b_trees_generator:generate_b_tree_from_number(4, 20, 2)), ok. @@ -768,75 +768,75 @@ insert_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_6_test(_Config) -> - test_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), - ?assertEqual(0, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {empty_tree, _}, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({0, 0}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_00))), - - test_generator:check_equal(?B_TREE_06_01, b_trees:insert("k_01", "v_01", test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(1, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_01))), - - test_generator:check_equal(?B_TREE_06_02, b_trees:insert("k_02", "v_02", test_generator:generate_b_tree_from_number(6, 1, 2))), - ?assertEqual(2, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_02))), - - test_generator:check_equal(?B_TREE_06_03, b_trees:insert("k_03", "v_03", test_generator:generate_b_tree_from_number(6, 2, 2))), - ?assertEqual(3, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_03))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_03))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_03))), - - test_generator:check_equal(?B_TREE_06_04, b_trees:insert("k_04", "v_04", test_generator:generate_b_tree_from_number(6, 3, 2))), - ?assertEqual(4, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_04))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_04))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_04))), - - test_generator:check_equal(?B_TREE_06_05, b_trees:insert("k_05", "v_05", test_generator:generate_b_tree_from_number(6, 4, 2))), - ?assertEqual(5, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_05))), - - test_generator:check_equal(?B_TREE_06_09, b_trees:insert("k_09", "v_09", test_generator:generate_b_tree_from_number(6, 8, 2))), - ?assertEqual(9, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({4, 3}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_09))), - - test_generator:check_equal(?B_TREE_06_13, b_trees:insert("k_13", "v_13", test_generator:generate_b_tree_from_number(6, 12, 2))), - ?assertEqual(13, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_13))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_13))), - ?assertEqual({5, 4}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_13))), - - test_generator:check_equal(?B_TREE_06_17, b_trees:insert("k_17", "v_17", test_generator:generate_b_tree_from_number(6, 16, 2))), - ?assertEqual(17, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_17))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_17))), - ?assertEqual({6, 5}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_17))), - - test_generator:check_equal(?B_TREE_06_21, b_trees:insert("k_21", "v_21", test_generator:generate_b_tree_from_number(6, 20, 2))), - ?assertEqual(21, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual({10, 7}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_21))), - - test_generator:check_equal(?B_TREE_06_25, b_trees:insert("k_25", "v_25", test_generator:generate_b_tree_from_number(6, 24, 2))), - ?assertEqual(25, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_25))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_25))), - ?assertEqual({11, 8}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_25))), - - test_generator:check_equal(?B_TREE_06_29, b_trees:insert("k_29", "v_29", test_generator:generate_b_tree_from_number(6, 28, 2))), - ?assertEqual(29, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertEqual({13, 9}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_29))), - - test_generator:check_equal(?B_TREE_06_30, b_trees:insert("k_30", "v_30", test_generator:generate_b_tree_from_number(6, 29, 2))), - ?assertEqual(30, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_30))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_30))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_30))), - - test_generator:check_equal(?B_TREE_06_32_DESC, b_trees:insert("k_32", "v_32", test_generator:generate_b_tree_from_number(6, 31, 2, fun b_trees:sort_descending/2))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), + ?assertEqual(0, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual({0, 0}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + + b_trees_generator:check_equal(?B_TREE_06_01, b_trees:insert("k_01", "v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual(1, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + + b_trees_generator:check_equal(?B_TREE_06_02, b_trees:insert("k_02", "v_02", b_trees_generator:generate_b_tree_from_number(6, 1, 2))), + ?assertEqual(2, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + + b_trees_generator:check_equal(?B_TREE_06_03, b_trees:insert("k_03", "v_03", b_trees_generator:generate_b_tree_from_number(6, 2, 2))), + ?assertEqual(3, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + + b_trees_generator:check_equal(?B_TREE_06_04, b_trees:insert("k_04", "v_04", b_trees_generator:generate_b_tree_from_number(6, 3, 2))), + ?assertEqual(4, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + + b_trees_generator:check_equal(?B_TREE_06_05, b_trees:insert("k_05", "v_05", b_trees_generator:generate_b_tree_from_number(6, 4, 2))), + ?assertEqual(5, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + + b_trees_generator:check_equal(?B_TREE_06_09, b_trees:insert("k_09", "v_09", b_trees_generator:generate_b_tree_from_number(6, 8, 2))), + ?assertEqual(9, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({4, 3}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + + b_trees_generator:check_equal(?B_TREE_06_13, b_trees:insert("k_13", "v_13", b_trees_generator:generate_b_tree_from_number(6, 12, 2))), + ?assertEqual(13, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + ?assertEqual({5, 4}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + + b_trees_generator:check_equal(?B_TREE_06_17, b_trees:insert("k_17", "v_17", b_trees_generator:generate_b_tree_from_number(6, 16, 2))), + ?assertEqual(17, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_17))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_17))), + ?assertEqual({6, 5}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_17))), + + b_trees_generator:check_equal(?B_TREE_06_21, b_trees:insert("k_21", "v_21", b_trees_generator:generate_b_tree_from_number(6, 20, 2))), + ?assertEqual(21, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual({10, 7}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), + + b_trees_generator:check_equal(?B_TREE_06_25, b_trees:insert("k_25", "v_25", b_trees_generator:generate_b_tree_from_number(6, 24, 2))), + ?assertEqual(25, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_25))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_25))), + ?assertEqual({11, 8}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_25))), + + b_trees_generator:check_equal(?B_TREE_06_29, b_trees:insert("k_29", "v_29", b_trees_generator:generate_b_tree_from_number(6, 28, 2))), + ?assertEqual(29, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertEqual({13, 9}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + + b_trees_generator:check_equal(?B_TREE_06_30, b_trees:insert("k_30", "v_30", b_trees_generator:generate_b_tree_from_number(6, 29, 2))), + ?assertEqual(30, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_30))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_30))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_30))), + + b_trees_generator:check_equal(?B_TREE_06_32_DESC, b_trees:insert("k_32", "v_32", b_trees_generator:generate_b_tree_from_number(6, 31, 2, fun b_trees:sort_descending/2))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -845,30 +845,30 @@ insert_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_8_test(_Config) -> - test_generator:check_equal(?B_TREE_08_00, b_trees:empty(8)), - ?assertEqual(0, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_00))), - ?assertException(error, {empty_tree, _}, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_00))), - ?assertEqual({0, 0}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_00))), + b_trees_generator:check_equal(?B_TREE_08_00, b_trees:empty(8)), + ?assertEqual(0, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_00))), + ?assertException(error, {empty_tree, _}, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_00))), + ?assertEqual({0, 0}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_00))), - test_generator:check_equal(?B_TREE_06_07, b_trees:insert("k_07", "v_07", test_generator:generate_b_tree_from_number(6, 6, 2))), - ?assertEqual(7, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({3, 2}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_07))), + b_trees_generator:check_equal(?B_TREE_06_07, b_trees:insert("k_07", "v_07", b_trees_generator:generate_b_tree_from_number(6, 6, 2))), + ?assertEqual(7, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({3, 2}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_07))), - test_generator:check_equal(?B_TREE_08_16, b_trees:insert("k_16", "v_16", test_generator:generate_b_tree_from_number(8, 15, 2))), - ?assertEqual(16, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_16))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_16))), - ?assertEqual({5, 4}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_16))), + b_trees_generator:check_equal(?B_TREE_08_16, b_trees:insert("k_16", "v_16", b_trees_generator:generate_b_tree_from_number(8, 15, 2))), + ?assertEqual(16, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_16))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_16))), + ?assertEqual({5, 4}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_16))), - test_generator:check_equal(?B_TREE_08_32, b_trees:insert("k_32", "v_32", test_generator:generate_b_tree_from_number(8, 31, 2))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_32))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_32))), - ?assertEqual({9, 8}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_32))), + b_trees_generator:check_equal(?B_TREE_08_32, b_trees:insert("k_32", "v_32", b_trees_generator:generate_b_tree_from_number(8, 31, 2))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_32))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_32))), + ?assertEqual({9, 8}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_32))), - test_generator:check_equal(?B_TREE_08_64, b_trees:insert("k_64", "v_64", test_generator:generate_b_tree_from_number(8, 63, 2))), - ?assertEqual(64, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_64))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_64))), - ?assertEqual({20, 16}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_64))), + b_trees_generator:check_equal(?B_TREE_08_64, b_trees:insert("k_64", "v_64", b_trees_generator:generate_b_tree_from_number(8, 63, 2))), + ?assertEqual(64, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertEqual({20, 16}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_64))), ok. @@ -879,7 +879,7 @@ insert_b_tree_order_8_test(_Config) -> insert_b_tree_persistence_by_ets_test(_Config) -> StateTarget = ets:new(b_trees, []), - B_TREE_04_00 = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_04_00 = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), B_TREE_04_01 = b_trees:insert("k_01", "v_01", B_TREE_04_00), B_TREE_04_02 = b_trees:insert("k_02", "v_02", B_TREE_04_01), @@ -920,7 +920,7 @@ insert_b_tree_persistence_by_ets_test(_Config) -> true = ets:delete_all_objects(StateTarget), - test_generator:generate_b_tree_from_number_ets(4, 99, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + b_trees_generator:generate_b_tree_from_number_ets(4, 99, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), true = ets:delete(StateTarget), @@ -932,17 +932,17 @@ insert_b_tree_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- insert_clrs_test(_Config) -> - _B_TREE_CLRS_498_PLUS_B = b_trees:insert("k_b", "v_b", test_generator:prepare_template_asc(?B_TREE_CLRS_498)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B, _B_TREE_CLRS_498_PLUS_B), + _B_TREE_CLRS_498_PLUS_B = b_trees:insert("k_b", "v_b", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B, _B_TREE_CLRS_498_PLUS_B), - _B_TREE_CLRS_498_PLUS_B_Q = b_trees:insert("k_q", "v_q", test_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q, _B_TREE_CLRS_498_PLUS_B_Q), + _B_TREE_CLRS_498_PLUS_B_Q = b_trees:insert("k_q", "v_q", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q, _B_TREE_CLRS_498_PLUS_B_Q), - _B_TREE_CLRS_498_PLUS_B_Q_L = b_trees:insert("k_l", "v_l", test_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L, _B_TREE_CLRS_498_PLUS_B_Q_L), + _B_TREE_CLRS_498_PLUS_B_Q_L = b_trees:insert("k_l", "v_l", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L, _B_TREE_CLRS_498_PLUS_B_Q_L), - _B_TREE_CLRS_498_PLUS_B_Q_L_F = b_trees:insert("k_f", "v_f", test_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q_L)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L_F, _B_TREE_CLRS_498_PLUS_B_Q_L_F), + _B_TREE_CLRS_498_PLUS_B_Q_L_F = b_trees:insert("k_f", "v_f", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q_L)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L_F, _B_TREE_CLRS_498_PLUS_B_Q_L_F), ok. @@ -951,11 +951,11 @@ insert_clrs_test(_Config) -> %%-------------------------------------------------------------------- insert_error_test(_Config) -> - ?assertException(error, {key_exists, "k_01"}, b_trees:insert("k_01", "v_01", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_02"}, b_trees:insert("k_02", "v_02", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_03"}, b_trees:insert("k_03", "v_03", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_04"}, b_trees:insert("k_04", "v_04", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_05"}, b_trees:insert("k_05", "v_05", test_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_01"}, b_trees:insert("k_01", "v_01", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_02"}, b_trees:insert("k_02", "v_02", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_03"}, b_trees:insert("k_03", "v_03", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_04"}, b_trees:insert("k_04", "v_04", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_05"}, b_trees:insert("k_05", "v_05", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), ok. @@ -964,7 +964,7 @@ insert_error_test(_Config) -> %%-------------------------------------------------------------------- is_defined_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -1012,129 +1012,129 @@ is_defined_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- is_defined_test(_Config) -> - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_04_00))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertNot(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_04_04))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertNot(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_06_07))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertNot(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_10_10))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertNot(b_trees:is_defined("k_14", test_generator:prepare_template_asc(?B_TREE_12_13))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_14", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_15", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_16", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertNot(b_trees:is_defined("k_17", test_generator:prepare_template_asc(?B_TREE_16_16))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_14", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_15", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_16", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_17", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_18", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_19", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertNot(b_trees:is_defined("k_20", test_generator:prepare_template_asc(?B_TREE_18_19))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_14", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_15", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_16", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_17", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_18", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_19", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_20", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_21", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_22", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_23", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_24", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_25", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_26", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_27", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_28", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_29", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_30", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_31", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_32", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertNot(b_trees:is_defined("k_33", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_00))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertNot(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertNot(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertNot(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertNot(b_trees:is_defined("k_14", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_14", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_15", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_16", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertNot(b_trees:is_defined("k_17", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_14", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_15", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_16", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_17", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_18", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_19", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertNot(b_trees:is_defined("k_20", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_14", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_15", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_16", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_17", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_18", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_19", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_20", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_21", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_22", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_23", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_24", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_25", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_26", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_27", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_28", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_29", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_30", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_31", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_32", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertNot(b_trees:is_defined("k_33", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1145,9 +1145,9 @@ is_defined_test(_Config) -> is_empty_persistence_by_ets_test(_Config) -> StateTarget = ets:new(b_trees, []), - B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), - ?assertEqual(true, b_trees:is_empty(test_generator:prepare_template_asc(B_TREE_06_00))), + ?assertEqual(true, b_trees:is_empty(b_trees_generator:prepare_template_asc(B_TREE_06_00))), true = ets:delete(StateTarget), @@ -1158,8 +1158,8 @@ is_empty_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- is_empty_test(_Config) -> - ?assertEqual(false, b_trees:is_empty(test_generator:prepare_template_asc(?B_TREE_32_01))), - ?assertEqual(true, b_trees:is_empty(test_generator:prepare_template_asc(?B_TREE_32_00))), + ?assertEqual(false, b_trees:is_empty(b_trees_generator:prepare_template_asc(?B_TREE_32_01))), + ?assertEqual(true, b_trees:is_empty(b_trees_generator:prepare_template_asc(?B_TREE_32_00))), ok. @@ -1172,13 +1172,13 @@ iterator_from_next_00_test(_Config) -> _Iterator_04_00_00 = b_trees:iterator_from("k_01", BTree_04_00), ?assertEqual(none, b_trees:next(_Iterator_04_00_00)), - BTree_04_01 = test_generator:generate_b_tree_from_number(4, 1, 2), + BTree_04_01 = b_trees_generator:generate_b_tree_from_number(4, 1, 2), Iterator_04_01_00 = b_trees:iterator_from("k_00", BTree_04_01), {_Key_04_01_01, _Value_04_01_01, _Iterator_04_01_01} = b_trees:next(Iterator_04_01_00), ?assertEqual({"k_01", "v_01"}, {_Key_04_01_01, _Value_04_01_01}), ?assertEqual(none, b_trees:next(_Iterator_04_01_01)), - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_01 = b_trees:iterator_from("k_00", BTree_04_16), {_Key_04_16_01, _Value_04_16_01, Iterator_04_16_02} = b_trees:next(Iterator_04_16_01), ?assertEqual({"k_01", "v_01"}, {_Key_04_16_01, _Value_04_16_01}), @@ -1192,7 +1192,7 @@ iterator_from_next_00_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_01_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_01 = b_trees:iterator_from("k_01", BTree_04_16), {_Key_04_16_01, _Value_04_16_01, Iterator_04_16_02} = b_trees:next(Iterator_04_16_01), ?assertEqual({"k_01", "v_01"}, {_Key_04_16_01, _Value_04_16_01}), @@ -1206,7 +1206,7 @@ iterator_from_next_01_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_02_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_02 = b_trees:iterator_from("k_02", BTree_04_16), {_Key_04_16_02, _Value_04_16_02, Iterator_04_16_03} = b_trees:next(Iterator_04_16_02), ?assertEqual({"k_02", "v_02"}, {_Key_04_16_02, _Value_04_16_02}), @@ -1220,7 +1220,7 @@ iterator_from_next_02_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_03_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_03 = b_trees:iterator_from("k_03", BTree_04_16), {_Key_04_16_03, _Value_04_16_03, Iterator_04_16_04} = b_trees:next(Iterator_04_16_03), ?assertEqual({"k_03", "v_03"}, {_Key_04_16_03, _Value_04_16_03}), @@ -1234,7 +1234,7 @@ iterator_from_next_03_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_04_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_04 = b_trees:iterator_from("k_04", BTree_04_16), {_Key_04_16_04, _Value_04_16_04, Iterator_04_16_05} = b_trees:next(Iterator_04_16_04), ?assertEqual({"k_04", "v_04"}, {_Key_04_16_04, _Value_04_16_04}), @@ -1250,25 +1250,25 @@ iterator_from_next_04_test(_Config) -> iterator_from_next_04_16_test(_Config) -> Number = 16, - BTree = test_generator:generate_b_tree_from_number(4, Number, 2), - KeyValues = test_generator:generate_key_values_from(Number, 2), + BTree = b_trees_generator:generate_b_tree_from_number(4, Number, 2), + KeyValues = b_trees_generator:generate_key_values_from(Number, 2), - ?assertEqual(lists:sublist(KeyValues, 1, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_00", BTree), Number - 0, [])), - ?assertEqual(lists:sublist(KeyValues, 2, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 1, [])), - ?assertEqual(lists:sublist(KeyValues, 3, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 2, [])), - ?assertEqual(lists:sublist(KeyValues, 4, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 3, [])), - ?assertEqual(lists:sublist(KeyValues, 5, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 4, [])), - ?assertEqual(lists:sublist(KeyValues, 6, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 5, [])), - ?assertEqual(lists:sublist(KeyValues, 7, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 6, [])), - ?assertEqual(lists:sublist(KeyValues, 8, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 7, [])), - ?assertEqual(lists:sublist(KeyValues, 9, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 8, [])), - ?assertEqual(lists:sublist(KeyValues, 10, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 9, [])), - ?assertEqual(lists:sublist(KeyValues, 11, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 10, [])), - ?assertEqual(lists:sublist(KeyValues, 12, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 11, [])), - ?assertEqual(lists:sublist(KeyValues, 13, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 12, [])), - ?assertEqual(lists:sublist(KeyValues, 14, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 13, [])), - ?assertEqual(lists:sublist(KeyValues, 15, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 14, [])), - ?assertEqual(lists:sublist(KeyValues, 16, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 15, [])), + ?assertEqual(lists:sublist(KeyValues, 1, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_00", BTree), Number - 0, [])), + ?assertEqual(lists:sublist(KeyValues, 2, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 1, [])), + ?assertEqual(lists:sublist(KeyValues, 3, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 2, [])), + ?assertEqual(lists:sublist(KeyValues, 4, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 3, [])), + ?assertEqual(lists:sublist(KeyValues, 5, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 4, [])), + ?assertEqual(lists:sublist(KeyValues, 6, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 5, [])), + ?assertEqual(lists:sublist(KeyValues, 7, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 6, [])), + ?assertEqual(lists:sublist(KeyValues, 8, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 7, [])), + ?assertEqual(lists:sublist(KeyValues, 9, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 8, [])), + ?assertEqual(lists:sublist(KeyValues, 10, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 9, [])), + ?assertEqual(lists:sublist(KeyValues, 11, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 10, [])), + ?assertEqual(lists:sublist(KeyValues, 12, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 11, [])), + ?assertEqual(lists:sublist(KeyValues, 13, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 12, [])), + ?assertEqual(lists:sublist(KeyValues, 14, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 13, [])), + ?assertEqual(lists:sublist(KeyValues, 15, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 14, [])), + ?assertEqual(lists:sublist(KeyValues, 16, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 15, [])), ok. @@ -1277,7 +1277,7 @@ iterator_from_next_04_16_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_06_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_06 = b_trees:iterator_from("k_06", BTree_04_16), {_Key_04_16_06, _Value_04_16_06, Iterator_04_16_07} = b_trees:next(Iterator_04_16_06), ?assertEqual({"k_06", "v_06"}, {_Key_04_16_06, _Value_04_16_06}), @@ -1293,41 +1293,41 @@ iterator_from_next_06_test(_Config) -> iterator_from_next_06_32_test(_Config) -> Number = 32, - BTree = test_generator:generate_b_tree_from_number(6, Number, 2, fun b_trees:sort_descending/2), - KeyValues = test_generator:generate_key_values_till(Number, 2), - - ?assertEqual(lists:sublist(KeyValues, 1, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_33", BTree), Number - 0, [])), - ?assertEqual(lists:sublist(KeyValues, 2, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_31", BTree), Number - 1, [])), - ?assertEqual(lists:sublist(KeyValues, 3, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_30", BTree), Number - 2, [])), - ?assertEqual(lists:sublist(KeyValues, 4, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_29", BTree), Number - 3, [])), - ?assertEqual(lists:sublist(KeyValues, 5, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_28", BTree), Number - 4, [])), - ?assertEqual(lists:sublist(KeyValues, 6, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_27", BTree), Number - 5, [])), - ?assertEqual(lists:sublist(KeyValues, 7, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_26", BTree), Number - 6, [])), - ?assertEqual(lists:sublist(KeyValues, 8, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_25", BTree), Number - 7, [])), - ?assertEqual(lists:sublist(KeyValues, 9, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_24", BTree), Number - 8, [])), - ?assertEqual(lists:sublist(KeyValues, 10, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_23", BTree), Number - 9, [])), - ?assertEqual(lists:sublist(KeyValues, 11, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_22", BTree), Number - 10, [])), - ?assertEqual(lists:sublist(KeyValues, 12, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_21", BTree), Number - 11, [])), - ?assertEqual(lists:sublist(KeyValues, 13, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_20", BTree), Number - 12, [])), - ?assertEqual(lists:sublist(KeyValues, 14, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_19", BTree), Number - 13, [])), - ?assertEqual(lists:sublist(KeyValues, 15, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_18", BTree), Number - 14, [])), - ?assertEqual(lists:sublist(KeyValues, 16, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_17", BTree), Number - 15, [])), - ?assertEqual(lists:sublist(KeyValues, 17, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 16, [])), - ?assertEqual(lists:sublist(KeyValues, 18, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 17, [])), - ?assertEqual(lists:sublist(KeyValues, 19, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 18, [])), - ?assertEqual(lists:sublist(KeyValues, 20, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 19, [])), - ?assertEqual(lists:sublist(KeyValues, 21, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 20, [])), - ?assertEqual(lists:sublist(KeyValues, 22, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 21, [])), - ?assertEqual(lists:sublist(KeyValues, 23, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 22, [])), - ?assertEqual(lists:sublist(KeyValues, 24, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 23, [])), - ?assertEqual(lists:sublist(KeyValues, 25, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 24, [])), - ?assertEqual(lists:sublist(KeyValues, 26, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 25, [])), - ?assertEqual(lists:sublist(KeyValues, 27, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 26, [])), - ?assertEqual(lists:sublist(KeyValues, 28, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 27, [])), - ?assertEqual(lists:sublist(KeyValues, 29, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 28, [])), - ?assertEqual(lists:sublist(KeyValues, 30, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 29, [])), - ?assertEqual(lists:sublist(KeyValues, 31, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 30, [])), - ?assertEqual(lists:sublist(KeyValues, 32, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_01", BTree), Number - 31, [])), + BTree = b_trees_generator:generate_b_tree_from_number(6, Number, 2, fun b_trees:sort_descending/2), + KeyValues = b_trees_generator:generate_key_values_till(Number, 2), + + ?assertEqual(lists:sublist(KeyValues, 1, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_33", BTree), Number - 0, [])), + ?assertEqual(lists:sublist(KeyValues, 2, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_31", BTree), Number - 1, [])), + ?assertEqual(lists:sublist(KeyValues, 3, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_30", BTree), Number - 2, [])), + ?assertEqual(lists:sublist(KeyValues, 4, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_29", BTree), Number - 3, [])), + ?assertEqual(lists:sublist(KeyValues, 5, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_28", BTree), Number - 4, [])), + ?assertEqual(lists:sublist(KeyValues, 6, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_27", BTree), Number - 5, [])), + ?assertEqual(lists:sublist(KeyValues, 7, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_26", BTree), Number - 6, [])), + ?assertEqual(lists:sublist(KeyValues, 8, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_25", BTree), Number - 7, [])), + ?assertEqual(lists:sublist(KeyValues, 9, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_24", BTree), Number - 8, [])), + ?assertEqual(lists:sublist(KeyValues, 10, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_23", BTree), Number - 9, [])), + ?assertEqual(lists:sublist(KeyValues, 11, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_22", BTree), Number - 10, [])), + ?assertEqual(lists:sublist(KeyValues, 12, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_21", BTree), Number - 11, [])), + ?assertEqual(lists:sublist(KeyValues, 13, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_20", BTree), Number - 12, [])), + ?assertEqual(lists:sublist(KeyValues, 14, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_19", BTree), Number - 13, [])), + ?assertEqual(lists:sublist(KeyValues, 15, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_18", BTree), Number - 14, [])), + ?assertEqual(lists:sublist(KeyValues, 16, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_17", BTree), Number - 15, [])), + ?assertEqual(lists:sublist(KeyValues, 17, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 16, [])), + ?assertEqual(lists:sublist(KeyValues, 18, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 17, [])), + ?assertEqual(lists:sublist(KeyValues, 19, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 18, [])), + ?assertEqual(lists:sublist(KeyValues, 20, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 19, [])), + ?assertEqual(lists:sublist(KeyValues, 21, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 20, [])), + ?assertEqual(lists:sublist(KeyValues, 22, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 21, [])), + ?assertEqual(lists:sublist(KeyValues, 23, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 22, [])), + ?assertEqual(lists:sublist(KeyValues, 24, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 23, [])), + ?assertEqual(lists:sublist(KeyValues, 25, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 24, [])), + ?assertEqual(lists:sublist(KeyValues, 26, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 25, [])), + ?assertEqual(lists:sublist(KeyValues, 27, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 26, [])), + ?assertEqual(lists:sublist(KeyValues, 28, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 27, [])), + ?assertEqual(lists:sublist(KeyValues, 29, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 28, [])), + ?assertEqual(lists:sublist(KeyValues, 30, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 29, [])), + ?assertEqual(lists:sublist(KeyValues, 31, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 30, [])), + ?assertEqual(lists:sublist(KeyValues, 32, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_01", BTree), Number - 31, [])), ok. @@ -1338,33 +1338,33 @@ iterator_from_next_06_32_test(_Config) -> iterator_from_next_08_256_test(_Config) -> Number = 256, - BTree = test_generator:generate_b_tree_from_number(4, Number, 3), - KeyValues = test_generator:generate_key_values_from(Number, 3), - - ?assertEqual(lists:sublist(KeyValues, 1, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_000", BTree), Number - 0, [])), - ?assertEqual(lists:sublist(KeyValues, 2, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_002", BTree), Number - 1, [])), - ?assertEqual(lists:sublist(KeyValues, 3, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_003", BTree), Number - 2, [])), - ?assertEqual(lists:sublist(KeyValues, 4, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_004", BTree), Number - 3, [])), - ?assertEqual(lists:sublist(KeyValues, 5, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_005", BTree), Number - 4, [])), - ?assertEqual(lists:sublist(KeyValues, 7, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_007", BTree), Number - 6, [])), - ?assertEqual(lists:sublist(KeyValues, 8, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_008", BTree), Number - 7, [])), - ?assertEqual(lists:sublist(KeyValues, 11, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_011", BTree), Number - 10, [])), - ?assertEqual(lists:sublist(KeyValues, 13, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_013", BTree), Number - 12, [])), - ?assertEqual(lists:sublist(KeyValues, 16, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_016", BTree), Number - 15, [])), - ?assertEqual(lists:sublist(KeyValues, 17, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_017", BTree), Number - 16, [])), - ?assertEqual(lists:sublist(KeyValues, 19, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_019", BTree), Number - 18, [])), - ?assertEqual(lists:sublist(KeyValues, 23, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_023", BTree), Number - 22, [])), - ?assertEqual(lists:sublist(KeyValues, 29, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_029", BTree), Number - 28, [])), - ?assertEqual(lists:sublist(KeyValues, 31, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_031", BTree), Number - 30, [])), - ?assertEqual(lists:sublist(KeyValues, 32, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_032", BTree), Number - 31, [])), - ?assertEqual(lists:sublist(KeyValues, 37, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_037", BTree), Number - 36, [])), - ?assertEqual(lists:sublist(KeyValues, 41, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_041", BTree), Number - 40, [])), - ?assertEqual(lists:sublist(KeyValues, 43, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_043", BTree), Number - 42, [])), - ?assertEqual(lists:sublist(KeyValues, 47, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_047", BTree), Number - 46, [])), - ?assertEqual(lists:sublist(KeyValues, 49, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_049", BTree), Number - 48, [])), - ?assertEqual(lists:sublist(KeyValues, 64, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_064", BTree), Number - 63, [])), - ?assertEqual(lists:sublist(KeyValues, 128, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_128", BTree), Number - 127, [])), - ?assertEqual(lists:sublist(KeyValues, 256, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_256", BTree), Number - 255, [])), + BTree = b_trees_generator:generate_b_tree_from_number(4, Number, 3), + KeyValues = b_trees_generator:generate_key_values_from(Number, 3), + + ?assertEqual(lists:sublist(KeyValues, 1, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_000", BTree), Number - 0, [])), + ?assertEqual(lists:sublist(KeyValues, 2, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_002", BTree), Number - 1, [])), + ?assertEqual(lists:sublist(KeyValues, 3, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_003", BTree), Number - 2, [])), + ?assertEqual(lists:sublist(KeyValues, 4, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_004", BTree), Number - 3, [])), + ?assertEqual(lists:sublist(KeyValues, 5, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_005", BTree), Number - 4, [])), + ?assertEqual(lists:sublist(KeyValues, 7, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_007", BTree), Number - 6, [])), + ?assertEqual(lists:sublist(KeyValues, 8, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_008", BTree), Number - 7, [])), + ?assertEqual(lists:sublist(KeyValues, 11, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_011", BTree), Number - 10, [])), + ?assertEqual(lists:sublist(KeyValues, 13, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_013", BTree), Number - 12, [])), + ?assertEqual(lists:sublist(KeyValues, 16, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_016", BTree), Number - 15, [])), + ?assertEqual(lists:sublist(KeyValues, 17, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_017", BTree), Number - 16, [])), + ?assertEqual(lists:sublist(KeyValues, 19, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_019", BTree), Number - 18, [])), + ?assertEqual(lists:sublist(KeyValues, 23, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_023", BTree), Number - 22, [])), + ?assertEqual(lists:sublist(KeyValues, 29, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_029", BTree), Number - 28, [])), + ?assertEqual(lists:sublist(KeyValues, 31, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_031", BTree), Number - 30, [])), + ?assertEqual(lists:sublist(KeyValues, 32, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_032", BTree), Number - 31, [])), + ?assertEqual(lists:sublist(KeyValues, 37, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_037", BTree), Number - 36, [])), + ?assertEqual(lists:sublist(KeyValues, 41, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_041", BTree), Number - 40, [])), + ?assertEqual(lists:sublist(KeyValues, 43, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_043", BTree), Number - 42, [])), + ?assertEqual(lists:sublist(KeyValues, 47, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_047", BTree), Number - 46, [])), + ?assertEqual(lists:sublist(KeyValues, 49, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_049", BTree), Number - 48, [])), + ?assertEqual(lists:sublist(KeyValues, 64, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_064", BTree), Number - 63, [])), + ?assertEqual(lists:sublist(KeyValues, 128, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_128", BTree), Number - 127, [])), + ?assertEqual(lists:sublist(KeyValues, 256, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_256", BTree), Number - 255, [])), ok. @@ -1373,7 +1373,7 @@ iterator_from_next_08_256_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_16_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_16 = b_trees:iterator_from("k_16", BTree_04_16), {_Key_04_16_16, _Value_04_16_16, Iterator_04_16_17} = b_trees:next(Iterator_04_16_16), ?assertEqual({"k_16", "v_16"}, {_Key_04_16_16, _Value_04_16_16}), @@ -1386,7 +1386,7 @@ iterator_from_next_16_test(_Config) -> %%-------------------------------------------------------------------- iterator_from_next_17_test(_Config) -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_17 = b_trees:iterator_from("k_17", BTree_04_16), none = b_trees:next(Iterator_04_16_17), @@ -1397,7 +1397,7 @@ iterator_from_next_17_test(_Config) -> %%-------------------------------------------------------------------- iterator_next_from_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -1448,7 +1448,7 @@ iterator_next_from_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- iterator_next_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -1533,13 +1533,13 @@ iterator_next_test(_Config) -> _Iterator_06_00_00 = b_trees:iterator(BTree_06_00), ?assertEqual(none, b_trees:next(_Iterator_06_00_00)), - BTree_06_01 = test_generator:generate_b_tree_from_number(6, 1, 2), + BTree_06_01 = b_trees_generator:generate_b_tree_from_number(6, 1, 2), Iterator_06_01_00 = b_trees:iterator(BTree_06_01), {_Key_06_01_01, _Value_05_01_01, _Iterator_06_01_01} = b_trees:next(Iterator_06_01_00), ?assertEqual({"k_01", "v_01"}, {_Key_06_01_01, _Value_05_01_01}), ?assertEqual(none, b_trees:next(_Iterator_06_01_01)), - BTree_06_30 = test_generator:generate_b_tree_from_number(6, 30, 2), + BTree_06_30 = b_trees_generator:generate_b_tree_from_number(6, 30, 2), Iterator_06_30_00 = b_trees:iterator(BTree_06_30), {_Key_06_30_01, _Value_05_30_01, Iterator_06_30_01} = b_trees:next(Iterator_06_30_00), ?assertEqual({"k_01", "v_01"}, {_Key_06_30_01, _Value_05_30_01}), @@ -1610,12 +1610,12 @@ iterator_next_test(_Config) -> %%-------------------------------------------------------------------- keys_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - _Keys_06_32 = b_trees:keys(test_generator:prepare_template_asc(B_TREE_06_32)), - ?assertEqual(test_generator:generate_keys_from(32, 2), _Keys_06_32), + _Keys_06_32 = b_trees:keys(b_trees_generator:prepare_template_asc(B_TREE_06_32)), + ?assertEqual(b_trees_generator:generate_keys_from(32, 2), _Keys_06_32), ?assertEqual(32, length(_Keys_06_32)), true = ets:delete(StateTarget), @@ -1627,28 +1627,28 @@ keys_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- keys_test(_Config) -> - ?assertEqual([], b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual([], b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(["k_01"], b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(["k_01"], b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - _Keys_06_02 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_02)), - ?assertEqual(test_generator:generate_keys_from(2, 2), _Keys_06_02), + _Keys_06_02 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_02)), + ?assertEqual(b_trees_generator:generate_keys_from(2, 2), _Keys_06_02), ?assertEqual(2, length(_Keys_06_02)), - _Keys_06_05 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_05)), - ?assertEqual(test_generator:generate_keys_from(5, 2), _Keys_06_05), + _Keys_06_05 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_05)), + ?assertEqual(b_trees_generator:generate_keys_from(5, 2), _Keys_06_05), ?assertEqual(5, length(_Keys_06_05)), - _Keys_06_09 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_09)), - ?assertEqual(test_generator:generate_keys_from(9, 2), _Keys_06_09), + _Keys_06_09 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_09)), + ?assertEqual(b_trees_generator:generate_keys_from(9, 2), _Keys_06_09), ?assertEqual(9, length(_Keys_06_09)), - _Keys_06_16 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_16)), - ?assertEqual(test_generator:generate_keys_from(16, 2), _Keys_06_16), + _Keys_06_16 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_16)), + ?assertEqual(b_trees_generator:generate_keys_from(16, 2), _Keys_06_16), ?assertEqual(16, length(_Keys_06_16)), - _Keys_06_32 = b_trees:keys(test_generator:prepare_template_desc(?B_TREE_06_32_DESC)), - ?assertEqual(test_generator:generate_keys_till(32, 2), _Keys_06_32), + _Keys_06_32 = b_trees:keys(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)), + ?assertEqual(b_trees_generator:generate_keys_till(32, 2), _Keys_06_32), ?assertEqual(32, length(_Keys_06_32)), ok. @@ -1658,7 +1658,7 @@ keys_test(_Config) -> %%-------------------------------------------------------------------- largest_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -1673,17 +1673,17 @@ largest_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- largest_test(_Config) -> - ?assertException(error, {empty_tree, _}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({"k_01", "v_01"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({"k_02", "v_02"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual({"k_05", "v_05"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual({"k_09", "v_09"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"k_16", "v_16"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_16))), + ?assertEqual({"k_01", "v_01"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({"k_02", "v_02"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual({"k_05", "v_05"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual({"k_09", "v_09"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"k_16", "v_16"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_16))), - ?assertEqual({"k_19", "v_19"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({"k_19", "v_19"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({"k_01", "v_01"}, b_trees:largest(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({"k_01", "v_01"}, b_trees:largest(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1692,7 +1692,7 @@ largest_test(_Config) -> %%-------------------------------------------------------------------- lookup_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -1740,129 +1740,129 @@ lookup_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- lookup_test(_Config) -> - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_04_00))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual(none, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_04_04))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual(none, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_06_07))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual(none, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_10_10))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual(none, b_trees:lookup("k_14", test_generator:prepare_template_asc(?B_TREE_12_13))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual(none, b_trees:lookup("k_17", test_generator:prepare_template_asc(?B_TREE_16_16))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual(none, b_trees:lookup("k_20", test_generator:prepare_template_asc(?B_TREE_18_19))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_20"}, b_trees:lookup("k_20", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_21"}, b_trees:lookup("k_21", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_22"}, b_trees:lookup("k_22", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_23"}, b_trees:lookup("k_23", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_24"}, b_trees:lookup("k_24", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_25"}, b_trees:lookup("k_25", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_26"}, b_trees:lookup("k_26", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_27"}, b_trees:lookup("k_27", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_28"}, b_trees:lookup("k_28", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_29"}, b_trees:lookup("k_29", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_30"}, b_trees:lookup("k_30", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_31"}, b_trees:lookup("k_31", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_32"}, b_trees:lookup("k_32", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual(none, b_trees:lookup("k_33", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_00))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual(none, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual(none, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual(none, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual(none, b_trees:lookup("k_14", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual(none, b_trees:lookup("k_17", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual(none, b_trees:lookup("k_20", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_20"}, b_trees:lookup("k_20", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_21"}, b_trees:lookup("k_21", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_22"}, b_trees:lookup("k_22", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_23"}, b_trees:lookup("k_23", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_24"}, b_trees:lookup("k_24", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_25"}, b_trees:lookup("k_25", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_26"}, b_trees:lookup("k_26", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_27"}, b_trees:lookup("k_27", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_28"}, b_trees:lookup("k_28", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_29"}, b_trees:lookup("k_29", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_30"}, b_trees:lookup("k_30", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_31"}, b_trees:lookup("k_31", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_32"}, b_trees:lookup("k_32", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(none, b_trees:lookup("k_33", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1871,15 +1871,15 @@ lookup_test(_Config) -> %%-------------------------------------------------------------------- map_b_tree_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), - B_TREE_04_32_MAPPED = b_trees:map(fun test_generator:map_value_to_new/2, B_TREE_04_32), + B_TREE_04_32_MAPPED = b_trees:map(fun b_trees_generator:map_value_to_new/2, B_TREE_04_32), B_TREE_04_32_MAPPED_VALUES = b_trees:to_list(B_TREE_04_32_MAPPED), - ?assertEqual(B_TREE_04_32_MAPPED_VALUES, test_generator:generate_key_values_from_update(32, 2)), + ?assertEqual(B_TREE_04_32_MAPPED_VALUES, b_trees_generator:generate_key_values_from_update(32, 2)), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_04_32_MAPPED), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -1893,9 +1893,9 @@ map_b_tree_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- map_b_tree_test(_Config) -> - test_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:map(fun test_generator:map_value_to_new/2, test_generator:prepare_template_asc(?B_TREE_04_15))), + b_trees_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:map(fun b_trees_generator:map_value_to_new/2, b_trees_generator:prepare_template_asc(?B_TREE_04_15))), - test_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:map(fun test_generator:map_value_to_new/2, test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + b_trees_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:map(fun b_trees_generator:map_value_to_new/2, b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1904,7 +1904,7 @@ map_b_tree_test(_Config) -> %%-------------------------------------------------------------------- map_error_test(_Config) -> - ?assertException(error, {empty_tree, _}, b_trees:map(fun test_generator:map_value_to_new/2, test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:map(fun b_trees_generator:map_value_to_new/2, b_trees_generator:prepare_template_asc(?B_TREE_06_00))), ok. @@ -1915,8 +1915,8 @@ map_error_test(_Config) -> set_parameter_test(_Config) -> BTree_06_00 = b_trees:empty(6), BTree_06_00_DESC = b_trees:set_parameter(BTree_06_00, sort, fun b_trees:sort_descending/2), - KeyValues = test_generator:generate_key_values_from(32, 2), - test_generator:check_equal(?B_TREE_06_32_DESC, test_generator:generate_b_tree_list_and_btree(KeyValues, BTree_06_00_DESC)), + KeyValues = b_trees_generator:generate_key_values_from(32, 2), + b_trees_generator:check_equal(?B_TREE_06_32_DESC, b_trees_generator:generate_b_tree_list_and_btree(KeyValues, BTree_06_00_DESC)), ok. @@ -1925,11 +1925,11 @@ set_parameter_test(_Config) -> %%-------------------------------------------------------------------- size_key_values_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_desc(B_TREE_06_32))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_desc(B_TREE_06_32))), true = ets:delete(StateTarget), @@ -1940,15 +1940,15 @@ size_key_values_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- size_key_values_test(_Config) -> - ?assertEqual(0, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(2, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual(5, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual(16, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_16))), - ?assertEqual(29, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertEqual(0, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual(2, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual(5, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual(16, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_16))), + ?assertEqual(29, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual(19, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual(19, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_18_19))), ok. @@ -1957,11 +1957,11 @@ size_key_values_test(_Config) -> %%-------------------------------------------------------------------- size_nodes_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_desc(B_TREE_06_32))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_desc(B_TREE_06_32))), true = ets:delete(StateTarget), @@ -1974,13 +1974,13 @@ size_nodes_persistence_by_ets_test(_Config) -> size_nodes_test(_Config) -> ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(6))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_03))), - ?assertEqual({3, 2}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_08))), - ?assertEqual({5, 4}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_13))), - ?assertEqual({7, 6}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_20))), - ?assertEqual({10, 7}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + ?assertEqual({3, 2}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_08))), + ?assertEqual({5, 4}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + ?assertEqual({7, 6}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_20))), + ?assertEqual({10, 7}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1989,7 +1989,7 @@ size_nodes_test(_Config) -> %%-------------------------------------------------------------------- smallest_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -2004,17 +2004,17 @@ smallest_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- smallest_test(_Config) -> - ?assertException(error, {empty_tree, _}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_16))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_16))), - ?assertEqual({"k_32", "v_32"}, b_trees:smallest(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({"k_32", "v_32"}, b_trees:smallest(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_18_19))), ok. @@ -2023,11 +2023,11 @@ smallest_test(_Config) -> %%-------------------------------------------------------------------- take_any_test(_Config) -> - ?assertEqual(error, b_trees:take_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take_any("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual(error, b_trees:take_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_03)}, b_trees:take_any("k_04", test_generator:prepare_template_asc(?B_TREE_06_04))), - ?assertEqual({"v_07", test_generator:prepare_template_asc(?B_TREE_06_06)}, b_trees:take_any("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual(error, b_trees:take_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take_any("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(error, b_trees:take_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_03)}, b_trees:take_any("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + ?assertEqual({"v_07", b_trees_generator:prepare_template_asc(?B_TREE_06_06)}, b_trees:take_any("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), ok. @@ -2036,30 +2036,30 @@ take_any_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_4_test(_Config) -> - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_04_10_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_04_10))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_04_10_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_10))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_04_17))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), - ?assertEqual({"v_12", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_12)}, b_trees:take("k_12", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_17))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), + ?assertEqual({"v_12", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_12)}, b_trees:take("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_10", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_10)}, b_trees:take("k_10", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_12", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_12)}, b_trees:take("k_12", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_14", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_14)}, b_trees:take("k_14", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_16", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_16)}, b_trees:take("k_16", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_18", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_18)}, b_trees:take("k_18", test_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_10", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_10)}, b_trees:take("k_10", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_12", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_12)}, b_trees:take("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_14", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_14)}, b_trees:take("k_14", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_16", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_16)}, b_trees:take("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_18", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_18)}, b_trees:take("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_18", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18)}, b_trees:take("k_18", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), - ?assertEqual({"v_20", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20)}, b_trees:take("k_20", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), - ?assertEqual({"v_22", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_22)}, b_trees:take("k_22", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), - ?assertEqual({"v_30", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_30)}, b_trees:take("k_30", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), + ?assertEqual({"v_18", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18)}, b_trees:take("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), + ?assertEqual({"v_20", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20)}, b_trees:take("k_20", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), + ?assertEqual({"v_22", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_22)}, b_trees:take("k_22", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), + ?assertEqual({"v_30", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_30)}, b_trees:take("k_30", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_04_64_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_04_64))), - ?assertEqual({"v_16", test_generator:prepare_template_asc(?B_TREE_04_64_MINUS_16)}, b_trees:take("k_16", test_generator:prepare_template_asc(?B_TREE_04_64))), - ?assertEqual({"v_32", test_generator:prepare_template_asc(?B_TREE_04_64_MINUS_32)}, b_trees:take("k_32", test_generator:prepare_template_asc(?B_TREE_04_64))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_04_64_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + ?assertEqual({"v_16", b_trees_generator:prepare_template_asc(?B_TREE_04_64_MINUS_16)}, b_trees:take("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + ?assertEqual({"v_32", b_trees_generator:prepare_template_asc(?B_TREE_04_64_MINUS_32)}, b_trees:take("k_32", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), ok. @@ -2068,35 +2068,35 @@ take_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_6_test(_Config) -> - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_01)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_03", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_03)}, b_trees:take("k_03", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_05", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_05)}, b_trees:take("k_05", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_06_06))), - - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_01)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_03", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_03)}, b_trees:take("k_03", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_05", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_05)}, b_trees:take("k_05", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_07", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_07)}, b_trees:take("k_07", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_09", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_09)}, b_trees:take("k_09", test_generator:prepare_template_asc(?B_TREE_06_09))), - - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_01)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_03", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_03)}, b_trees:take("k_03", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_05", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_05)}, b_trees:take("k_05", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_07", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_07)}, b_trees:take("k_07", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_09", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_09)}, b_trees:take("k_09", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_10", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_10)}, b_trees:take("k_10", test_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_01)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_03", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_03)}, b_trees:take("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_05", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_05)}, b_trees:take("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_01)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_03", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_03)}, b_trees:take("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_05", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_05)}, b_trees:take("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_07", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_07)}, b_trees:take("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_09", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_09)}, b_trees:take("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_01)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_03", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_03)}, b_trees:take("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_05", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_05)}, b_trees:take("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_07", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_07)}, b_trees:take("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_09", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_09)}, b_trees:take("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_10", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_10)}, b_trees:take("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), ok. @@ -2105,11 +2105,11 @@ take_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- take_error_test(_Config) -> - ?assertException(error, {badmatch, none}, b_trees:take("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {badmatch, none}, b_trees:take("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {badmatch, none}, b_trees:take("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertException(error, {badmatch, none}, b_trees:take("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertException(error, {badmatch, none}, b_trees:take("k_10", test_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertException(error, {badmatch, none}, b_trees:take("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), ok. @@ -2118,7 +2118,7 @@ take_error_test(_Config) -> %%-------------------------------------------------------------------- take_largest_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -2171,28 +2171,28 @@ take_largest_persistence_by_ets_test(_Config) -> take_largest_test(_Config) -> ?assertException(error, {empty_tree, _}, b_trees:take_largest(?B_TREE_06_00)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 3, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 6, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 9, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 12, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 15, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 18, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 21, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 24, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 27, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 30, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 3, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 6, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 9, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 12, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 15, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 18, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 21, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 24, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 27, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 30, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 4, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 8, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 12, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 16, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 20, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 24, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 28, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 32, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 36, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 40, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 4, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 8, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 12, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 16, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 20, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 24, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 28, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 32, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 36, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 40, 2)), ok. @@ -2201,7 +2201,7 @@ take_largest_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -2254,28 +2254,28 @@ take_smallest_persistence_by_ets_test(_Config) -> take_smallest_test(_Config) -> ?assertException(error, {empty_tree, _}, b_trees:take_smallest(?B_TREE_06_00)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 3, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 6, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 9, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 12, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 15, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 18, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 21, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 24, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 27, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 30, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 3, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 6, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 9, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 12, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 15, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 18, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 21, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 24, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 27, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 30, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 4, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 8, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 12, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 16, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 20, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 24, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 28, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 32, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 36, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 40, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 4, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 8, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 12, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 16, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 20, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 24, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 28, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 32, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 36, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 40, 2)), ok. @@ -2284,12 +2284,12 @@ take_smallest_test(_Config) -> %%-------------------------------------------------------------------- to_list_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), _KeyValues_06_32 = b_trees:to_list(B_TREE_06_32), - ?assertEqual(test_generator:generate_key_values_from(32, 2), _KeyValues_06_32), + ?assertEqual(b_trees_generator:generate_key_values_from(32, 2), _KeyValues_06_32), ?assertEqual(32, length(_KeyValues_06_32)), true = ets:delete(StateTarget), @@ -2301,28 +2301,28 @@ to_list_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- to_list_test(_Config) -> - ?assertException(error, {empty_tree, _}, b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual([{"k_01", "v_01"}], b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual([{"k_01", "v_01"}], b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - _KeyValues_06_02 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_02)), - ?assertEqual(test_generator:generate_key_values_from(2, 2), _KeyValues_06_02), + _KeyValues_06_02 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_02)), + ?assertEqual(b_trees_generator:generate_key_values_from(2, 2), _KeyValues_06_02), ?assertEqual(2, length(_KeyValues_06_02)), - _KeyValues_06_05 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_05)), - ?assertEqual(test_generator:generate_key_values_from(5, 2), _KeyValues_06_05), + _KeyValues_06_05 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_05)), + ?assertEqual(b_trees_generator:generate_key_values_from(5, 2), _KeyValues_06_05), ?assertEqual(5, length(_KeyValues_06_05)), - _KeyValues_06_09 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_09)), - ?assertEqual(test_generator:generate_key_values_from(9, 2), _KeyValues_06_09), + _KeyValues_06_09 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_09)), + ?assertEqual(b_trees_generator:generate_key_values_from(9, 2), _KeyValues_06_09), ?assertEqual(9, length(_KeyValues_06_09)), - _KeyValues_06_16 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_16)), - ?assertEqual(test_generator:generate_key_values_from(16, 2), _KeyValues_06_16), + _KeyValues_06_16 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_16)), + ?assertEqual(b_trees_generator:generate_key_values_from(16, 2), _KeyValues_06_16), ?assertEqual(16, length(_KeyValues_06_16)), - _KeyValues_06_32 = b_trees:to_list(test_generator:prepare_template_desc(?B_TREE_06_32_DESC)), - ?assertEqual(test_generator:generate_key_values_till(32, 2), _KeyValues_06_32), + _KeyValues_06_32 = b_trees:to_list(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)), + ?assertEqual(b_trees_generator:generate_key_values_till(32, 2), _KeyValues_06_32), ?assertEqual(32, length(_KeyValues_06_32)), ok. @@ -2332,7 +2332,7 @@ to_list_test(_Config) -> %%-------------------------------------------------------------------- update_b_tree_test(_Config) -> - BTree_04_15_K_01 = b_trees:update("k_01", "v_01_new", test_generator:prepare_template_asc(?B_TREE_04_15)), + BTree_04_15_K_01 = b_trees:update("k_01", "v_01_new", b_trees_generator:prepare_template_asc(?B_TREE_04_15)), BTree_04_15_K_02 = b_trees:update("k_02", "v_02_new", BTree_04_15_K_01), BTree_04_15_K_03 = b_trees:update("k_03", "v_03_new", BTree_04_15_K_02), BTree_04_15_K_04 = b_trees:update("k_04", "v_04_new", BTree_04_15_K_03), @@ -2346,9 +2346,9 @@ update_b_tree_test(_Config) -> BTree_04_15_K_12 = b_trees:update("k_12", "v_12_new", BTree_04_15_K_11), BTree_04_15_K_13 = b_trees:update("k_13", "v_13_new", BTree_04_15_K_12), _BTree_04_15_K_14 = b_trees:update("k_14", "v_14_new", BTree_04_15_K_13), - test_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:update("k_15", "v_15_new", _BTree_04_15_K_14)), + b_trees_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:update("k_15", "v_15_new", _BTree_04_15_K_14)), - BTree_06_32_DESC_K_01 = b_trees:update("k_01", "v_01_new", test_generator:prepare_template_desc(?B_TREE_06_32_DESC)), + BTree_06_32_DESC_K_01 = b_trees:update("k_01", "v_01_new", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)), BTree_06_32_DESC_K_02 = b_trees:update("k_02", "v_02_new", BTree_06_32_DESC_K_01), BTree_06_32_DESC_K_03 = b_trees:update("k_03", "v_03_new", BTree_06_32_DESC_K_02), BTree_06_32_DESC_K_04 = b_trees:update("k_04", "v_04_new", BTree_06_32_DESC_K_03), @@ -2379,7 +2379,7 @@ update_b_tree_test(_Config) -> BTree_06_32_DESC_K_29 = b_trees:update("k_29", "v_29_new", BTree_06_32_DESC_K_28), BTree_06_32_DESC_K_30 = b_trees:update("k_30", "v_30_new", BTree_06_32_DESC_K_29), _BTree_06_32_DESC_K_31 = b_trees:update("k_31", "v_31_new", BTree_06_32_DESC_K_30), - test_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:update("k_32", "v_32_new", _BTree_06_32_DESC_K_31)), + b_trees_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:update("k_32", "v_32_new", _BTree_06_32_DESC_K_31)), ok. @@ -2388,12 +2388,12 @@ update_b_tree_test(_Config) -> %%-------------------------------------------------------------------- update_error_test(_Config) -> - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertException(error, {key_not_found, "k_30"}, b_trees:update("k_30", "v_30_new", test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_08_64))), - ?assertException(error, {key_not_found, "k_65"}, b_trees:update("k_65", "v_65_new", test_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertException(error, {key_not_found, "k_30"}, b_trees:update("k_30", "v_30_new", b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertException(error, {key_not_found, "k_65"}, b_trees:update("k_65", "v_65_new", b_trees_generator:prepare_template_asc(?B_TREE_08_64))), ok. @@ -2402,7 +2402,7 @@ update_error_test(_Config) -> %%-------------------------------------------------------------------- update_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -2441,7 +2441,7 @@ update_persistence_by_ets_test(_Config) -> B_TREE_04_32_K_32_VALUES = b_trees:to_list(B_TREE_04_32_K_32), - ?assertEqual(B_TREE_04_32_K_32_VALUES, test_generator:generate_key_values_from_update(32, 2)), + ?assertEqual(B_TREE_04_32_K_32_VALUES, b_trees_generator:generate_key_values_from_update(32, 2)), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_04_32_K_32), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -2455,7 +2455,7 @@ update_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- values_persistence_by_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -2470,15 +2470,15 @@ values_persistence_by_ets_test(_Config) -> %%-------------------------------------------------------------------- values_test(_Config) -> - ?assertEqual([], b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual([], b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(["v_01"], b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(["v_01"], b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual(2, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_02)))), - ?assertEqual(5, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_05)))), - ?assertEqual(9, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_09)))), - ?assertEqual(16, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_16)))), + ?assertEqual(2, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_02)))), + ?assertEqual(5, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_05)))), + ?assertEqual(9, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_09)))), + ?assertEqual(16, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_16)))), - ?assertEqual(32, length(b_trees:values(test_generator:prepare_template_desc(?B_TREE_06_32_DESC)))), + ?assertEqual(32, length(b_trees:values(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)))), ok. diff --git a/test/b_trees_test.erl b/test/b_trees_test.erl index a35fe8a..e8718e4 100644 --- a/test/b_trees_test.erl +++ b/test/b_trees_test.erl @@ -20,7 +20,7 @@ %%-------------------------------------------------------------------- delete_any_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -70,11 +70,11 @@ delete_any_persistence_by_ets_test() -> %%-------------------------------------------------------------------- delete_any_test() -> - test_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), - test_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - test_generator:check_equal(?B_TREE_06_01, b_trees:delete_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), - test_generator:check_equal(?B_TREE_06_03, b_trees:delete_any("k_04", test_generator:prepare_template_asc(?B_TREE_06_04))), - test_generator:check_equal(?B_TREE_06_06, b_trees:delete_any("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:delete_any("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + b_trees_generator:check_equal(?B_TREE_06_01, b_trees:delete_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + b_trees_generator:check_equal(?B_TREE_06_03, b_trees:delete_any("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + b_trees_generator:check_equal(?B_TREE_06_06, b_trees:delete_any("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), ok. @@ -83,30 +83,30 @@ delete_any_test() -> %%-------------------------------------------------------------------- delete_b_tree_order_4_test() -> - test_generator:check_equal(?B_TREE_04_10_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_04_10))), + b_trees_generator:check_equal(?B_TREE_04_10_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_10))), - test_generator:check_equal(?B_TREE_04_17_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_04_17))), - test_generator:check_equal(?B_TREE_04_17_MINUS_02_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), - test_generator:check_equal(?B_TREE_04_17_MINUS_02_TILL_12, b_trees:delete("k_12", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), + b_trees_generator:check_equal(?B_TREE_04_17_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_17))), + b_trees_generator:check_equal(?B_TREE_04_17_MINUS_02_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), + b_trees_generator:check_equal(?B_TREE_04_17_MINUS_02_TILL_12, b_trees:delete("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), - test_generator:check_equal(?B_TREE_04_20_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_10, b_trees:delete("k_10", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_12, b_trees:delete("k_12", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_14, b_trees:delete("k_14", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_16, b_trees:delete("k_16", test_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_20_MINUS_18, b_trees:delete("k_18", test_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_10, b_trees:delete("k_10", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_12, b_trees:delete("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_14, b_trees:delete("k_14", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_16, b_trees:delete("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + b_trees_generator:check_equal(?B_TREE_04_20_MINUS_18, b_trees:delete("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_18, b_trees:delete("k_18", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_20, b_trees:delete("k_20", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_22, b_trees:delete("k_22", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), - test_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_30, b_trees:delete("k_30", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_18, b_trees:delete("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_20, b_trees:delete("k_20", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_22, b_trees:delete("k_22", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), + b_trees_generator:check_equal(?B_TREE_04_33_MINUS_02_TILL_30, b_trees:delete("k_30", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), - test_generator:check_equal(?B_TREE_04_64_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_04_64))), - test_generator:check_equal(?B_TREE_04_64_MINUS_16, b_trees:delete("k_16", test_generator:prepare_template_asc(?B_TREE_04_64))), - test_generator:check_equal(?B_TREE_04_64_MINUS_32, b_trees:delete("k_32", test_generator:prepare_template_asc(?B_TREE_04_64))), + b_trees_generator:check_equal(?B_TREE_04_64_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + b_trees_generator:check_equal(?B_TREE_04_64_MINUS_16, b_trees:delete("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + b_trees_generator:check_equal(?B_TREE_04_64_MINUS_32, b_trees:delete("k_32", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), ok. @@ -115,46 +115,46 @@ delete_b_tree_order_4_test() -> %%-------------------------------------------------------------------- delete_b_tree_order_6_test() -> - test_generator:check_equal(?B_TREE_06_00, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - - test_generator:check_equal(?B_TREE_06_06_MINUS_01, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_03, b_trees:delete("k_03", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_05, b_trees:delete("k_05", test_generator:prepare_template_asc(?B_TREE_06_06))), - test_generator:check_equal(?B_TREE_06_06_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_06_06))), - - test_generator:check_equal(?B_TREE_06_09_MINUS_01, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_03, b_trees:delete("k_03", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_05, b_trees:delete("k_05", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_07, b_trees:delete("k_07", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_06_09))), - test_generator:check_equal(?B_TREE_06_09_MINUS_09, b_trees:delete("k_09", test_generator:prepare_template_asc(?B_TREE_06_09))), - - test_generator:check_equal(?B_TREE_06_10_MINUS_01, b_trees:delete("k_01", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_02, b_trees:delete("k_02", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_03, b_trees:delete("k_03", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_04, b_trees:delete("k_04", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_05, b_trees:delete("k_05", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_06, b_trees:delete("k_06", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_07, b_trees:delete("k_07", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_08, b_trees:delete("k_08", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_09, b_trees:delete("k_09", test_generator:prepare_template_asc(?B_TREE_06_10))), - test_generator:check_equal(?B_TREE_06_10_MINUS_10, b_trees:delete("k_10", test_generator:prepare_template_asc(?B_TREE_06_10))), - - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 1, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 5, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 8, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 11, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 14, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 17, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 20, 4)), - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_till(6, 100, 4)), - - test_generator:check_equal(?B_TREE_06_00, test_generator:delete_b_tree_from(6, 32, 2, test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_01, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_03, b_trees:delete("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_05, b_trees:delete("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + b_trees_generator:check_equal(?B_TREE_06_06_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_01, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_03, b_trees:delete("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_05, b_trees:delete("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_07, b_trees:delete("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + b_trees_generator:check_equal(?B_TREE_06_09_MINUS_09, b_trees:delete("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_01, b_trees:delete("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_02, b_trees:delete("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_03, b_trees:delete("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_04, b_trees:delete("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_05, b_trees:delete("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_06, b_trees:delete("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_07, b_trees:delete("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_08, b_trees:delete("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_09, b_trees:delete("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + b_trees_generator:check_equal(?B_TREE_06_10_MINUS_10, b_trees:delete("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 1, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 5, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 8, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 11, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 14, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 17, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 20, 4)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_till(6, 100, 4)), + + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:delete_b_tree_from(6, 32, 2, b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -163,7 +163,7 @@ delete_b_tree_order_6_test() -> %%-------------------------------------------------------------------- delete_b_tree_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -216,46 +216,46 @@ delete_b_tree_persistence_by_ets_test() -> delete_clrs_test() -> % case 1 - _B_TREE_CLRS_500_MINUS_F = b_trees:delete("k_f", test_generator:prepare_template_asc(?B_TREE_CLRS_500)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F, _B_TREE_CLRS_500_MINUS_F), + _B_TREE_CLRS_500_MINUS_F = b_trees:delete("k_f", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F, _B_TREE_CLRS_500_MINUS_F), % case 2a - _B_TREE_CLRS_500_MINUS_F_M = b_trees:delete("k_m", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M, _B_TREE_CLRS_500_MINUS_F_M), + _B_TREE_CLRS_500_MINUS_F_M = b_trees:delete("k_m", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M, _B_TREE_CLRS_500_MINUS_F_M), % case 2b - _B_TREE_CLRS_500_MINUS_F_L = b_trees:delete("k_l", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_2)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_L, _B_TREE_CLRS_500_MINUS_F_L), + _B_TREE_CLRS_500_MINUS_F_L = b_trees:delete("k_l", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_2)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_L, _B_TREE_CLRS_500_MINUS_F_L), % case 2c - _B_TREE_CLRS_500_MINUS_F_M_G = b_trees:delete("k_g", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G, _B_TREE_CLRS_500_MINUS_F_M_G), + _B_TREE_CLRS_500_MINUS_F_M_G = b_trees:delete("k_g", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G, _B_TREE_CLRS_500_MINUS_F_M_G), % case 3a - delete left - _B_TREE_CLRS_500_MINUS_F_M_G_D_A = b_trees:delete("k_a", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_A, _B_TREE_CLRS_500_MINUS_F_M_G_D_A), - _B_TREE_CLRS_500_MINUS_F_M_G_D_B = b_trees:delete("k_b", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_B, _B_TREE_CLRS_500_MINUS_F_M_G_D_B), - _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E = b_trees:delete("k_e", test_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_E, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E), - _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J = b_trees:delete("k_j", test_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_J, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J), - _B_TREE_CLRS_500_MINUS_F_M_G_D_N = b_trees:delete("k_n", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_N, _B_TREE_CLRS_500_MINUS_F_M_G_D_N), - _B_TREE_CLRS_500_MINUS_F_M_G_D_O = b_trees:delete("k_o", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_O, _B_TREE_CLRS_500_MINUS_F_M_G_D_O), + _B_TREE_CLRS_500_MINUS_F_M_G_D_A = b_trees:delete("k_a", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_A, _B_TREE_CLRS_500_MINUS_F_M_G_D_A), + _B_TREE_CLRS_500_MINUS_F_M_G_D_B = b_trees:delete("k_b", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_B, _B_TREE_CLRS_500_MINUS_F_M_G_D_B), + _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E = b_trees:delete("k_e", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_E, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_E), + _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J = b_trees:delete("k_j", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_2_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_2_MINUS_F_M_G_D_J, _B_TREE_CLRS_500_2_MINUS_F_M_G_D_J), + _B_TREE_CLRS_500_MINUS_F_M_G_D_N = b_trees:delete("k_n", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_N, _B_TREE_CLRS_500_MINUS_F_M_G_D_N), + _B_TREE_CLRS_500_MINUS_F_M_G_D_O = b_trees:delete("k_o", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_O, _B_TREE_CLRS_500_MINUS_F_M_G_D_O), % case 3a delete right - _B_TREE_CLRS_500_MINUS_F_M_G_D_U = b_trees:delete("k_u", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_U, _B_TREE_CLRS_500_MINUS_F_M_G_D_U), - _B_TREE_CLRS_500_MINUS_F_M_G_D_V = b_trees:delete("k_v", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_V, _B_TREE_CLRS_500_MINUS_F_M_G_D_V), + _B_TREE_CLRS_500_MINUS_F_M_G_D_U = b_trees:delete("k_u", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_U, _B_TREE_CLRS_500_MINUS_F_M_G_D_U), + _B_TREE_CLRS_500_MINUS_F_M_G_D_V = b_trees:delete("k_v", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G_D)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D_V, _B_TREE_CLRS_500_MINUS_F_M_G_D_V), % case 3b - _B_TREE_CLRS_500_MINUS_F_M_G_D = b_trees:delete("k_d", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D, _B_TREE_CLRS_500_MINUS_F_M_G_D), - _B_TREE_CLRS_500_MINUS_F_M_G_U = b_trees:delete("k_u", test_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), - test_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_U, _B_TREE_CLRS_500_MINUS_F_M_G_U), + _B_TREE_CLRS_500_MINUS_F_M_G_D = b_trees:delete("k_d", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_D, _B_TREE_CLRS_500_MINUS_F_M_G_D), + _B_TREE_CLRS_500_MINUS_F_M_G_U = b_trees:delete("k_u", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_500_MINUS_F_M_G)), + b_trees_generator:check_equal(?B_TREE_CLRS_500_MINUS_F_M_G_U, _B_TREE_CLRS_500_MINUS_F_M_G_U), ok. @@ -264,11 +264,11 @@ delete_clrs_test() -> %%-------------------------------------------------------------------- delete_error_test() -> - ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:delete("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertException(error, {key_not_found, "k_10"}, b_trees:delete("k_10", test_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertException(error, {key_not_found, "k_10"}, b_trees:delete("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), ok. @@ -277,15 +277,15 @@ delete_error_test() -> %%-------------------------------------------------------------------- empty_b_tree_test() -> - test_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), ?assert(b_trees:is_empty(b_trees:empty(4))), ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(4))), - test_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), ?assert(b_trees:is_empty(b_trees:empty(6))), ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(6))), - test_generator:check_equal(?B_TREE_32_00, b_trees:empty(32)), + b_trees_generator:check_equal(?B_TREE_32_00, b_trees:empty(32)), ?assert(b_trees:is_empty(b_trees:empty(32))), ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(32))), @@ -296,7 +296,7 @@ empty_b_tree_test() -> %%-------------------------------------------------------------------- enter_b_tree_order_4_test() -> - BTree_04_15_01 = b_trees:enter("k_01", "v_01", test_generator:prepare_template_asc(?B_TREE_04_00)), + BTree_04_15_01 = b_trees:enter("k_01", "v_01", b_trees_generator:prepare_template_asc(?B_TREE_04_00)), BTree_04_15_02 = b_trees:enter("k_02", "v_02", BTree_04_15_01), BTree_04_15_03 = b_trees:enter("k_03", "v_03", BTree_04_15_02), BTree_04_15_04 = b_trees:enter("k_04", "v_04", BTree_04_15_03), @@ -311,7 +311,7 @@ enter_b_tree_order_4_test() -> BTree_04_15_13 = b_trees:enter("k_13", "v_13", BTree_04_15_12), BTree_04_15_14 = b_trees:enter("k_14", "v_14", BTree_04_15_13), BTree_04_15_15 = b_trees:enter("k_15", "v_15", BTree_04_15_14), - test_generator:check_equal(?B_TREE_04_15, BTree_04_15_15), + b_trees_generator:check_equal(?B_TREE_04_15, BTree_04_15_15), BTree_04_15_01_NEW = b_trees:enter("k_01", "v_01_new", BTree_04_15_15), BTree_04_15_02_NEW = b_trees:enter("k_02", "v_02_new", BTree_04_15_01_NEW), @@ -327,7 +327,7 @@ enter_b_tree_order_4_test() -> BTree_04_15_12_NEW = b_trees:enter("k_12", "v_12_new", BTree_04_15_11_NEW), BTree_04_15_13_NEW = b_trees:enter("k_13", "v_13_new", BTree_04_15_12_NEW), BTree_04_15_14_NEW = b_trees:enter("k_14", "v_14_new", BTree_04_15_13_NEW), - test_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:enter("k_15", "v_15_new", BTree_04_15_14_NEW)), + b_trees_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:enter("k_15", "v_15_new", BTree_04_15_14_NEW)), ok. @@ -336,7 +336,7 @@ enter_b_tree_order_4_test() -> %%-------------------------------------------------------------------- enter_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_30 = test_generator:generate_b_tree_from_number_ets(4, 30, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_30 = b_trees_generator:generate_b_tree_from_number_ets(4, 30, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), B_TREE_04_32_31 = b_trees:enter("k_31", "v_31", B_TREE_04_32_30), B_TREE_04_32_32 = b_trees:enter("k_32", "v_32", B_TREE_04_32_31), @@ -379,7 +379,7 @@ enter_persistence_by_ets_test() -> B_TREE_04_32_MAPPED_VALUES = b_trees:to_list(B_TREE_04_32_32_NEW), - ?assertEqual(B_TREE_04_32_MAPPED_VALUES, test_generator:generate_key_values_from_update(32, 2)), + ?assertEqual(B_TREE_04_32_MAPPED_VALUES, b_trees_generator:generate_key_values_from_update(32, 2)), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_04_32_32_NEW), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -393,15 +393,15 @@ enter_persistence_by_ets_test() -> %%-------------------------------------------------------------------- from_dict_b_tree_test() -> - ?assertException(error, {tree_not_empty, _}, b_trees:from_dict(?B_TREE_04_04, test_generator:generate_key_values_from(4, 2))), + ?assertException(error, {tree_not_empty, _}, b_trees:from_dict(?B_TREE_04_04, b_trees_generator:generate_key_values_from(4, 2))), - test_generator:check_equal(?B_TREE_04_04, b_trees:from_dict(b_trees:empty(4), test_generator:generate_key_values_from(4, 2))), - test_generator:check_equal(?B_TREE_06_01, b_trees:from_dict(b_trees:empty(6), test_generator:generate_key_values_from(1, 2))), - test_generator:check_equal(?B_TREE_06_29, b_trees:from_dict(b_trees:empty(6), test_generator:generate_key_values_from(29, 2))), - test_generator:check_equal(?B_TREE_18_19, b_trees:from_dict(b_trees:empty(18), test_generator:generate_key_values_from(19, 2))), + b_trees_generator:check_equal(?B_TREE_04_04, b_trees:from_dict(b_trees:empty(4), b_trees_generator:generate_key_values_from(4, 2))), + b_trees_generator:check_equal(?B_TREE_06_01, b_trees:from_dict(b_trees:empty(6), b_trees_generator:generate_key_values_from(1, 2))), + b_trees_generator:check_equal(?B_TREE_06_29, b_trees:from_dict(b_trees:empty(6), b_trees_generator:generate_key_values_from(29, 2))), + b_trees_generator:check_equal(?B_TREE_18_19, b_trees:from_dict(b_trees:empty(18), b_trees_generator:generate_key_values_from(19, 2))), B_TREE_06_32_00 = b_trees:set_parameter(b_trees:empty(6), sort, fun b_trees:sort_descending/2), - test_generator:check_equal(?B_TREE_06_32_DESC, b_trees:from_dict(B_TREE_06_32_00, test_generator:generate_key_values_from(32, 2))), + b_trees_generator:check_equal(?B_TREE_06_32_DESC, b_trees:from_dict(B_TREE_06_32_00, b_trees_generator:generate_key_values_from(32, 2))), ok. @@ -412,9 +412,9 @@ from_dict_b_tree_test() -> from_dict_persistence_by_ets_test() -> StateTarget = ets:new(b_trees, []), - B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), - B_TREE_06_32 = b_trees:from_dict(B_TREE_06_00, test_generator:generate_key_values_from(32, 2)), + B_TREE_06_32 = b_trees:from_dict(B_TREE_06_00, b_trees_generator:generate_key_values_from(32, 2)), ?assertEqual(32, b_trees:size_key_values(B_TREE_06_32)), @@ -430,7 +430,7 @@ from_dict_persistence_by_ets_test() -> %%-------------------------------------------------------------------- get_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -478,129 +478,129 @@ get_persistence_by_ets_test() -> %%-------------------------------------------------------------------- get_test() -> - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_04_00))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertException(error, {key_not_found, "k_05"}, b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_04_04))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertException(error, {key_not_found, "k_08"}, b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_06_07))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertException(error, {key_not_found, "k_11"}, b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_10_10))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertException(error, {key_not_found, "k_14"}, b_trees:get("k_14", test_generator:prepare_template_asc(?B_TREE_12_13))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_14", b_trees:get("k_14", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_15", b_trees:get("k_15", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual("v_16", b_trees:get("k_16", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertException(error, {key_not_found, "k_17"}, b_trees:get("k_17", test_generator:prepare_template_asc(?B_TREE_16_16))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_14", b_trees:get("k_14", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_15", b_trees:get("k_15", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_16", b_trees:get("k_16", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_17", b_trees:get("k_17", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_18", b_trees:get("k_18", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual("v_19", b_trees:get("k_19", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertException(error, {key_not_found, "k_20"}, b_trees:get("k_20", test_generator:prepare_template_asc(?B_TREE_18_19))), - - ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_01", b_trees:get("k_01", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_02", b_trees:get("k_02", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_03", b_trees:get("k_03", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_04", b_trees:get("k_04", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_05", b_trees:get("k_05", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_06", b_trees:get("k_06", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_07", b_trees:get("k_07", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_08", b_trees:get("k_08", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_09", b_trees:get("k_09", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_10", b_trees:get("k_10", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_11", b_trees:get("k_11", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_12", b_trees:get("k_12", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_13", b_trees:get("k_13", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_14", b_trees:get("k_14", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_15", b_trees:get("k_15", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_16", b_trees:get("k_16", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_17", b_trees:get("k_17", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_18", b_trees:get("k_18", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_19", b_trees:get("k_19", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_20", b_trees:get("k_20", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_21", b_trees:get("k_21", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_22", b_trees:get("k_22", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_23", b_trees:get("k_23", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_24", b_trees:get("k_24", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_25", b_trees:get("k_25", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_26", b_trees:get("k_26", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_27", b_trees:get("k_27", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_28", b_trees:get("k_28", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_29", b_trees:get("k_29", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_30", b_trees:get("k_30", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_31", b_trees:get("k_31", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual("v_32", b_trees:get("k_32", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertException(error, {key_not_found, "k_33"}, b_trees:get("k_33", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_00))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertException(error, {key_not_found, "k_05"}, b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertException(error, {key_not_found, "k_08"}, b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertException(error, {key_not_found, "k_11"}, b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertException(error, {key_not_found, "k_14"}, b_trees:get("k_14", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_14", b_trees:get("k_14", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_15", b_trees:get("k_15", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual("v_16", b_trees:get("k_16", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertException(error, {key_not_found, "k_17"}, b_trees:get("k_17", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_14", b_trees:get("k_14", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_15", b_trees:get("k_15", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_16", b_trees:get("k_16", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_17", b_trees:get("k_17", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_18", b_trees:get("k_18", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual("v_19", b_trees:get("k_19", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertException(error, {key_not_found, "k_20"}, b_trees:get("k_20", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + + ?assertException(error, {key_not_found, "k_00"}, b_trees:get("k_00", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_01", b_trees:get("k_01", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_02", b_trees:get("k_02", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_03", b_trees:get("k_03", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_04", b_trees:get("k_04", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_05", b_trees:get("k_05", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_06", b_trees:get("k_06", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_07", b_trees:get("k_07", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_08", b_trees:get("k_08", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_09", b_trees:get("k_09", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_10", b_trees:get("k_10", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_11", b_trees:get("k_11", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_12", b_trees:get("k_12", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_13", b_trees:get("k_13", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_14", b_trees:get("k_14", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_15", b_trees:get("k_15", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_16", b_trees:get("k_16", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_17", b_trees:get("k_17", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_18", b_trees:get("k_18", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_19", b_trees:get("k_19", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_20", b_trees:get("k_20", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_21", b_trees:get("k_21", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_22", b_trees:get("k_22", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_23", b_trees:get("k_23", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_24", b_trees:get("k_24", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_25", b_trees:get("k_25", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_26", b_trees:get("k_26", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_27", b_trees:get("k_27", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_28", b_trees:get("k_28", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_29", b_trees:get("k_29", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_30", b_trees:get("k_30", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_31", b_trees:get("k_31", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual("v_32", b_trees:get("k_32", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertException(error, {key_not_found, "k_33"}, b_trees:get("k_33", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -609,11 +609,11 @@ get_test() -> %%-------------------------------------------------------------------- height_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_desc(B_TREE_06_32))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_desc(B_TREE_06_32))), true = ets:delete(StateTarget), @@ -624,13 +624,13 @@ height_persistence_by_ets_test() -> %%-------------------------------------------------------------------- height_test() -> - ?assertException(error, {empty_tree, _}, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -639,29 +639,29 @@ height_test() -> %%-------------------------------------------------------------------- insert_b_tree_order_4_test() -> - test_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees:empty(4)), - test_generator:check_equal(?B_TREE_04_01, test_generator:generate_b_tree_from_number(4, 1, 2)), - test_generator:check_equal(?B_TREE_04_02, test_generator:generate_b_tree_from_number(4, 2, 2)), - test_generator:check_equal(?B_TREE_04_03, test_generator:generate_b_tree_from_number(4, 3, 2)), - test_generator:check_equal(?B_TREE_04_04, test_generator:generate_b_tree_from_number(4, 4, 2)), - test_generator:check_equal(?B_TREE_04_05, test_generator:generate_b_tree_from_number(4, 5, 2)), - test_generator:check_equal(?B_TREE_04_06, test_generator:generate_b_tree_from_number(4, 6, 2)), - test_generator:check_equal(?B_TREE_04_07, test_generator:generate_b_tree_from_number(4, 7, 2)), - test_generator:check_equal(?B_TREE_04_08, test_generator:generate_b_tree_from_number(4, 8, 2)), - test_generator:check_equal(?B_TREE_04_09, test_generator:generate_b_tree_from_number(4, 9, 2)), - test_generator:check_equal(?B_TREE_04_10, test_generator:generate_b_tree_from_number(4, 10, 2)), + b_trees_generator:check_equal(?B_TREE_04_01, b_trees_generator:generate_b_tree_from_number(4, 1, 2)), + b_trees_generator:check_equal(?B_TREE_04_02, b_trees_generator:generate_b_tree_from_number(4, 2, 2)), + b_trees_generator:check_equal(?B_TREE_04_03, b_trees_generator:generate_b_tree_from_number(4, 3, 2)), + b_trees_generator:check_equal(?B_TREE_04_04, b_trees_generator:generate_b_tree_from_number(4, 4, 2)), + b_trees_generator:check_equal(?B_TREE_04_05, b_trees_generator:generate_b_tree_from_number(4, 5, 2)), + b_trees_generator:check_equal(?B_TREE_04_06, b_trees_generator:generate_b_tree_from_number(4, 6, 2)), + b_trees_generator:check_equal(?B_TREE_04_07, b_trees_generator:generate_b_tree_from_number(4, 7, 2)), + b_trees_generator:check_equal(?B_TREE_04_08, b_trees_generator:generate_b_tree_from_number(4, 8, 2)), + b_trees_generator:check_equal(?B_TREE_04_09, b_trees_generator:generate_b_tree_from_number(4, 9, 2)), + b_trees_generator:check_equal(?B_TREE_04_10, b_trees_generator:generate_b_tree_from_number(4, 10, 2)), - test_generator:check_equal(?B_TREE_04_11, test_generator:generate_b_tree_from_number(4, 11, 2)), - test_generator:check_equal(?B_TREE_04_12, test_generator:generate_b_tree_from_number(4, 12, 2)), - test_generator:check_equal(?B_TREE_04_13, test_generator:generate_b_tree_from_number(4, 13, 2)), - test_generator:check_equal(?B_TREE_04_14, test_generator:generate_b_tree_from_number(4, 14, 2)), - test_generator:check_equal(?B_TREE_04_15, test_generator:generate_b_tree_from_number(4, 15, 2)), - test_generator:check_equal(?B_TREE_04_16, test_generator:generate_b_tree_from_number(4, 16, 2)), - test_generator:check_equal(?B_TREE_04_17, test_generator:generate_b_tree_from_number(4, 17, 2)), - test_generator:check_equal(?B_TREE_04_18, test_generator:generate_b_tree_from_number(4, 18, 2)), - test_generator:check_equal(?B_TREE_04_19, test_generator:generate_b_tree_from_number(4, 19, 2)), - test_generator:check_equal(?B_TREE_04_20, test_generator:generate_b_tree_from_number(4, 20, 2)), + b_trees_generator:check_equal(?B_TREE_04_11, b_trees_generator:generate_b_tree_from_number(4, 11, 2)), + b_trees_generator:check_equal(?B_TREE_04_12, b_trees_generator:generate_b_tree_from_number(4, 12, 2)), + b_trees_generator:check_equal(?B_TREE_04_13, b_trees_generator:generate_b_tree_from_number(4, 13, 2)), + b_trees_generator:check_equal(?B_TREE_04_14, b_trees_generator:generate_b_tree_from_number(4, 14, 2)), + b_trees_generator:check_equal(?B_TREE_04_15, b_trees_generator:generate_b_tree_from_number(4, 15, 2)), + b_trees_generator:check_equal(?B_TREE_04_16, b_trees_generator:generate_b_tree_from_number(4, 16, 2)), + b_trees_generator:check_equal(?B_TREE_04_17, b_trees_generator:generate_b_tree_from_number(4, 17, 2)), + b_trees_generator:check_equal(?B_TREE_04_18, b_trees_generator:generate_b_tree_from_number(4, 18, 2)), + b_trees_generator:check_equal(?B_TREE_04_19, b_trees_generator:generate_b_tree_from_number(4, 19, 2)), + b_trees_generator:check_equal(?B_TREE_04_20, b_trees_generator:generate_b_tree_from_number(4, 20, 2)), ok. @@ -671,75 +671,75 @@ insert_b_tree_order_4_test() -> %%-------------------------------------------------------------------- insert_b_tree_order_6_test() -> - test_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), - ?assertEqual(0, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {empty_tree, _}, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({0, 0}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_00))), - - test_generator:check_equal(?B_TREE_06_01, b_trees:insert("k_01", "v_01", test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(1, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_01))), - - test_generator:check_equal(?B_TREE_06_02, b_trees:insert("k_02", "v_02", test_generator:generate_b_tree_from_number(6, 1, 2))), - ?assertEqual(2, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_02))), - - test_generator:check_equal(?B_TREE_06_03, b_trees:insert("k_03", "v_03", test_generator:generate_b_tree_from_number(6, 2, 2))), - ?assertEqual(3, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_03))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_03))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_03))), - - test_generator:check_equal(?B_TREE_06_04, b_trees:insert("k_04", "v_04", test_generator:generate_b_tree_from_number(6, 3, 2))), - ?assertEqual(4, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_04))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_04))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_04))), - - test_generator:check_equal(?B_TREE_06_05, b_trees:insert("k_05", "v_05", test_generator:generate_b_tree_from_number(6, 4, 2))), - ?assertEqual(5, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual(0, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_05))), - - test_generator:check_equal(?B_TREE_06_09, b_trees:insert("k_09", "v_09", test_generator:generate_b_tree_from_number(6, 8, 2))), - ?assertEqual(9, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({4, 3}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_09))), - - test_generator:check_equal(?B_TREE_06_13, b_trees:insert("k_13", "v_13", test_generator:generate_b_tree_from_number(6, 12, 2))), - ?assertEqual(13, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_13))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_13))), - ?assertEqual({5, 4}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_13))), - - test_generator:check_equal(?B_TREE_06_17, b_trees:insert("k_17", "v_17", test_generator:generate_b_tree_from_number(6, 16, 2))), - ?assertEqual(17, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_17))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_17))), - ?assertEqual({6, 5}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_17))), - - test_generator:check_equal(?B_TREE_06_21, b_trees:insert("k_21", "v_21", test_generator:generate_b_tree_from_number(6, 20, 2))), - ?assertEqual(21, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual({10, 7}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_21))), - - test_generator:check_equal(?B_TREE_06_25, b_trees:insert("k_25", "v_25", test_generator:generate_b_tree_from_number(6, 24, 2))), - ?assertEqual(25, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_25))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_25))), - ?assertEqual({11, 8}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_25))), - - test_generator:check_equal(?B_TREE_06_29, b_trees:insert("k_29", "v_29", test_generator:generate_b_tree_from_number(6, 28, 2))), - ?assertEqual(29, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertEqual({13, 9}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_29))), - - test_generator:check_equal(?B_TREE_06_30, b_trees:insert("k_30", "v_30", test_generator:generate_b_tree_from_number(6, 29, 2))), - ?assertEqual(30, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_30))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_30))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_30))), - - test_generator:check_equal(?B_TREE_06_32_DESC, b_trees:insert("k_32", "v_32", test_generator:generate_b_tree_from_number(6, 31, 2, fun b_trees:sort_descending/2))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees:empty(6)), + ?assertEqual(0, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual({0, 0}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + + b_trees_generator:check_equal(?B_TREE_06_01, b_trees:insert("k_01", "v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual(1, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + + b_trees_generator:check_equal(?B_TREE_06_02, b_trees:insert("k_02", "v_02", b_trees_generator:generate_b_tree_from_number(6, 1, 2))), + ?assertEqual(2, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + + b_trees_generator:check_equal(?B_TREE_06_03, b_trees:insert("k_03", "v_03", b_trees_generator:generate_b_tree_from_number(6, 2, 2))), + ?assertEqual(3, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + + b_trees_generator:check_equal(?B_TREE_06_04, b_trees:insert("k_04", "v_04", b_trees_generator:generate_b_tree_from_number(6, 3, 2))), + ?assertEqual(4, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + + b_trees_generator:check_equal(?B_TREE_06_05, b_trees:insert("k_05", "v_05", b_trees_generator:generate_b_tree_from_number(6, 4, 2))), + ?assertEqual(5, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual(0, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + + b_trees_generator:check_equal(?B_TREE_06_09, b_trees:insert("k_09", "v_09", b_trees_generator:generate_b_tree_from_number(6, 8, 2))), + ?assertEqual(9, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({4, 3}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + + b_trees_generator:check_equal(?B_TREE_06_13, b_trees:insert("k_13", "v_13", b_trees_generator:generate_b_tree_from_number(6, 12, 2))), + ?assertEqual(13, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + ?assertEqual({5, 4}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + + b_trees_generator:check_equal(?B_TREE_06_17, b_trees:insert("k_17", "v_17", b_trees_generator:generate_b_tree_from_number(6, 16, 2))), + ?assertEqual(17, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_17))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_17))), + ?assertEqual({6, 5}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_17))), + + b_trees_generator:check_equal(?B_TREE_06_21, b_trees:insert("k_21", "v_21", b_trees_generator:generate_b_tree_from_number(6, 20, 2))), + ?assertEqual(21, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual({10, 7}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), + + b_trees_generator:check_equal(?B_TREE_06_25, b_trees:insert("k_25", "v_25", b_trees_generator:generate_b_tree_from_number(6, 24, 2))), + ?assertEqual(25, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_25))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_25))), + ?assertEqual({11, 8}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_25))), + + b_trees_generator:check_equal(?B_TREE_06_29, b_trees:insert("k_29", "v_29", b_trees_generator:generate_b_tree_from_number(6, 28, 2))), + ?assertEqual(29, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertEqual({13, 9}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + + b_trees_generator:check_equal(?B_TREE_06_30, b_trees:insert("k_30", "v_30", b_trees_generator:generate_b_tree_from_number(6, 29, 2))), + ?assertEqual(30, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_30))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_30))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_30))), + + b_trees_generator:check_equal(?B_TREE_06_32_DESC, b_trees:insert("k_32", "v_32", b_trees_generator:generate_b_tree_from_number(6, 31, 2, fun b_trees:sort_descending/2))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -748,30 +748,30 @@ insert_b_tree_order_6_test() -> %%-------------------------------------------------------------------- insert_b_tree_order_8_test() -> - test_generator:check_equal(?B_TREE_08_00, b_trees:empty(8)), - ?assertEqual(0, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_00))), - ?assertException(error, {empty_tree, _}, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_00))), - ?assertEqual({0, 0}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_00))), + b_trees_generator:check_equal(?B_TREE_08_00, b_trees:empty(8)), + ?assertEqual(0, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_00))), + ?assertException(error, {empty_tree, _}, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_00))), + ?assertEqual({0, 0}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_00))), - test_generator:check_equal(?B_TREE_06_07, b_trees:insert("k_07", "v_07", test_generator:generate_b_tree_from_number(6, 6, 2))), - ?assertEqual(7, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({3, 2}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_07))), + b_trees_generator:check_equal(?B_TREE_06_07, b_trees:insert("k_07", "v_07", b_trees_generator:generate_b_tree_from_number(6, 6, 2))), + ?assertEqual(7, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({3, 2}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_07))), - test_generator:check_equal(?B_TREE_08_16, b_trees:insert("k_16", "v_16", test_generator:generate_b_tree_from_number(8, 15, 2))), - ?assertEqual(16, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_16))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_16))), - ?assertEqual({5, 4}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_16))), + b_trees_generator:check_equal(?B_TREE_08_16, b_trees:insert("k_16", "v_16", b_trees_generator:generate_b_tree_from_number(8, 15, 2))), + ?assertEqual(16, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_16))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_16))), + ?assertEqual({5, 4}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_16))), - test_generator:check_equal(?B_TREE_08_32, b_trees:insert("k_32", "v_32", test_generator:generate_b_tree_from_number(8, 31, 2))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_32))), - ?assertEqual(1, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_32))), - ?assertEqual({9, 8}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_32))), + b_trees_generator:check_equal(?B_TREE_08_32, b_trees:insert("k_32", "v_32", b_trees_generator:generate_b_tree_from_number(8, 31, 2))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_32))), + ?assertEqual(1, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_32))), + ?assertEqual({9, 8}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_32))), - test_generator:check_equal(?B_TREE_08_64, b_trees:insert("k_64", "v_64", test_generator:generate_b_tree_from_number(8, 63, 2))), - ?assertEqual(64, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_08_64))), - ?assertEqual(2, b_trees:height(test_generator:prepare_template_asc(?B_TREE_08_64))), - ?assertEqual({20, 16}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_08_64))), + b_trees_generator:check_equal(?B_TREE_08_64, b_trees:insert("k_64", "v_64", b_trees_generator:generate_b_tree_from_number(8, 63, 2))), + ?assertEqual(64, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertEqual(2, b_trees:height(b_trees_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertEqual({20, 16}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_08_64))), ok. @@ -782,7 +782,7 @@ insert_b_tree_order_8_test() -> insert_b_tree_persistence_by_ets_test() -> StateTarget = ets:new(b_trees, []), - B_TREE_04_00 = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_04_00 = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), B_TREE_04_01 = b_trees:insert("k_01", "v_01", B_TREE_04_00), B_TREE_04_02 = b_trees:insert("k_02", "v_02", B_TREE_04_01), @@ -822,7 +822,7 @@ insert_b_tree_persistence_by_ets_test() -> true = ets:delete_all_objects(StateTarget), - test_generator:generate_b_tree_from_number_ets(4, 99, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + b_trees_generator:generate_b_tree_from_number_ets(4, 99, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), true = ets:delete(StateTarget), @@ -834,17 +834,17 @@ insert_b_tree_persistence_by_ets_test() -> %%-------------------------------------------------------------------- insert_clrs_test() -> - _B_TREE_CLRS_498_PLUS_B = b_trees:insert("k_b", "v_b", test_generator:prepare_template_asc(?B_TREE_CLRS_498)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B, _B_TREE_CLRS_498_PLUS_B), + _B_TREE_CLRS_498_PLUS_B = b_trees:insert("k_b", "v_b", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B, _B_TREE_CLRS_498_PLUS_B), - _B_TREE_CLRS_498_PLUS_B_Q = b_trees:insert("k_q", "v_q", test_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q, _B_TREE_CLRS_498_PLUS_B_Q), + _B_TREE_CLRS_498_PLUS_B_Q = b_trees:insert("k_q", "v_q", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q, _B_TREE_CLRS_498_PLUS_B_Q), - _B_TREE_CLRS_498_PLUS_B_Q_L = b_trees:insert("k_l", "v_l", test_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L, _B_TREE_CLRS_498_PLUS_B_Q_L), + _B_TREE_CLRS_498_PLUS_B_Q_L = b_trees:insert("k_l", "v_l", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L, _B_TREE_CLRS_498_PLUS_B_Q_L), - _B_TREE_CLRS_498_PLUS_B_Q_L_F = b_trees:insert("k_f", "v_f", test_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q_L)), - test_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L_F, _B_TREE_CLRS_498_PLUS_B_Q_L_F), + _B_TREE_CLRS_498_PLUS_B_Q_L_F = b_trees:insert("k_f", "v_f", b_trees_generator:prepare_template_asc(?B_TREE_CLRS_498_PLUS_B_Q_L)), + b_trees_generator:check_equal(?B_TREE_CLRS_498_PLUS_B_Q_L_F, _B_TREE_CLRS_498_PLUS_B_Q_L_F), ok. @@ -853,11 +853,11 @@ insert_clrs_test() -> %%-------------------------------------------------------------------- insert_error_test() -> - ?assertException(error, {key_exists, "k_01"}, b_trees:insert("k_01", "v_01", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_02"}, b_trees:insert("k_02", "v_02", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_03"}, b_trees:insert("k_03", "v_03", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_04"}, b_trees:insert("k_04", "v_04", test_generator:generate_b_tree_from_number(6, 5, 2))), - ?assertException(error, {key_exists, "k_05"}, b_trees:insert("k_05", "v_05", test_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_01"}, b_trees:insert("k_01", "v_01", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_02"}, b_trees:insert("k_02", "v_02", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_03"}, b_trees:insert("k_03", "v_03", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_04"}, b_trees:insert("k_04", "v_04", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), + ?assertException(error, {key_exists, "k_05"}, b_trees:insert("k_05", "v_05", b_trees_generator:generate_b_tree_from_number(6, 5, 2))), ok. @@ -866,7 +866,7 @@ insert_error_test() -> %%-------------------------------------------------------------------- is_defined_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -914,129 +914,129 @@ is_defined_persistence_by_ets_test() -> %%-------------------------------------------------------------------- is_defined_test() -> - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_04_00))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertNot(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_04_04))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertNot(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_06_07))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertNot(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_10_10))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertNot(b_trees:is_defined("k_14", test_generator:prepare_template_asc(?B_TREE_12_13))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_14", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_15", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assert(b_trees:is_defined("k_16", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertNot(b_trees:is_defined("k_17", test_generator:prepare_template_asc(?B_TREE_16_16))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_14", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_15", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_16", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_17", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_18", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assert(b_trees:is_defined("k_19", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertNot(b_trees:is_defined("k_20", test_generator:prepare_template_asc(?B_TREE_18_19))), - - ?assertNot(b_trees:is_defined("k_00", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_01", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_02", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_03", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_04", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_05", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_06", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_07", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_08", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_09", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_10", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_11", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_12", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_13", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_14", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_15", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_16", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_17", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_18", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_19", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_20", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_21", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_22", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_23", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_24", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_25", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_26", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_27", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_28", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_29", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_30", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_31", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assert(b_trees:is_defined("k_32", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertNot(b_trees:is_defined("k_33", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_00))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertNot(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertNot(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertNot(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertNot(b_trees:is_defined("k_14", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_14", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_15", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assert(b_trees:is_defined("k_16", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertNot(b_trees:is_defined("k_17", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_14", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_15", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_16", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_17", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_18", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assert(b_trees:is_defined("k_19", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertNot(b_trees:is_defined("k_20", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + + ?assertNot(b_trees:is_defined("k_00", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_01", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_02", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_03", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_04", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_05", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_06", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_07", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_08", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_09", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_10", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_11", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_12", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_13", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_14", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_15", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_16", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_17", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_18", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_19", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_20", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_21", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_22", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_23", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_24", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_25", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_26", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_27", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_28", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_29", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_30", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_31", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assert(b_trees:is_defined("k_32", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertNot(b_trees:is_defined("k_33", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1048,9 +1048,9 @@ is_defined_test() -> is_empty_persistence_by_ets_test() -> StateTarget = ets:new(b_trees, []), - B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_06_00 = b_trees:set_parameter(b_trees:empty(6), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), - ?assertEqual(true, b_trees:is_empty(test_generator:prepare_template_asc(B_TREE_06_00))), + ?assertEqual(true, b_trees:is_empty(b_trees_generator:prepare_template_asc(B_TREE_06_00))), true = ets:delete(StateTarget), @@ -1061,8 +1061,8 @@ is_empty_persistence_by_ets_test() -> %%-------------------------------------------------------------------- is_empty_test() -> - ?assertEqual(false, b_trees:is_empty(test_generator:prepare_template_asc(?B_TREE_32_01))), - ?assertEqual(true, b_trees:is_empty(test_generator:prepare_template_asc(?B_TREE_32_00))), + ?assertEqual(false, b_trees:is_empty(b_trees_generator:prepare_template_asc(?B_TREE_32_01))), + ?assertEqual(true, b_trees:is_empty(b_trees_generator:prepare_template_asc(?B_TREE_32_00))), ok. @@ -1075,13 +1075,13 @@ iterator_from_next_00_test() -> _Iterator_04_00_00 = b_trees:iterator_from("k_01", BTree_04_00), ?assertEqual(none, b_trees:next(_Iterator_04_00_00)), - BTree_04_01 = test_generator:generate_b_tree_from_number(4, 1, 2), + BTree_04_01 = b_trees_generator:generate_b_tree_from_number(4, 1, 2), Iterator_04_01_00 = b_trees:iterator_from("k_00", BTree_04_01), {_Key_04_01_01, _Value_04_01_01, _Iterator_04_01_01} = b_trees:next(Iterator_04_01_00), ?assertEqual({"k_01", "v_01"}, {_Key_04_01_01, _Value_04_01_01}), ?assertEqual(none, b_trees:next(_Iterator_04_01_01)), - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_01 = b_trees:iterator_from("k_00", BTree_04_16), {_Key_04_16_01, _Value_04_16_01, Iterator_04_16_02} = b_trees:next(Iterator_04_16_01), ?assertEqual({"k_01", "v_01"}, {_Key_04_16_01, _Value_04_16_01}), @@ -1095,7 +1095,7 @@ iterator_from_next_00_test() -> %%-------------------------------------------------------------------- iterator_from_next_01_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_01 = b_trees:iterator_from("k_01", BTree_04_16), {_Key_04_16_01, _Value_04_16_01, Iterator_04_16_02} = b_trees:next(Iterator_04_16_01), ?assertEqual({"k_01", "v_01"}, {_Key_04_16_01, _Value_04_16_01}), @@ -1109,7 +1109,7 @@ iterator_from_next_01_test() -> %%-------------------------------------------------------------------- iterator_from_next_02_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_02 = b_trees:iterator_from("k_02", BTree_04_16), {_Key_04_16_02, _Value_04_16_02, Iterator_04_16_03} = b_trees:next(Iterator_04_16_02), ?assertEqual({"k_02", "v_02"}, {_Key_04_16_02, _Value_04_16_02}), @@ -1123,7 +1123,7 @@ iterator_from_next_02_test() -> %%-------------------------------------------------------------------- iterator_from_next_03_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_03 = b_trees:iterator_from("k_03", BTree_04_16), {_Key_04_16_03, _Value_04_16_03, Iterator_04_16_04} = b_trees:next(Iterator_04_16_03), ?assertEqual({"k_03", "v_03"}, {_Key_04_16_03, _Value_04_16_03}), @@ -1137,7 +1137,7 @@ iterator_from_next_03_test() -> %%-------------------------------------------------------------------- iterator_from_next_04_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_04 = b_trees:iterator_from("k_04", BTree_04_16), {_Key_04_16_04, _Value_04_16_04, Iterator_04_16_05} = b_trees:next(Iterator_04_16_04), ?assertEqual({"k_04", "v_04"}, {_Key_04_16_04, _Value_04_16_04}), @@ -1153,25 +1153,25 @@ iterator_from_next_04_test() -> iterator_from_next_04_16_test() -> Number = 16, - BTree = test_generator:generate_b_tree_from_number(4, Number, 2), - KeyValues = test_generator:generate_key_values_from(Number, 2), + BTree = b_trees_generator:generate_b_tree_from_number(4, Number, 2), + KeyValues = b_trees_generator:generate_key_values_from(Number, 2), - ?assertEqual(lists:sublist(KeyValues, 1, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_00", BTree), Number - 0, [])), - ?assertEqual(lists:sublist(KeyValues, 2, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 1, [])), - ?assertEqual(lists:sublist(KeyValues, 3, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 2, [])), - ?assertEqual(lists:sublist(KeyValues, 4, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 3, [])), - ?assertEqual(lists:sublist(KeyValues, 5, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 4, [])), - ?assertEqual(lists:sublist(KeyValues, 6, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 5, [])), - ?assertEqual(lists:sublist(KeyValues, 7, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 6, [])), - ?assertEqual(lists:sublist(KeyValues, 8, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 7, [])), - ?assertEqual(lists:sublist(KeyValues, 9, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 8, [])), - ?assertEqual(lists:sublist(KeyValues, 10, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 9, [])), - ?assertEqual(lists:sublist(KeyValues, 11, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 10, [])), - ?assertEqual(lists:sublist(KeyValues, 12, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 11, [])), - ?assertEqual(lists:sublist(KeyValues, 13, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 12, [])), - ?assertEqual(lists:sublist(KeyValues, 14, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 13, [])), - ?assertEqual(lists:sublist(KeyValues, 15, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 14, [])), - ?assertEqual(lists:sublist(KeyValues, 16, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 15, [])), + ?assertEqual(lists:sublist(KeyValues, 1, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_00", BTree), Number - 0, [])), + ?assertEqual(lists:sublist(KeyValues, 2, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 1, [])), + ?assertEqual(lists:sublist(KeyValues, 3, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 2, [])), + ?assertEqual(lists:sublist(KeyValues, 4, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 3, [])), + ?assertEqual(lists:sublist(KeyValues, 5, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 4, [])), + ?assertEqual(lists:sublist(KeyValues, 6, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 5, [])), + ?assertEqual(lists:sublist(KeyValues, 7, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 6, [])), + ?assertEqual(lists:sublist(KeyValues, 8, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 7, [])), + ?assertEqual(lists:sublist(KeyValues, 9, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 8, [])), + ?assertEqual(lists:sublist(KeyValues, 10, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 9, [])), + ?assertEqual(lists:sublist(KeyValues, 11, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 10, [])), + ?assertEqual(lists:sublist(KeyValues, 12, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 11, [])), + ?assertEqual(lists:sublist(KeyValues, 13, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 12, [])), + ?assertEqual(lists:sublist(KeyValues, 14, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 13, [])), + ?assertEqual(lists:sublist(KeyValues, 15, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 14, [])), + ?assertEqual(lists:sublist(KeyValues, 16, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 15, [])), ok. @@ -1180,7 +1180,7 @@ iterator_from_next_04_16_test() -> %%-------------------------------------------------------------------- iterator_from_next_06_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_06 = b_trees:iterator_from("k_06", BTree_04_16), {_Key_04_16_06, _Value_04_16_06, Iterator_04_16_07} = b_trees:next(Iterator_04_16_06), ?assertEqual({"k_06", "v_06"}, {_Key_04_16_06, _Value_04_16_06}), @@ -1196,41 +1196,41 @@ iterator_from_next_06_test() -> iterator_from_next_06_32_test() -> Number = 32, - BTree = test_generator:generate_b_tree_from_number(6, Number, 2, fun b_trees:sort_descending/2), - KeyValues = test_generator:generate_key_values_till(Number, 2), - - ?assertEqual(lists:sublist(KeyValues, 1, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_33", BTree), Number - 0, [])), - ?assertEqual(lists:sublist(KeyValues, 2, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_31", BTree), Number - 1, [])), - ?assertEqual(lists:sublist(KeyValues, 3, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_30", BTree), Number - 2, [])), - ?assertEqual(lists:sublist(KeyValues, 4, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_29", BTree), Number - 3, [])), - ?assertEqual(lists:sublist(KeyValues, 5, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_28", BTree), Number - 4, [])), - ?assertEqual(lists:sublist(KeyValues, 6, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_27", BTree), Number - 5, [])), - ?assertEqual(lists:sublist(KeyValues, 7, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_26", BTree), Number - 6, [])), - ?assertEqual(lists:sublist(KeyValues, 8, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_25", BTree), Number - 7, [])), - ?assertEqual(lists:sublist(KeyValues, 9, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_24", BTree), Number - 8, [])), - ?assertEqual(lists:sublist(KeyValues, 10, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_23", BTree), Number - 9, [])), - ?assertEqual(lists:sublist(KeyValues, 11, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_22", BTree), Number - 10, [])), - ?assertEqual(lists:sublist(KeyValues, 12, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_21", BTree), Number - 11, [])), - ?assertEqual(lists:sublist(KeyValues, 13, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_20", BTree), Number - 12, [])), - ?assertEqual(lists:sublist(KeyValues, 14, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_19", BTree), Number - 13, [])), - ?assertEqual(lists:sublist(KeyValues, 15, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_18", BTree), Number - 14, [])), - ?assertEqual(lists:sublist(KeyValues, 16, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_17", BTree), Number - 15, [])), - ?assertEqual(lists:sublist(KeyValues, 17, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 16, [])), - ?assertEqual(lists:sublist(KeyValues, 18, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 17, [])), - ?assertEqual(lists:sublist(KeyValues, 19, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 18, [])), - ?assertEqual(lists:sublist(KeyValues, 20, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 19, [])), - ?assertEqual(lists:sublist(KeyValues, 21, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 20, [])), - ?assertEqual(lists:sublist(KeyValues, 22, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 21, [])), - ?assertEqual(lists:sublist(KeyValues, 23, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 22, [])), - ?assertEqual(lists:sublist(KeyValues, 24, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 23, [])), - ?assertEqual(lists:sublist(KeyValues, 25, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 24, [])), - ?assertEqual(lists:sublist(KeyValues, 26, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 25, [])), - ?assertEqual(lists:sublist(KeyValues, 27, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 26, [])), - ?assertEqual(lists:sublist(KeyValues, 28, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 27, [])), - ?assertEqual(lists:sublist(KeyValues, 29, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 28, [])), - ?assertEqual(lists:sublist(KeyValues, 30, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 29, [])), - ?assertEqual(lists:sublist(KeyValues, 31, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 30, [])), - ?assertEqual(lists:sublist(KeyValues, 32, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_01", BTree), Number - 31, [])), + BTree = b_trees_generator:generate_b_tree_from_number(6, Number, 2, fun b_trees:sort_descending/2), + KeyValues = b_trees_generator:generate_key_values_till(Number, 2), + + ?assertEqual(lists:sublist(KeyValues, 1, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_33", BTree), Number - 0, [])), + ?assertEqual(lists:sublist(KeyValues, 2, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_31", BTree), Number - 1, [])), + ?assertEqual(lists:sublist(KeyValues, 3, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_30", BTree), Number - 2, [])), + ?assertEqual(lists:sublist(KeyValues, 4, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_29", BTree), Number - 3, [])), + ?assertEqual(lists:sublist(KeyValues, 5, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_28", BTree), Number - 4, [])), + ?assertEqual(lists:sublist(KeyValues, 6, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_27", BTree), Number - 5, [])), + ?assertEqual(lists:sublist(KeyValues, 7, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_26", BTree), Number - 6, [])), + ?assertEqual(lists:sublist(KeyValues, 8, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_25", BTree), Number - 7, [])), + ?assertEqual(lists:sublist(KeyValues, 9, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_24", BTree), Number - 8, [])), + ?assertEqual(lists:sublist(KeyValues, 10, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_23", BTree), Number - 9, [])), + ?assertEqual(lists:sublist(KeyValues, 11, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_22", BTree), Number - 10, [])), + ?assertEqual(lists:sublist(KeyValues, 12, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_21", BTree), Number - 11, [])), + ?assertEqual(lists:sublist(KeyValues, 13, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_20", BTree), Number - 12, [])), + ?assertEqual(lists:sublist(KeyValues, 14, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_19", BTree), Number - 13, [])), + ?assertEqual(lists:sublist(KeyValues, 15, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_18", BTree), Number - 14, [])), + ?assertEqual(lists:sublist(KeyValues, 16, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_17", BTree), Number - 15, [])), + ?assertEqual(lists:sublist(KeyValues, 17, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_16", BTree), Number - 16, [])), + ?assertEqual(lists:sublist(KeyValues, 18, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_15", BTree), Number - 17, [])), + ?assertEqual(lists:sublist(KeyValues, 19, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_14", BTree), Number - 18, [])), + ?assertEqual(lists:sublist(KeyValues, 20, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_13", BTree), Number - 19, [])), + ?assertEqual(lists:sublist(KeyValues, 21, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_12", BTree), Number - 20, [])), + ?assertEqual(lists:sublist(KeyValues, 22, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_11", BTree), Number - 21, [])), + ?assertEqual(lists:sublist(KeyValues, 23, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_10", BTree), Number - 22, [])), + ?assertEqual(lists:sublist(KeyValues, 24, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_09", BTree), Number - 23, [])), + ?assertEqual(lists:sublist(KeyValues, 25, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_08", BTree), Number - 24, [])), + ?assertEqual(lists:sublist(KeyValues, 26, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_07", BTree), Number - 25, [])), + ?assertEqual(lists:sublist(KeyValues, 27, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_06", BTree), Number - 26, [])), + ?assertEqual(lists:sublist(KeyValues, 28, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_05", BTree), Number - 27, [])), + ?assertEqual(lists:sublist(KeyValues, 29, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_04", BTree), Number - 28, [])), + ?assertEqual(lists:sublist(KeyValues, 30, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_03", BTree), Number - 29, [])), + ?assertEqual(lists:sublist(KeyValues, 31, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_02", BTree), Number - 30, [])), + ?assertEqual(lists:sublist(KeyValues, 32, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_01", BTree), Number - 31, [])), ok. @@ -1241,33 +1241,33 @@ iterator_from_next_06_32_test() -> iterator_from_next_08_256_test() -> Number = 256, - BTree = test_generator:generate_b_tree_from_number(4, Number, 3), - KeyValues = test_generator:generate_key_values_from(Number, 3), - - ?assertEqual(lists:sublist(KeyValues, 1, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_000", BTree), Number - 0, [])), - ?assertEqual(lists:sublist(KeyValues, 2, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_002", BTree), Number - 1, [])), - ?assertEqual(lists:sublist(KeyValues, 3, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_003", BTree), Number - 2, [])), - ?assertEqual(lists:sublist(KeyValues, 4, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_004", BTree), Number - 3, [])), - ?assertEqual(lists:sublist(KeyValues, 5, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_005", BTree), Number - 4, [])), - ?assertEqual(lists:sublist(KeyValues, 7, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_007", BTree), Number - 6, [])), - ?assertEqual(lists:sublist(KeyValues, 8, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_008", BTree), Number - 7, [])), - ?assertEqual(lists:sublist(KeyValues, 11, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_011", BTree), Number - 10, [])), - ?assertEqual(lists:sublist(KeyValues, 13, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_013", BTree), Number - 12, [])), - ?assertEqual(lists:sublist(KeyValues, 16, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_016", BTree), Number - 15, [])), - ?assertEqual(lists:sublist(KeyValues, 17, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_017", BTree), Number - 16, [])), - ?assertEqual(lists:sublist(KeyValues, 19, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_019", BTree), Number - 18, [])), - ?assertEqual(lists:sublist(KeyValues, 23, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_023", BTree), Number - 22, [])), - ?assertEqual(lists:sublist(KeyValues, 29, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_029", BTree), Number - 28, [])), - ?assertEqual(lists:sublist(KeyValues, 31, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_031", BTree), Number - 30, [])), - ?assertEqual(lists:sublist(KeyValues, 32, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_032", BTree), Number - 31, [])), - ?assertEqual(lists:sublist(KeyValues, 37, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_037", BTree), Number - 36, [])), - ?assertEqual(lists:sublist(KeyValues, 41, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_041", BTree), Number - 40, [])), - ?assertEqual(lists:sublist(KeyValues, 43, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_043", BTree), Number - 42, [])), - ?assertEqual(lists:sublist(KeyValues, 47, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_047", BTree), Number - 46, [])), - ?assertEqual(lists:sublist(KeyValues, 49, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_049", BTree), Number - 48, [])), - ?assertEqual(lists:sublist(KeyValues, 64, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_064", BTree), Number - 63, [])), - ?assertEqual(lists:sublist(KeyValues, 128, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_128", BTree), Number - 127, [])), - ?assertEqual(lists:sublist(KeyValues, 256, Number), test_generator:iterate_next_b_tree(b_trees:iterator_from("k_256", BTree), Number - 255, [])), + BTree = b_trees_generator:generate_b_tree_from_number(4, Number, 3), + KeyValues = b_trees_generator:generate_key_values_from(Number, 3), + + ?assertEqual(lists:sublist(KeyValues, 1, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_000", BTree), Number - 0, [])), + ?assertEqual(lists:sublist(KeyValues, 2, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_002", BTree), Number - 1, [])), + ?assertEqual(lists:sublist(KeyValues, 3, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_003", BTree), Number - 2, [])), + ?assertEqual(lists:sublist(KeyValues, 4, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_004", BTree), Number - 3, [])), + ?assertEqual(lists:sublist(KeyValues, 5, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_005", BTree), Number - 4, [])), + ?assertEqual(lists:sublist(KeyValues, 7, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_007", BTree), Number - 6, [])), + ?assertEqual(lists:sublist(KeyValues, 8, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_008", BTree), Number - 7, [])), + ?assertEqual(lists:sublist(KeyValues, 11, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_011", BTree), Number - 10, [])), + ?assertEqual(lists:sublist(KeyValues, 13, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_013", BTree), Number - 12, [])), + ?assertEqual(lists:sublist(KeyValues, 16, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_016", BTree), Number - 15, [])), + ?assertEqual(lists:sublist(KeyValues, 17, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_017", BTree), Number - 16, [])), + ?assertEqual(lists:sublist(KeyValues, 19, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_019", BTree), Number - 18, [])), + ?assertEqual(lists:sublist(KeyValues, 23, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_023", BTree), Number - 22, [])), + ?assertEqual(lists:sublist(KeyValues, 29, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_029", BTree), Number - 28, [])), + ?assertEqual(lists:sublist(KeyValues, 31, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_031", BTree), Number - 30, [])), + ?assertEqual(lists:sublist(KeyValues, 32, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_032", BTree), Number - 31, [])), + ?assertEqual(lists:sublist(KeyValues, 37, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_037", BTree), Number - 36, [])), + ?assertEqual(lists:sublist(KeyValues, 41, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_041", BTree), Number - 40, [])), + ?assertEqual(lists:sublist(KeyValues, 43, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_043", BTree), Number - 42, [])), + ?assertEqual(lists:sublist(KeyValues, 47, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_047", BTree), Number - 46, [])), + ?assertEqual(lists:sublist(KeyValues, 49, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_049", BTree), Number - 48, [])), + ?assertEqual(lists:sublist(KeyValues, 64, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_064", BTree), Number - 63, [])), + ?assertEqual(lists:sublist(KeyValues, 128, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_128", BTree), Number - 127, [])), + ?assertEqual(lists:sublist(KeyValues, 256, Number), b_trees_generator:iterate_next_b_tree(b_trees:iterator_from("k_256", BTree), Number - 255, [])), ok. @@ -1276,7 +1276,7 @@ iterator_from_next_08_256_test() -> %%-------------------------------------------------------------------- iterator_from_next_16_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_16 = b_trees:iterator_from("k_16", BTree_04_16), {_Key_04_16_16, _Value_04_16_16, Iterator_04_16_17} = b_trees:next(Iterator_04_16_16), ?assertEqual({"k_16", "v_16"}, {_Key_04_16_16, _Value_04_16_16}), @@ -1289,7 +1289,7 @@ iterator_from_next_16_test() -> %%-------------------------------------------------------------------- iterator_from_next_17_test() -> - BTree_04_16 = test_generator:generate_b_tree_from_number(4, 16, 2), + BTree_04_16 = b_trees_generator:generate_b_tree_from_number(4, 16, 2), Iterator_04_16_17 = b_trees:iterator_from("k_17", BTree_04_16), none = b_trees:next(Iterator_04_16_17), @@ -1300,7 +1300,7 @@ iterator_from_next_17_test() -> %%-------------------------------------------------------------------- iterator_next_from_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -1351,7 +1351,7 @@ iterator_next_from_persistence_by_ets_test() -> %%-------------------------------------------------------------------- iterator_next_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -1436,13 +1436,13 @@ iterator_next_test() -> _Iterator_06_00_00 = b_trees:iterator(BTree_06_00), ?assertEqual(none, b_trees:next(_Iterator_06_00_00)), - BTree_06_01 = test_generator:generate_b_tree_from_number(6, 1, 2), + BTree_06_01 = b_trees_generator:generate_b_tree_from_number(6, 1, 2), Iterator_06_01_00 = b_trees:iterator(BTree_06_01), {_Key_06_01_01, _Value_05_01_01, _Iterator_06_01_01} = b_trees:next(Iterator_06_01_00), ?assertEqual({"k_01", "v_01"}, {_Key_06_01_01, _Value_05_01_01}), ?assertEqual(none, b_trees:next(_Iterator_06_01_01)), - BTree_06_30 = test_generator:generate_b_tree_from_number(6, 30, 2), + BTree_06_30 = b_trees_generator:generate_b_tree_from_number(6, 30, 2), Iterator_06_30_00 = b_trees:iterator(BTree_06_30), {_Key_06_30_01, _Value_05_30_01, Iterator_06_30_01} = b_trees:next(Iterator_06_30_00), ?assertEqual({"k_01", "v_01"}, {_Key_06_30_01, _Value_05_30_01}), @@ -1513,12 +1513,12 @@ iterator_next_test() -> %%-------------------------------------------------------------------- keys_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - _Keys_06_32 = b_trees:keys(test_generator:prepare_template_asc(B_TREE_06_32)), - ?assertEqual(test_generator:generate_keys_from(32, 2), _Keys_06_32), + _Keys_06_32 = b_trees:keys(b_trees_generator:prepare_template_asc(B_TREE_06_32)), + ?assertEqual(b_trees_generator:generate_keys_from(32, 2), _Keys_06_32), ?assertEqual(32, length(_Keys_06_32)), true = ets:delete(StateTarget), @@ -1530,28 +1530,28 @@ keys_persistence_by_ets_test() -> %%-------------------------------------------------------------------- keys_test() -> - ?assertEqual([], b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual([], b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(["k_01"], b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(["k_01"], b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - _Keys_06_02 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_02)), - ?assertEqual(test_generator:generate_keys_from(2, 2), _Keys_06_02), + _Keys_06_02 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_02)), + ?assertEqual(b_trees_generator:generate_keys_from(2, 2), _Keys_06_02), ?assertEqual(2, length(_Keys_06_02)), - _Keys_06_05 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_05)), - ?assertEqual(test_generator:generate_keys_from(5, 2), _Keys_06_05), + _Keys_06_05 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_05)), + ?assertEqual(b_trees_generator:generate_keys_from(5, 2), _Keys_06_05), ?assertEqual(5, length(_Keys_06_05)), - _Keys_06_09 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_09)), - ?assertEqual(test_generator:generate_keys_from(9, 2), _Keys_06_09), + _Keys_06_09 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_09)), + ?assertEqual(b_trees_generator:generate_keys_from(9, 2), _Keys_06_09), ?assertEqual(9, length(_Keys_06_09)), - _Keys_06_16 = b_trees:keys(test_generator:prepare_template_asc(?B_TREE_06_16)), - ?assertEqual(test_generator:generate_keys_from(16, 2), _Keys_06_16), + _Keys_06_16 = b_trees:keys(b_trees_generator:prepare_template_asc(?B_TREE_06_16)), + ?assertEqual(b_trees_generator:generate_keys_from(16, 2), _Keys_06_16), ?assertEqual(16, length(_Keys_06_16)), - _Keys_06_32 = b_trees:keys(test_generator:prepare_template_desc(?B_TREE_06_32_DESC)), - ?assertEqual(test_generator:generate_keys_till(32, 2), _Keys_06_32), + _Keys_06_32 = b_trees:keys(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)), + ?assertEqual(b_trees_generator:generate_keys_till(32, 2), _Keys_06_32), ?assertEqual(32, length(_Keys_06_32)), ok. @@ -1561,7 +1561,7 @@ keys_test() -> %%-------------------------------------------------------------------- largest_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -1576,17 +1576,17 @@ largest_persistence_by_ets_test() -> %%-------------------------------------------------------------------- largest_test() -> - ?assertException(error, {empty_tree, _}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({"k_01", "v_01"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({"k_02", "v_02"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual({"k_05", "v_05"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual({"k_09", "v_09"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"k_16", "v_16"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_06_16))), + ?assertEqual({"k_01", "v_01"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({"k_02", "v_02"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual({"k_05", "v_05"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual({"k_09", "v_09"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"k_16", "v_16"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_06_16))), - ?assertEqual({"k_19", "v_19"}, b_trees:largest(test_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({"k_19", "v_19"}, b_trees:largest(b_trees_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({"k_01", "v_01"}, b_trees:largest(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({"k_01", "v_01"}, b_trees:largest(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1595,7 +1595,7 @@ largest_test() -> %%-------------------------------------------------------------------- lookup_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -1643,129 +1643,129 @@ lookup_persistence_by_ets_test() -> %%-------------------------------------------------------------------- lookup_test() -> - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_04_00))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_04_04))), - ?assertEqual(none, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_04_04))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), - ?assertEqual(none, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_06_07))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_10_10))), - ?assertEqual(none, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_10_10))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_asc(?B_TREE_12_13))), - ?assertEqual(none, b_trees:lookup("k_14", test_generator:prepare_template_asc(?B_TREE_12_13))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", test_generator:prepare_template_asc(?B_TREE_16_16))), - ?assertEqual(none, b_trees:lookup("k_17", test_generator:prepare_template_asc(?B_TREE_16_16))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", test_generator:prepare_template_asc(?B_TREE_18_19))), - ?assertEqual(none, b_trees:lookup("k_20", test_generator:prepare_template_asc(?B_TREE_18_19))), - - ?assertEqual(none, b_trees:lookup("k_00", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_20"}, b_trees:lookup("k_20", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_21"}, b_trees:lookup("k_21", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_22"}, b_trees:lookup("k_22", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_23"}, b_trees:lookup("k_23", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_24"}, b_trees:lookup("k_24", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_25"}, b_trees:lookup("k_25", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_26"}, b_trees:lookup("k_26", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_27"}, b_trees:lookup("k_27", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_28"}, b_trees:lookup("k_28", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_29"}, b_trees:lookup("k_29", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_30"}, b_trees:lookup("k_30", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_31"}, b_trees:lookup("k_31", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({value, "v_32"}, b_trees:lookup("k_32", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual(none, b_trees:lookup("k_33", test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_00))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + ?assertEqual(none, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_04_04))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual(none, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + ?assertEqual(none, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_10_10))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + ?assertEqual(none, b_trees:lookup("k_14", b_trees_generator:prepare_template_asc(?B_TREE_12_13))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + ?assertEqual(none, b_trees:lookup("k_17", b_trees_generator:prepare_template_asc(?B_TREE_16_16))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual(none, b_trees:lookup("k_20", b_trees_generator:prepare_template_asc(?B_TREE_18_19))), + + ?assertEqual(none, b_trees:lookup("k_00", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_01"}, b_trees:lookup("k_01", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_02"}, b_trees:lookup("k_02", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_03"}, b_trees:lookup("k_03", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_04"}, b_trees:lookup("k_04", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_05"}, b_trees:lookup("k_05", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_06"}, b_trees:lookup("k_06", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_07"}, b_trees:lookup("k_07", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_08"}, b_trees:lookup("k_08", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_09"}, b_trees:lookup("k_09", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_10"}, b_trees:lookup("k_10", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_11"}, b_trees:lookup("k_11", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_12"}, b_trees:lookup("k_12", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_13"}, b_trees:lookup("k_13", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_14"}, b_trees:lookup("k_14", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_15"}, b_trees:lookup("k_15", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_16"}, b_trees:lookup("k_16", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_17"}, b_trees:lookup("k_17", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_18"}, b_trees:lookup("k_18", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_19"}, b_trees:lookup("k_19", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_20"}, b_trees:lookup("k_20", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_21"}, b_trees:lookup("k_21", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_22"}, b_trees:lookup("k_22", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_23"}, b_trees:lookup("k_23", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_24"}, b_trees:lookup("k_24", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_25"}, b_trees:lookup("k_25", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_26"}, b_trees:lookup("k_26", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_27"}, b_trees:lookup("k_27", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_28"}, b_trees:lookup("k_28", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_29"}, b_trees:lookup("k_29", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_30"}, b_trees:lookup("k_30", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_31"}, b_trees:lookup("k_31", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({value, "v_32"}, b_trees:lookup("k_32", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(none, b_trees:lookup("k_33", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1774,15 +1774,15 @@ lookup_test() -> %%-------------------------------------------------------------------- map_b_tree_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), - B_TREE_04_32_MAPPED = b_trees:map(fun test_generator:map_value_to_new/2, B_TREE_04_32), + B_TREE_04_32_MAPPED = b_trees:map(fun b_trees_generator:map_value_to_new/2, B_TREE_04_32), B_TREE_04_32_MAPPED_VALUES = b_trees:to_list(B_TREE_04_32_MAPPED), - ?assertEqual(B_TREE_04_32_MAPPED_VALUES, test_generator:generate_key_values_from_update(32, 2)), + ?assertEqual(B_TREE_04_32_MAPPED_VALUES, b_trees_generator:generate_key_values_from_update(32, 2)), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_04_32_MAPPED), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -1796,9 +1796,9 @@ map_b_tree_persistence_by_ets_test() -> %%-------------------------------------------------------------------- map_b_tree_test() -> - test_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:map(fun test_generator:map_value_to_new/2, test_generator:prepare_template_asc(?B_TREE_04_15))), + b_trees_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:map(fun b_trees_generator:map_value_to_new/2, b_trees_generator:prepare_template_asc(?B_TREE_04_15))), - test_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:map(fun test_generator:map_value_to_new/2, test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + b_trees_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:map(fun b_trees_generator:map_value_to_new/2, b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1807,7 +1807,7 @@ map_b_tree_test() -> %%-------------------------------------------------------------------- map_error_test() -> - ?assertException(error, {empty_tree, _}, b_trees:map(fun test_generator:map_value_to_new/2, test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:map(fun b_trees_generator:map_value_to_new/2, b_trees_generator:prepare_template_asc(?B_TREE_06_00))), ok. @@ -1818,8 +1818,8 @@ map_error_test() -> set_parameter_test() -> BTree_06_00 = b_trees:empty(6), BTree_06_00_DESC = b_trees:set_parameter(BTree_06_00, sort, fun b_trees:sort_descending/2), - KeyValues = test_generator:generate_key_values_from(32, 2), - test_generator:check_equal(?B_TREE_06_32_DESC, test_generator:generate_b_tree_list_and_btree(KeyValues, BTree_06_00_DESC)), + KeyValues = b_trees_generator:generate_key_values_from(32, 2), + b_trees_generator:check_equal(?B_TREE_06_32_DESC, b_trees_generator:generate_b_tree_list_and_btree(KeyValues, BTree_06_00_DESC)), ok. @@ -1828,11 +1828,11 @@ set_parameter_test() -> %%-------------------------------------------------------------------- size_key_values_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_desc(B_TREE_06_32))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_desc(B_TREE_06_32))), true = ets:delete(StateTarget), @@ -1843,15 +1843,15 @@ size_key_values_persistence_by_ets_test() -> %%-------------------------------------------------------------------- size_key_values_test() -> - ?assertEqual(0, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(2, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual(5, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual(16, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_16))), - ?assertEqual(29, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertEqual(0, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual(2, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual(5, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual(16, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_16))), + ?assertEqual(29, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertEqual(32, b_trees:size_key_values(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual(32, b_trees:size_key_values(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual(19, b_trees:size_key_values(test_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual(19, b_trees:size_key_values(b_trees_generator:prepare_template_asc(?B_TREE_18_19))), ok. @@ -1860,11 +1860,11 @@ size_key_values_test() -> %%-------------------------------------------------------------------- size_nodes_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_desc(B_TREE_06_32))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_desc(B_TREE_06_32))), true = ets:delete(StateTarget), @@ -1877,13 +1877,13 @@ size_nodes_persistence_by_ets_test() -> size_nodes_test() -> ?assertEqual({0, 0}, b_trees:size_nodes(b_trees:empty(6))), - ?assertEqual({1, 1}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_03))), - ?assertEqual({3, 2}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_08))), - ?assertEqual({5, 4}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_13))), - ?assertEqual({7, 6}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_20))), - ?assertEqual({10, 7}, b_trees:size_nodes(test_generator:prepare_template_asc(?B_TREE_06_21))), + ?assertEqual({1, 1}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_03))), + ?assertEqual({3, 2}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_08))), + ?assertEqual({5, 4}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_13))), + ?assertEqual({7, 6}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_20))), + ?assertEqual({10, 7}, b_trees:size_nodes(b_trees_generator:prepare_template_asc(?B_TREE_06_21))), - ?assertEqual({14, 10}, b_trees:size_nodes(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({14, 10}, b_trees:size_nodes(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), ok. @@ -1892,7 +1892,7 @@ size_nodes_test() -> %%-------------------------------------------------------------------- smallest_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -1907,17 +1907,17 @@ smallest_persistence_by_ets_test() -> %%-------------------------------------------------------------------- smallest_test() -> - ?assertException(error, {empty_tree, _}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_05))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_06_16))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_05))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_06_16))), - ?assertEqual({"k_32", "v_32"}, b_trees:smallest(test_generator:prepare_template_desc(?B_TREE_06_32_DESC))), + ?assertEqual({"k_32", "v_32"}, b_trees:smallest(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC))), - ?assertEqual({"k_01", "v_01"}, b_trees:smallest(test_generator:prepare_template_asc(?B_TREE_18_19))), + ?assertEqual({"k_01", "v_01"}, b_trees:smallest(b_trees_generator:prepare_template_asc(?B_TREE_18_19))), ok. @@ -1926,11 +1926,11 @@ smallest_test() -> %%-------------------------------------------------------------------- take_any_test() -> - ?assertEqual(error, b_trees:take_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take_any("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual(error, b_trees:take_any("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_03)}, b_trees:take_any("k_04", test_generator:prepare_template_asc(?B_TREE_06_04))), - ?assertEqual({"v_07", test_generator:prepare_template_asc(?B_TREE_06_06)}, b_trees:take_any("k_07", test_generator:prepare_template_asc(?B_TREE_06_07))), + ?assertEqual(error, b_trees:take_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take_any("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(error, b_trees:take_any("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_03)}, b_trees:take_any("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_04))), + ?assertEqual({"v_07", b_trees_generator:prepare_template_asc(?B_TREE_06_06)}, b_trees:take_any("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_07))), ok. @@ -1939,30 +1939,30 @@ take_any_test() -> %%-------------------------------------------------------------------- take_b_tree_order_4_test() -> - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_04_10_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_04_10))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_04_10_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_10))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_04_17))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), - ?assertEqual({"v_12", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_12)}, b_trees:take("k_12", test_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_17))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02))), + ?assertEqual({"v_12", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_12)}, b_trees:take("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_17_MINUS_02_TILL_10))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_10", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_10)}, b_trees:take("k_10", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_12", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_12)}, b_trees:take("k_12", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_14", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_14)}, b_trees:take("k_14", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_16", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_16)}, b_trees:take("k_16", test_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_18", test_generator:prepare_template_asc(?B_TREE_04_20_MINUS_18)}, b_trees:take("k_18", test_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_10", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_10)}, b_trees:take("k_10", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_12", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_12)}, b_trees:take("k_12", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_14", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_14)}, b_trees:take("k_14", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_16", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_16)}, b_trees:take("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), + ?assertEqual({"v_18", b_trees_generator:prepare_template_asc(?B_TREE_04_20_MINUS_18)}, b_trees:take("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_20))), - ?assertEqual({"v_18", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18)}, b_trees:take("k_18", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), - ?assertEqual({"v_20", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20)}, b_trees:take("k_20", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), - ?assertEqual({"v_22", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_22)}, b_trees:take("k_22", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), - ?assertEqual({"v_30", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_30)}, b_trees:take("k_30", test_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), + ?assertEqual({"v_18", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18)}, b_trees:take("k_18", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_16))), + ?assertEqual({"v_20", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20)}, b_trees:take("k_20", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_18))), + ?assertEqual({"v_22", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_22)}, b_trees:take("k_22", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_20))), + ?assertEqual({"v_30", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_30)}, b_trees:take("k_30", b_trees_generator:prepare_template_asc(?B_TREE_04_33_MINUS_02_TILL_28))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_04_64_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_04_64))), - ?assertEqual({"v_16", test_generator:prepare_template_asc(?B_TREE_04_64_MINUS_16)}, b_trees:take("k_16", test_generator:prepare_template_asc(?B_TREE_04_64))), - ?assertEqual({"v_32", test_generator:prepare_template_asc(?B_TREE_04_64_MINUS_32)}, b_trees:take("k_32", test_generator:prepare_template_asc(?B_TREE_04_64))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_04_64_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + ?assertEqual({"v_16", b_trees_generator:prepare_template_asc(?B_TREE_04_64_MINUS_16)}, b_trees:take("k_16", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), + ?assertEqual({"v_32", b_trees_generator:prepare_template_asc(?B_TREE_04_64_MINUS_32)}, b_trees:take("k_32", b_trees_generator:prepare_template_asc(?B_TREE_04_64))), ok. @@ -1971,35 +1971,35 @@ take_b_tree_order_4_test() -> %%-------------------------------------------------------------------- take_b_tree_order_6_test() -> - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_01))), - - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_01)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_03", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_03)}, b_trees:take("k_03", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_05", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_05)}, b_trees:take("k_05", test_generator:prepare_template_asc(?B_TREE_06_06))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_06_06_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_06_06))), - - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_01)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_03", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_03)}, b_trees:take("k_03", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_05", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_05)}, b_trees:take("k_05", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_07", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_07)}, b_trees:take("k_07", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_06_09))), - ?assertEqual({"v_09", test_generator:prepare_template_asc(?B_TREE_06_09_MINUS_09)}, b_trees:take("k_09", test_generator:prepare_template_asc(?B_TREE_06_09))), - - ?assertEqual({"v_01", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_01)}, b_trees:take("k_01", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_02", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_02)}, b_trees:take("k_02", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_03", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_03)}, b_trees:take("k_03", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_04", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_04)}, b_trees:take("k_04", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_05", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_05)}, b_trees:take("k_05", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_06", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_06)}, b_trees:take("k_06", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_07", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_07)}, b_trees:take("k_07", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_08", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_08)}, b_trees:take("k_08", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_09", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_09)}, b_trees:take("k_09", test_generator:prepare_template_asc(?B_TREE_06_10))), - ?assertEqual({"v_10", test_generator:prepare_template_asc(?B_TREE_06_10_MINUS_10)}, b_trees:take("k_10", test_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_00)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), + + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_01)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_03", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_03)}, b_trees:take("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_05", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_05)}, b_trees:take("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_06_06_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_06))), + + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_01)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_03", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_03)}, b_trees:take("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_05", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_05)}, b_trees:take("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_07", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_07)}, b_trees:take("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertEqual({"v_09", b_trees_generator:prepare_template_asc(?B_TREE_06_09_MINUS_09)}, b_trees:take("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), + + ?assertEqual({"v_01", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_01)}, b_trees:take("k_01", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_02", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_02)}, b_trees:take("k_02", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_03", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_03)}, b_trees:take("k_03", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_04", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_04)}, b_trees:take("k_04", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_05", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_05)}, b_trees:take("k_05", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_06", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_06)}, b_trees:take("k_06", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_07", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_07)}, b_trees:take("k_07", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_08", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_08)}, b_trees:take("k_08", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_09", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_09)}, b_trees:take("k_09", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), + ?assertEqual({"v_10", b_trees_generator:prepare_template_asc(?B_TREE_06_10_MINUS_10)}, b_trees:take("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_10))), ok. @@ -2008,11 +2008,11 @@ take_b_tree_order_6_test() -> %%-------------------------------------------------------------------- take_error_test() -> - ?assertException(error, {badmatch, none}, b_trees:take("k_00", test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {badmatch, none}, b_trees:take("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {badmatch, none}, b_trees:take("k_00", test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertException(error, {badmatch, none}, b_trees:take("k_00", b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertException(error, {badmatch, none}, b_trees:take("k_10", test_generator:prepare_template_asc(?B_TREE_06_09))), + ?assertException(error, {badmatch, none}, b_trees:take("k_10", b_trees_generator:prepare_template_asc(?B_TREE_06_09))), ok. @@ -2021,7 +2021,7 @@ take_error_test() -> %%-------------------------------------------------------------------- take_largest_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -2074,28 +2074,28 @@ take_largest_persistence_by_ets_test() -> take_largest_test() -> ?assertException(error, {empty_tree, _}, b_trees:take_largest(?B_TREE_06_00)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 3, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 6, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 9, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 12, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 15, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 18, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 21, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 24, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 27, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_largest_b_tree(4, 30, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 3, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 6, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 9, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 12, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 15, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 18, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 21, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 24, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 27, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_largest_b_tree(4, 30, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 4, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 8, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 12, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 16, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 20, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 24, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 28, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 32, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 36, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_largest_b_tree(6, 40, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 4, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 8, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 12, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 16, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 20, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 24, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 28, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 32, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 36, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_largest_b_tree(6, 40, 2)), ok. @@ -2104,7 +2104,7 @@ take_largest_test() -> %%-------------------------------------------------------------------- take_smallest_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -2157,28 +2157,28 @@ take_smallest_persistence_by_ets_test() -> take_smallest_test() -> ?assertException(error, {empty_tree, _}, b_trees:take_smallest(?B_TREE_06_00)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 3, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 6, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 9, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 12, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 15, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 18, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 21, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 24, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 27, 2)), - test_generator:check_equal(?B_TREE_04_00, test_generator:take_smallest_b_tree(4, 30, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 3, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 6, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 9, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 12, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 15, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 18, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 21, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 24, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 27, 2)), + b_trees_generator:check_equal(?B_TREE_04_00, b_trees_generator:take_smallest_b_tree(4, 30, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 4, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 8, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 12, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 16, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 20, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 24, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 28, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 32, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 36, 2)), - test_generator:check_equal(?B_TREE_06_00, test_generator:take_smallest_b_tree(6, 40, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 4, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 8, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 12, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 16, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 20, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 24, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 28, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 32, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 32, 2, fun b_trees:sort_descending/2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 36, 2)), + b_trees_generator:check_equal(?B_TREE_06_00, b_trees_generator:take_smallest_b_tree(6, 40, 2)), ok. @@ -2187,12 +2187,12 @@ take_smallest_test() -> %%-------------------------------------------------------------------- to_list_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), _KeyValues_06_32 = b_trees:to_list(B_TREE_06_32), - ?assertEqual(test_generator:generate_key_values_from(32, 2), _KeyValues_06_32), + ?assertEqual(b_trees_generator:generate_key_values_from(32, 2), _KeyValues_06_32), ?assertEqual(32, length(_KeyValues_06_32)), true = ets:delete(StateTarget), @@ -2204,28 +2204,28 @@ to_list_persistence_by_ets_test() -> %%-------------------------------------------------------------------- to_list_test() -> - ?assertException(error, {empty_tree, _}, b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {empty_tree, _}, b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual([{"k_01", "v_01"}], b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual([{"k_01", "v_01"}], b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - _KeyValues_06_02 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_02)), - ?assertEqual(test_generator:generate_key_values_from(2, 2), _KeyValues_06_02), + _KeyValues_06_02 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_02)), + ?assertEqual(b_trees_generator:generate_key_values_from(2, 2), _KeyValues_06_02), ?assertEqual(2, length(_KeyValues_06_02)), - _KeyValues_06_05 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_05)), - ?assertEqual(test_generator:generate_key_values_from(5, 2), _KeyValues_06_05), + _KeyValues_06_05 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_05)), + ?assertEqual(b_trees_generator:generate_key_values_from(5, 2), _KeyValues_06_05), ?assertEqual(5, length(_KeyValues_06_05)), - _KeyValues_06_09 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_09)), - ?assertEqual(test_generator:generate_key_values_from(9, 2), _KeyValues_06_09), + _KeyValues_06_09 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_09)), + ?assertEqual(b_trees_generator:generate_key_values_from(9, 2), _KeyValues_06_09), ?assertEqual(9, length(_KeyValues_06_09)), - _KeyValues_06_16 = b_trees:to_list(test_generator:prepare_template_asc(?B_TREE_06_16)), - ?assertEqual(test_generator:generate_key_values_from(16, 2), _KeyValues_06_16), + _KeyValues_06_16 = b_trees:to_list(b_trees_generator:prepare_template_asc(?B_TREE_06_16)), + ?assertEqual(b_trees_generator:generate_key_values_from(16, 2), _KeyValues_06_16), ?assertEqual(16, length(_KeyValues_06_16)), - _KeyValues_06_32 = b_trees:to_list(test_generator:prepare_template_desc(?B_TREE_06_32_DESC)), - ?assertEqual(test_generator:generate_key_values_till(32, 2), _KeyValues_06_32), + _KeyValues_06_32 = b_trees:to_list(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)), + ?assertEqual(b_trees_generator:generate_key_values_till(32, 2), _KeyValues_06_32), ?assertEqual(32, length(_KeyValues_06_32)), ok. @@ -2235,7 +2235,7 @@ to_list_test() -> %%-------------------------------------------------------------------- update_b_tree_test() -> - BTree_04_15_K_01 = b_trees:update("k_01", "v_01_new", test_generator:prepare_template_asc(?B_TREE_04_15)), + BTree_04_15_K_01 = b_trees:update("k_01", "v_01_new", b_trees_generator:prepare_template_asc(?B_TREE_04_15)), BTree_04_15_K_02 = b_trees:update("k_02", "v_02_new", BTree_04_15_K_01), BTree_04_15_K_03 = b_trees:update("k_03", "v_03_new", BTree_04_15_K_02), BTree_04_15_K_04 = b_trees:update("k_04", "v_04_new", BTree_04_15_K_03), @@ -2249,9 +2249,9 @@ update_b_tree_test() -> BTree_04_15_K_12 = b_trees:update("k_12", "v_12_new", BTree_04_15_K_11), BTree_04_15_K_13 = b_trees:update("k_13", "v_13_new", BTree_04_15_K_12), _BTree_04_15_K_14 = b_trees:update("k_14", "v_14_new", BTree_04_15_K_13), - test_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:update("k_15", "v_15_new", _BTree_04_15_K_14)), + b_trees_generator:check_equal(?B_TREE_04_15_UPDATE, b_trees:update("k_15", "v_15_new", _BTree_04_15_K_14)), - BTree_06_32_DESC_K_01 = b_trees:update("k_01", "v_01_new", test_generator:prepare_template_desc(?B_TREE_06_32_DESC)), + BTree_06_32_DESC_K_01 = b_trees:update("k_01", "v_01_new", b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)), BTree_06_32_DESC_K_02 = b_trees:update("k_02", "v_02_new", BTree_06_32_DESC_K_01), BTree_06_32_DESC_K_03 = b_trees:update("k_03", "v_03_new", BTree_06_32_DESC_K_02), BTree_06_32_DESC_K_04 = b_trees:update("k_04", "v_04_new", BTree_06_32_DESC_K_03), @@ -2282,7 +2282,7 @@ update_b_tree_test() -> BTree_06_32_DESC_K_29 = b_trees:update("k_29", "v_29_new", BTree_06_32_DESC_K_28), BTree_06_32_DESC_K_30 = b_trees:update("k_30", "v_30_new", BTree_06_32_DESC_K_29), _BTree_06_32_DESC_K_31 = b_trees:update("k_31", "v_31_new", BTree_06_32_DESC_K_30), - test_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:update("k_32", "v_32_new", _BTree_06_32_DESC_K_31)), + b_trees_generator:check_equal(?B_TREE_06_32_DESC_UPDATE, b_trees:update("k_32", "v_32_new", _BTree_06_32_DESC_K_31)), ok. @@ -2291,12 +2291,12 @@ update_b_tree_test() -> %%-------------------------------------------------------------------- update_error_test() -> - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_06_02))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertException(error, {key_not_found, "k_30"}, b_trees:update("k_30", "v_30_new", test_generator:prepare_template_asc(?B_TREE_06_29))), - ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", test_generator:prepare_template_asc(?B_TREE_08_64))), - ?assertException(error, {key_not_found, "k_65"}, b_trees:update("k_65", "v_65_new", test_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_06_02))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertException(error, {key_not_found, "k_30"}, b_trees:update("k_30", "v_30_new", b_trees_generator:prepare_template_asc(?B_TREE_06_29))), + ?assertException(error, {key_not_found, "k_00"}, b_trees:update("k_00", "v_00_new", b_trees_generator:prepare_template_asc(?B_TREE_08_64))), + ?assertException(error, {key_not_found, "k_65"}, b_trees:update("k_65", "v_65_new", b_trees_generator:prepare_template_asc(?B_TREE_08_64))), ok. @@ -2305,7 +2305,7 @@ update_error_test() -> %%-------------------------------------------------------------------- update_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = test_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_04_32 = b_trees_generator:generate_b_tree_from_number_ets(4, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(11, length(ets:tab2list(StateTarget))), @@ -2344,7 +2344,7 @@ update_persistence_by_ets_test() -> B_TREE_04_32_K_32_VALUES = b_trees:to_list(B_TREE_04_32_K_32), - ?assertEqual(B_TREE_04_32_K_32_VALUES, test_generator:generate_key_values_from_update(32, 2)), + ?assertEqual(B_TREE_04_32_K_32_VALUES, b_trees_generator:generate_key_values_from_update(32, 2)), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_04_32_K_32), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -2358,7 +2358,7 @@ update_persistence_by_ets_test() -> %%-------------------------------------------------------------------- values_persistence_by_ets_test() -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = test_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun test_generator:ets_owner/0)), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_06_32 = b_trees_generator:generate_b_tree_from_number_ets(6, 32, 2, b_trees_test, spawn(fun b_trees_generator:ets_owner/0)), ?assertEqual(4, length(ets:tab2list(StateTarget))), @@ -2373,16 +2373,16 @@ values_persistence_by_ets_test() -> %%-------------------------------------------------------------------- values_test() -> - ?assertEqual([], b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_00))), + ?assertEqual([], b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_00))), - ?assertEqual(["v_01"], b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_01))), + ?assertEqual(["v_01"], b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_01))), - ?assertEqual(2, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_02)))), - ?assertEqual(5, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_05)))), - ?assertEqual(9, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_09)))), - ?assertEqual(16, length(b_trees:values(test_generator:prepare_template_asc(?B_TREE_06_16)))), + ?assertEqual(2, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_02)))), + ?assertEqual(5, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_05)))), + ?assertEqual(9, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_09)))), + ?assertEqual(16, length(b_trees:values(b_trees_generator:prepare_template_asc(?B_TREE_06_16)))), - ?assertEqual(32, length(b_trees:values(test_generator:prepare_template_desc(?B_TREE_06_32_DESC)))), + ?assertEqual(32, length(b_trees:values(b_trees_generator:prepare_template_desc(?B_TREE_06_32_DESC)))), ok. diff --git a/test/performance_SUITE.erl b/test/performance_SUITE.erl index cf84185..e5c0e3c 100644 --- a/test/performance_SUITE.erl +++ b/test/performance_SUITE.erl @@ -52,77 +52,77 @@ init_per_suite(Config) -> end, ok = mnesia:start(), [ - {key_values_from, test_generator:generate_key_values_from(?NUMBER_ACTIONS, ?WIDTH)}, - {key_values_from_even_odd, test_generator:generate_key_values_from_even(?NUMBER_ACTIONS, ?WIDTH) ++ test_generator:generate_key_values_from_odd(?NUMBER_ACTIONS, ?WIDTH)}, - {key_values_from_odd_even, test_generator:generate_key_values_from_odd(?NUMBER_ACTIONS, ?WIDTH) ++ test_generator:generate_key_values_from_even(?NUMBER_ACTIONS, ?WIDTH)}, - {key_values_from_update, test_generator:generate_key_values_from_update(?NUMBER_ACTIONS, ?WIDTH)}, - {key_values_random, test_generator:generate_key_values_random(?NUMBER_ACTIONS, ?WIDTH)}, - {key_values_random_update, test_generator:generate_key_values_random_update(?NUMBER_ACTIONS, ?WIDTH)}, - - {keys_from, test_generator:generate_keys_from(?NUMBER_ACTIONS, ?WIDTH)}, - {keys_from_even_odd, test_generator:generate_keys_from_even(?NUMBER_ACTIONS, ?WIDTH) ++ test_generator:generate_keys_from_odd(?NUMBER_ACTIONS, ?WIDTH)}, - {keys_from_odd_even, test_generator:generate_keys_from_odd(?NUMBER_ACTIONS, ?WIDTH) ++ test_generator:generate_keys_from_even(?NUMBER_ACTIONS, ?WIDTH)}, - {keys_random, test_generator:generate_keys_random(?NUMBER_ACTIONS, ?WIDTH)}, - - {gb_tree, test_generator:generate_gb_tree_from_number(?NUMBER_ACTIONS, ?WIDTH)}, - {gb_tree_new, test_generator:generate_gb_tree_from_number_update(?NUMBER_ACTIONS, ?WIDTH)}, - - {b_tree_4, test_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_4_desc, test_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH, fun b_trees:sort_descending/2)}, - {b_tree_4_new, test_generator:generate_b_tree_from_number_update(4, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_4_till, test_generator:generate_b_tree_till_number(4, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_5, test_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_5_new, test_generator:generate_b_tree_from_number_update(5, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_5_till, test_generator:generate_b_tree_till_number(5, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_6, test_generator:generate_b_tree_from_number(6, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_6_new, test_generator:generate_b_tree_from_number_update(6, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_6_till, test_generator:generate_b_tree_till_number(6, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_8, test_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_8_new, test_generator:generate_b_tree_from_number_update(8, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_16, test_generator:generate_b_tree_from_number(16, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_16_new, test_generator:generate_b_tree_from_number_update(16, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_32, test_generator:generate_b_tree_from_number(32, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_32_new, test_generator:generate_b_tree_from_number_update(32, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_64, test_generator:generate_b_tree_from_number(64, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_64_new, test_generator:generate_b_tree_from_number_update(64, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_128, test_generator:generate_b_tree_from_number(128, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_128_new, test_generator:generate_b_tree_from_number_update(128, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_256, test_generator:generate_b_tree_from_number(256, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_256_new, test_generator:generate_b_tree_from_number_update(256, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_512, test_generator:generate_b_tree_from_number(512, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_512_new, test_generator:generate_b_tree_from_number_update(512, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_1024, test_generator:generate_b_tree_from_number(1024, ?NUMBER_ACTIONS, ?WIDTH)}, - {b_tree_1024_new, test_generator:generate_b_tree_from_number_update(1024, ?NUMBER_ACTIONS, ?WIDTH)}, - - {b_tree_4_dets, test_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets)}, - {b_tree_4_dets_map, test_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets_map)}, - {b_tree_4_dets_new, test_generator:generate_b_tree_from_number_update_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets_new)}, - {b_tree_4_dets_update, test_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets_update)}, - - {b_tree_1024_dets, test_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets)}, - {b_tree_1024_dets_map, test_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets_map)}, - {b_tree_1024_dets_new, test_generator:generate_b_tree_from_number_update_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets_new)}, - {b_tree_1024_dets_update, test_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets_update)}, - - {b_tree_4_ets, test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets, spawn(fun test_generator:ets_owner/0))}, - {b_tree_4_ets_map, test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets_map, spawn(fun test_generator:ets_owner/0))}, - {b_tree_4_ets_new, test_generator:generate_b_tree_from_number_update_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets_new, spawn(fun test_generator:ets_owner/0))}, - {b_tree_4_ets_update, test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets_update, spawn(fun test_generator:ets_owner/0))}, - - {b_tree_1024_ets, test_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets, spawn(fun test_generator:ets_owner/0))}, - {b_tree_1024_ets_map, test_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets_map, spawn(fun test_generator:ets_owner/0))}, - {b_tree_1024_ets_new, test_generator:generate_b_tree_from_number_update_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets_new, spawn(fun test_generator:ets_owner/0))}, - {b_tree_1024_ets_update, test_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets_update, spawn(fun test_generator:ets_owner/0))}, - - {b_tree_4_mnesia, test_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia)}, - {b_tree_4_mnesia_map, test_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia_map)}, - {b_tree_4_mnesia_new, test_generator:generate_b_tree_from_number_update_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia_new)}, - {b_tree_4_mnesia_update, test_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia_update)}, - - {b_tree_1024_mnesia, test_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia)}, - {b_tree_1024_mnesia_map, test_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia_map)}, - {b_tree_1024_mnesia_new, test_generator:generate_b_tree_from_number_update_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia_new)}, - {b_tree_1024_mnesia_update, test_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia_update)} + {key_values_from, b_trees_generator:generate_key_values_from(?NUMBER_ACTIONS, ?WIDTH)}, + {key_values_from_even_odd, b_trees_generator:generate_key_values_from_even(?NUMBER_ACTIONS, ?WIDTH) ++ b_trees_generator:generate_key_values_from_odd(?NUMBER_ACTIONS, ?WIDTH)}, + {key_values_from_odd_even, b_trees_generator:generate_key_values_from_odd(?NUMBER_ACTIONS, ?WIDTH) ++ b_trees_generator:generate_key_values_from_even(?NUMBER_ACTIONS, ?WIDTH)}, + {key_values_from_update, b_trees_generator:generate_key_values_from_update(?NUMBER_ACTIONS, ?WIDTH)}, + {key_values_random, b_trees_generator:generate_key_values_random(?NUMBER_ACTIONS, ?WIDTH)}, + {key_values_random_update, b_trees_generator:generate_key_values_random_update(?NUMBER_ACTIONS, ?WIDTH)}, + + {keys_from, b_trees_generator:generate_keys_from(?NUMBER_ACTIONS, ?WIDTH)}, + {keys_from_even_odd, b_trees_generator:generate_keys_from_even(?NUMBER_ACTIONS, ?WIDTH) ++ b_trees_generator:generate_keys_from_odd(?NUMBER_ACTIONS, ?WIDTH)}, + {keys_from_odd_even, b_trees_generator:generate_keys_from_odd(?NUMBER_ACTIONS, ?WIDTH) ++ b_trees_generator:generate_keys_from_even(?NUMBER_ACTIONS, ?WIDTH)}, + {keys_random, b_trees_generator:generate_keys_random(?NUMBER_ACTIONS, ?WIDTH)}, + + {gb_tree, b_trees_generator:generate_gb_tree_from_number(?NUMBER_ACTIONS, ?WIDTH)}, + {gb_tree_new, b_trees_generator:generate_gb_tree_from_number_update(?NUMBER_ACTIONS, ?WIDTH)}, + + {b_tree_4, b_trees_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_4_desc, b_trees_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH, fun b_trees:sort_descending/2)}, + {b_tree_4_new, b_trees_generator:generate_b_tree_from_number_update(4, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_4_till, b_trees_generator:generate_b_tree_till_number(4, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_5, b_trees_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_5_new, b_trees_generator:generate_b_tree_from_number_update(5, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_5_till, b_trees_generator:generate_b_tree_till_number(5, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_6, b_trees_generator:generate_b_tree_from_number(6, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_6_new, b_trees_generator:generate_b_tree_from_number_update(6, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_6_till, b_trees_generator:generate_b_tree_till_number(6, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_8, b_trees_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_8_new, b_trees_generator:generate_b_tree_from_number_update(8, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_16, b_trees_generator:generate_b_tree_from_number(16, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_16_new, b_trees_generator:generate_b_tree_from_number_update(16, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_32, b_trees_generator:generate_b_tree_from_number(32, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_32_new, b_trees_generator:generate_b_tree_from_number_update(32, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_64, b_trees_generator:generate_b_tree_from_number(64, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_64_new, b_trees_generator:generate_b_tree_from_number_update(64, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_128, b_trees_generator:generate_b_tree_from_number(128, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_128_new, b_trees_generator:generate_b_tree_from_number_update(128, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_256, b_trees_generator:generate_b_tree_from_number(256, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_256_new, b_trees_generator:generate_b_tree_from_number_update(256, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_512, b_trees_generator:generate_b_tree_from_number(512, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_512_new, b_trees_generator:generate_b_tree_from_number_update(512, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_1024, b_trees_generator:generate_b_tree_from_number(1024, ?NUMBER_ACTIONS, ?WIDTH)}, + {b_tree_1024_new, b_trees_generator:generate_b_tree_from_number_update(1024, ?NUMBER_ACTIONS, ?WIDTH)}, + + {b_tree_4_dets, b_trees_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets)}, + {b_tree_4_dets_map, b_trees_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets_map)}, + {b_tree_4_dets_new, b_trees_generator:generate_b_tree_from_number_update_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets_new)}, + {b_tree_4_dets_update, b_trees_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_dets_update)}, + + {b_tree_1024_dets, b_trees_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets)}, + {b_tree_1024_dets_map, b_trees_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets_map)}, + {b_tree_1024_dets_new, b_trees_generator:generate_b_tree_from_number_update_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets_new)}, + {b_tree_1024_dets_update, b_trees_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_dets_update)}, + + {b_tree_4_ets, b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets, spawn(fun b_trees_generator:ets_owner/0))}, + {b_tree_4_ets_map, b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets_map, spawn(fun b_trees_generator:ets_owner/0))}, + {b_tree_4_ets_new, b_trees_generator:generate_b_tree_from_number_update_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets_new, spawn(fun b_trees_generator:ets_owner/0))}, + {b_tree_4_ets_update, b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_ets_update, spawn(fun b_trees_generator:ets_owner/0))}, + + {b_tree_1024_ets, b_trees_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets, spawn(fun b_trees_generator:ets_owner/0))}, + {b_tree_1024_ets_map, b_trees_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets_map, spawn(fun b_trees_generator:ets_owner/0))}, + {b_tree_1024_ets_new, b_trees_generator:generate_b_tree_from_number_update_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets_new, spawn(fun b_trees_generator:ets_owner/0))}, + {b_tree_1024_ets_update, b_trees_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_ets_update, spawn(fun b_trees_generator:ets_owner/0))}, + + {b_tree_4_mnesia, b_trees_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia)}, + {b_tree_4_mnesia_map, b_trees_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia_map)}, + {b_tree_4_mnesia_new, b_trees_generator:generate_b_tree_from_number_update_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia_new)}, + {b_tree_4_mnesia_update, b_trees_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, b_tree_4_mnesia_update)}, + + {b_tree_1024_mnesia, b_trees_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia)}, + {b_tree_1024_mnesia_map, b_trees_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia_map)}, + {b_tree_1024_mnesia_new, b_trees_generator:generate_b_tree_from_number_update_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia_new)}, + {b_tree_1024_mnesia_update, b_trees_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, b_tree_1024_mnesia_update)} | Config ]. @@ -525,7 +525,7 @@ all() -> %%-------------------------------------------------------------------- delete_b_tree_order_1024_dets_test(_Config) -> - test_generator:check_equal(b_trees:empty(1024), test_generator:delete_b_tree_from_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, delete_order_1024_dets)), + b_trees_generator:check_equal(b_trees:empty(1024), b_trees_generator:delete_b_tree_from_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, delete_order_1024_dets)), ok. %%-------------------------------------------------------------------- @@ -533,8 +533,8 @@ delete_b_tree_order_1024_dets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_1024_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, delete_order_1024_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(1024), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, delete_order_1024_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(1024), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -544,7 +544,7 @@ delete_b_tree_order_1024_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_1024_mnesia_test(_Config) -> - test_generator:check_equal(b_trees:empty(1024), test_generator:delete_b_tree_from_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, delete_order_1024_mnesia)), + b_trees_generator:check_equal(b_trees:empty(1024), b_trees_generator:delete_b_tree_from_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, delete_order_1024_mnesia)), ok. %%-------------------------------------------------------------------- @@ -552,7 +552,7 @@ delete_b_tree_order_1024_mnesia_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_1024_test(_Config) -> - ?assertEqual(b_trees:empty(1024), test_generator:delete_b_tree_from(1024, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(1024), b_trees_generator:delete_b_tree_from(1024, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -560,8 +560,8 @@ delete_b_tree_order_1024_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_128_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(128, ?NUMBER_ACTIONS, ?WIDTH, delete_order_128_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(128), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(128, ?NUMBER_ACTIONS, ?WIDTH, delete_order_128_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(128), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -571,7 +571,7 @@ delete_b_tree_order_128_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_128_test(_Config) -> - ?assertEqual(b_trees:empty(128), test_generator:delete_b_tree_from(128, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(128), b_trees_generator:delete_b_tree_from(128, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -579,8 +579,8 @@ delete_b_tree_order_128_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_16_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(16, ?NUMBER_ACTIONS, ?WIDTH, delete_order_16_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(16), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(16, ?NUMBER_ACTIONS, ?WIDTH, delete_order_16_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(16), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -590,7 +590,7 @@ delete_b_tree_order_16_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_16_test(_Config) -> - ?assertEqual(b_trees:empty(16), test_generator:delete_b_tree_from(16, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(16), b_trees_generator:delete_b_tree_from(16, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -598,8 +598,8 @@ delete_b_tree_order_16_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_256_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(256, ?NUMBER_ACTIONS, ?WIDTH, delete_order_256_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(256), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(256, ?NUMBER_ACTIONS, ?WIDTH, delete_order_256_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(256), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -609,7 +609,7 @@ delete_b_tree_order_256_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_256_test(_Config) -> - ?assertEqual(b_trees:empty(256), test_generator:delete_b_tree_from(256, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(256), b_trees_generator:delete_b_tree_from(256, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -617,8 +617,8 @@ delete_b_tree_order_256_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_32_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(32, ?NUMBER_ACTIONS, ?WIDTH, delete_order_32_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(32), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(32, ?NUMBER_ACTIONS, ?WIDTH, delete_order_32_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(32), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -628,7 +628,7 @@ delete_b_tree_order_32_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_32_test(_Config) -> - ?assertEqual(b_trees:empty(32), test_generator:delete_b_tree_from(32, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(32), b_trees_generator:delete_b_tree_from(32, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -636,7 +636,7 @@ delete_b_tree_order_32_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_desc_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:delete_b_tree_from_desc(4, ?NUMBER_ACTIONS, ?WIDTH)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:delete_b_tree_from_desc(4, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -644,7 +644,7 @@ delete_b_tree_order_4_desc_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_dets_desc_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:delete_b_tree_from_dets_desc(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_dets_desc)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:delete_b_tree_from_dets_desc(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_dets_desc)), ok. %%-------------------------------------------------------------------- @@ -652,7 +652,7 @@ delete_b_tree_order_4_dets_desc_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_dets_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:delete_b_tree_from_dets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_dets)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:delete_b_tree_from_dets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_dets)), ok. %%-------------------------------------------------------------------- @@ -660,8 +660,8 @@ delete_b_tree_order_4_dets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_ets_desc_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets_desc(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_desc, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(4), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets_desc(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_desc, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(4), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -671,10 +671,10 @@ delete_b_tree_order_4_ets_desc_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_ets_even_odd_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_even_odd, spawn(fun test_generator:ets_owner/0)), - BTree_Odd = test_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, BTree), - BTree_Empty = test_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, BTree_Odd), - test_generator:check_equal(b_trees:empty(4), BTree_Empty), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_even_odd, spawn(fun b_trees_generator:ets_owner/0)), + BTree_Odd = b_trees_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, BTree), + BTree_Empty = b_trees_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, BTree_Odd), + b_trees_generator:check_equal(b_trees:empty(4), BTree_Empty), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree_Empty), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -684,10 +684,10 @@ delete_b_tree_order_4_ets_even_odd_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_ets_odd_even_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_odd_even, spawn(fun test_generator:ets_owner/0)), - BTree_Even = test_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, BTree), - BTree_Empty = test_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, BTree_Even), - test_generator:check_equal(b_trees:empty(4), BTree_Empty), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_odd_even, spawn(fun b_trees_generator:ets_owner/0)), + BTree_Even = b_trees_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, BTree), + BTree_Empty = b_trees_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, BTree_Even), + b_trees_generator:check_equal(b_trees:empty(4), BTree_Empty), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree_Empty), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -697,9 +697,9 @@ delete_b_tree_order_4_ets_odd_even_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_ets_random_desc_test(Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_random_desc, spawn(fun test_generator:ets_owner/0)), - B_TREE_2 = test_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), - test_generator:check_equal(b_trees:empty(4), B_TREE_2), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_random_desc, spawn(fun b_trees_generator:ets_owner/0)), + B_TREE_2 = b_trees_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), + b_trees_generator:check_equal(b_trees:empty(4), B_TREE_2), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_2), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -709,9 +709,9 @@ delete_b_tree_order_4_ets_random_desc_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_ets_random_test(Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_random, spawn(fun test_generator:ets_owner/0)), - B_TREE_2 = test_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), - test_generator:check_equal(b_trees:empty(4), B_TREE_2), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets_random, spawn(fun b_trees_generator:ets_owner/0)), + B_TREE_2 = b_trees_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), + b_trees_generator:check_equal(b_trees:empty(4), B_TREE_2), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_2), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -721,8 +721,8 @@ delete_b_tree_order_4_ets_random_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(4), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(4), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -732,9 +732,9 @@ delete_b_tree_order_4_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_even_odd_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH), - _BTree_Odd = test_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree), - _BTree_Empty = test_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Odd), + _BTree = b_trees_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH), + _BTree_Odd = b_trees_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree), + _BTree_Empty = b_trees_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Odd), ?assertEqual(b_trees:empty(4), _BTree_Empty), ok. @@ -743,7 +743,7 @@ delete_b_tree_order_4_even_odd_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_mnesia_desc_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:delete_b_tree_from_mnesia_desc(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_mnesia_desc)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:delete_b_tree_from_mnesia_desc(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_mnesia_desc)), ok. %%-------------------------------------------------------------------- @@ -751,7 +751,7 @@ delete_b_tree_order_4_mnesia_desc_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_mnesia_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:delete_b_tree_from_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_mnesia)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:delete_b_tree_from_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, delete_order_4_mnesia)), ok. %%-------------------------------------------------------------------- @@ -759,9 +759,9 @@ delete_b_tree_order_4_mnesia_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_odd_even_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH), - _BTree_Even = test_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree), - _BTree_Empty = test_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Even), + _BTree = b_trees_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH), + _BTree_Even = b_trees_generator:delete_b_tree_from_odd(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree), + _BTree_Empty = b_trees_generator:delete_b_tree_from_even(4, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Even), ?assertEqual(b_trees:empty(4), _BTree_Empty), ok. @@ -770,7 +770,7 @@ delete_b_tree_order_4_odd_even_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_random_desc_test(Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_4_desc, Config))), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_4_desc, Config))), ok. %%-------------------------------------------------------------------- @@ -778,7 +778,7 @@ delete_b_tree_order_4_random_desc_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_random_test(Config) -> - ?assertEqual(b_trees:empty(4), test_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_4, Config))), + ?assertEqual(b_trees:empty(4), b_trees_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_4, Config))), ok. %%-------------------------------------------------------------------- @@ -786,7 +786,7 @@ delete_b_tree_order_4_random_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_4_test(_Config) -> - ?assertEqual(b_trees:empty(4), test_generator:delete_b_tree_from(4, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(4), b_trees_generator:delete_b_tree_from(4, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -794,8 +794,8 @@ delete_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_512_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(512, ?NUMBER_ACTIONS, ?WIDTH, delete_order_512_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(512), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(512, ?NUMBER_ACTIONS, ?WIDTH, delete_order_512_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(512), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -805,7 +805,7 @@ delete_b_tree_order_512_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_512_test(_Config) -> - ?assertEqual(b_trees:empty(512), test_generator:delete_b_tree_from(512, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(512), b_trees_generator:delete_b_tree_from(512, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -813,10 +813,10 @@ delete_b_tree_order_512_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_ets_even_odd_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets_even_odd, spawn(fun test_generator:ets_owner/0)), - BTree_Odd = test_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, BTree), - BTree_Empty = test_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, BTree_Odd), - test_generator:check_equal(b_trees:empty(5), BTree_Empty), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets_even_odd, spawn(fun b_trees_generator:ets_owner/0)), + BTree_Odd = b_trees_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, BTree), + BTree_Empty = b_trees_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, BTree_Odd), + b_trees_generator:check_equal(b_trees:empty(5), BTree_Empty), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree_Empty), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -826,10 +826,10 @@ delete_b_tree_order_5_ets_even_odd_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_ets_odd_even_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets_odd_even, spawn(fun test_generator:ets_owner/0)), - BTree_Even = test_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, BTree), - BTree_Empty = test_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, BTree_Even), - test_generator:check_equal(b_trees:empty(5), BTree_Empty), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets_odd_even, spawn(fun b_trees_generator:ets_owner/0)), + BTree_Even = b_trees_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, BTree), + BTree_Empty = b_trees_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, BTree_Even), + b_trees_generator:check_equal(b_trees:empty(5), BTree_Empty), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree_Empty), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -839,9 +839,9 @@ delete_b_tree_order_5_ets_odd_even_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_ets_random_test(Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = test_generator:generate_b_tree_from_number_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets_random, spawn(fun test_generator:ets_owner/0)), - B_TREE_2 = test_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), - test_generator:check_equal(b_trees:empty(5), B_TREE_2), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = b_trees_generator:generate_b_tree_from_number_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets_random, spawn(fun b_trees_generator:ets_owner/0)), + B_TREE_2 = b_trees_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), + b_trees_generator:check_equal(b_trees:empty(5), B_TREE_2), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_2), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -851,8 +851,8 @@ delete_b_tree_order_5_ets_random_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(5), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(5, ?NUMBER_ACTIONS, ?WIDTH, delete_order_5_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(5), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -862,9 +862,9 @@ delete_b_tree_order_5_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_even_odd_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH), - _BTree_Odd = test_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree), - _BTree_Empty = test_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Odd), + _BTree = b_trees_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH), + _BTree_Odd = b_trees_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree), + _BTree_Empty = b_trees_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Odd), ?assertEqual(b_trees:empty(5), _BTree_Empty), ok. @@ -873,9 +873,9 @@ delete_b_tree_order_5_even_odd_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_odd_even_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH), - _BTree_Even = test_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree), - _BTree_Empty = test_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Even), + _BTree = b_trees_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH), + _BTree_Even = b_trees_generator:delete_b_tree_from_odd(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree), + _BTree_Empty = b_trees_generator:delete_b_tree_from_even(5, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Even), ?assertEqual(b_trees:empty(5), _BTree_Empty), ok. @@ -884,7 +884,7 @@ delete_b_tree_order_5_odd_even_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_random_test(Config) -> - ?assertEqual(b_trees:empty(5), test_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_5, Config))), + ?assertEqual(b_trees:empty(5), b_trees_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_5, Config))), ok. %%-------------------------------------------------------------------- @@ -892,7 +892,7 @@ delete_b_tree_order_5_random_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_5_test(_Config) -> - ?assertEqual(b_trees:empty(5), test_generator:delete_b_tree_from(5, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(5), b_trees_generator:delete_b_tree_from(5, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -900,8 +900,8 @@ delete_b_tree_order_5_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_64_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(64, ?NUMBER_ACTIONS, ?WIDTH, delete_order_64_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(64), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(64, ?NUMBER_ACTIONS, ?WIDTH, delete_order_64_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(64), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -911,7 +911,7 @@ delete_b_tree_order_64_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_64_test(_Config) -> - ?assertEqual(b_trees:empty(64), test_generator:delete_b_tree_from(64, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(64), b_trees_generator:delete_b_tree_from(64, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -919,8 +919,8 @@ delete_b_tree_order_64_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_6_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(6, ?NUMBER_ACTIONS, ?WIDTH, delete_order_6_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(6), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(6, ?NUMBER_ACTIONS, ?WIDTH, delete_order_6_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(6), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -930,7 +930,7 @@ delete_b_tree_order_6_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_6_test(_Config) -> - ?assertEqual(b_trees:empty(6), test_generator:delete_b_tree_from(6, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(6), b_trees_generator:delete_b_tree_from(6, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -938,10 +938,10 @@ delete_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_ets_even_odd_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets_even_odd, spawn(fun test_generator:ets_owner/0)), - BTree_Odd = test_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, BTree), - BTree_Empty = test_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, BTree_Odd), - test_generator:check_equal(b_trees:empty(8), BTree_Empty), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets_even_odd, spawn(fun b_trees_generator:ets_owner/0)), + BTree_Odd = b_trees_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, BTree), + BTree_Empty = b_trees_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, BTree_Odd), + b_trees_generator:check_equal(b_trees:empty(8), BTree_Empty), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree_Empty), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -951,10 +951,10 @@ delete_b_tree_order_8_ets_even_odd_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_ets_odd_even_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets_odd_even, spawn(fun test_generator:ets_owner/0)), - BTree_Even = test_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, BTree), - BTree_Empty = test_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, BTree_Even), - test_generator:check_equal(b_trees:empty(8), BTree_Empty), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets_odd_even, spawn(fun b_trees_generator:ets_owner/0)), + BTree_Even = b_trees_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, BTree), + BTree_Empty = b_trees_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, BTree_Even), + b_trees_generator:check_equal(b_trees:empty(8), BTree_Empty), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree_Empty), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -964,9 +964,9 @@ delete_b_tree_order_8_ets_odd_even_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_ets_random_test(Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = test_generator:generate_b_tree_from_number_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets_random, spawn(fun test_generator:ets_owner/0)), - B_TREE_2 = test_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), - test_generator:check_equal(b_trees:empty(8), B_TREE_2), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE_1 = b_trees_generator:generate_b_tree_from_number_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets_random, spawn(fun b_trees_generator:ets_owner/0)), + B_TREE_2 = b_trees_generator:delete_b_tree_list(?config(keys_random, Config), B_TREE_1), + b_trees_generator:check_equal(b_trees:empty(8), B_TREE_2), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_2), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -976,8 +976,8 @@ delete_b_tree_order_8_ets_random_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = test_generator:delete_b_tree_from_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(8), B_TREE), + {_, _, _, _, {StateTarget, _, _, _}, _} = B_TREE = b_trees_generator:delete_b_tree_from_ets(8, ?NUMBER_ACTIONS, ?WIDTH, delete_order_8_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(8), B_TREE), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -987,9 +987,9 @@ delete_b_tree_order_8_ets_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_even_odd_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH), - _BTree_Odd = test_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree), - _BTree_Empty = test_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Odd), + _BTree = b_trees_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH), + _BTree_Odd = b_trees_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree), + _BTree_Empty = b_trees_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Odd), ?assertEqual(b_trees:empty(8), _BTree_Empty), ok. @@ -998,9 +998,9 @@ delete_b_tree_order_8_even_odd_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_odd_even_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH), - _BTree_Even = test_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree), - _BTree_Empty = test_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Even), + _BTree = b_trees_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH), + _BTree_Even = b_trees_generator:delete_b_tree_from_odd(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree), + _BTree_Empty = b_trees_generator:delete_b_tree_from_even(8, ?NUMBER_ACTIONS, ?WIDTH, _BTree_Even), ?assertEqual(b_trees:empty(8), _BTree_Empty), ok. @@ -1009,7 +1009,7 @@ delete_b_tree_order_8_odd_even_test(_Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_random_test(Config) -> - ?assertEqual(b_trees:empty(8), test_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_8, Config))), + ?assertEqual(b_trees:empty(8), b_trees_generator:delete_b_tree_list(?config(keys_random, Config), ?config(b_tree_8, Config))), ok. %%-------------------------------------------------------------------- @@ -1017,7 +1017,7 @@ delete_b_tree_order_8_random_test(Config) -> %%-------------------------------------------------------------------- delete_b_tree_order_8_test(_Config) -> - ?assertEqual(b_trees:empty(8), test_generator:delete_b_tree_from(8, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(8), b_trees_generator:delete_b_tree_from(8, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -1025,7 +1025,7 @@ delete_b_tree_order_8_test(_Config) -> %%-------------------------------------------------------------------- delete_gb_tree_test(_Config) -> - ?assertEqual(gb_trees:empty(), test_generator:delete_gb_tree_from(?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(gb_trees:empty(), b_trees_generator:delete_gb_tree_from(?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -1037,12 +1037,12 @@ enter_b_tree_order_1024_dets_test(Config) -> {ok, _} = dets:open_file(b_tree_1024_dets_new, [{file, ?DIRECTORY_DETS ++ "b_tree_1024_dets_new"}]), KeyValues = ?config(key_values_from, Config), {ok, _} = dets:open_file(enter_order_1024, [{file, ?DIRECTORY_DETS ++ "enter_order_1024"}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {enter_order_1024, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {enter_order_1024, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3}), BTree = enter_b_tree(KeyValues, B_TREE_EMPTY), - test_generator:check_equal(?config(b_tree_1024_dets, Config), BTree), + b_trees_generator:check_equal(?config(b_tree_1024_dets, Config), BTree), KeyValuesUpdate = ?config(key_values_from_update, Config), BTreeUpdate = enter_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_1024_dets_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_1024_dets_new, Config), BTreeUpdate), ok = dets:close(enter_order_1024), ok = dets:close(b_tree_1024_dets_new), dets:close(b_tree_1024_dets). @@ -1054,12 +1054,12 @@ enter_b_tree_order_1024_dets_test(Config) -> enter_b_tree_order_1024_ets_test(Config) -> KeyValues = ?config(key_values_from, Config), StateTarget = ets:new(enter_order_1024, []), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), BTree = enter_b_tree(KeyValues, B_TREE_EMPTY), - test_generator:check_equal(?config(b_tree_1024_ets, Config), BTree), + b_trees_generator:check_equal(?config(b_tree_1024_ets, Config), BTree), KeyValuesUpdate = ?config(key_values_from_update, Config), BTreeUpdate = enter_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_1024_ets_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_1024_ets_new, Config), BTreeUpdate), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTreeUpdate), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), true = ets:delete(StateTarget), @@ -1073,12 +1073,12 @@ enter_b_tree_order_1024_mnesia_test(Config) -> KeyValues = ?config(key_values_from, Config), {atomic, ok} = mnesia:create_table(enter_order_1024, [{record_name, subtrees}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {enter_order_1024, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {enter_order_1024, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3}), BTree = enter_b_tree(KeyValues, B_TREE_EMPTY), - test_generator:check_equal(?config(b_tree_1024_mnesia, Config), BTree), + b_trees_generator:check_equal(?config(b_tree_1024_mnesia, Config), BTree), KeyValuesUpdate = ?config(key_values_from_update, Config), BTreeUpdate = enter_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_1024_mnesia_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_1024_mnesia_new, Config), BTreeUpdate), ok. %%-------------------------------------------------------------------- @@ -1160,12 +1160,12 @@ enter_b_tree_order_4_dets_test(Config) -> {ok, _} = dets:open_file(b_tree_4_dets_new, [{file, ?DIRECTORY_DETS ++ "b_tree_4_dets_new"}]), KeyValues = ?config(key_values_from, Config), {ok, _} = dets:open_file(enter_order_4, [{file, ?DIRECTORY_DETS ++ "enter_order_4"}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {enter_order_4, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {enter_order_4, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3}), BTree = enter_b_tree(KeyValues, B_TREE_EMPTY), - test_generator:check_equal(?config(b_tree_4_dets, Config), BTree), + b_trees_generator:check_equal(?config(b_tree_4_dets, Config), BTree), KeyValuesUpdate = ?config(key_values_from_update, Config), BTreeUpdate = enter_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_4_dets_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_4_dets_new, Config), BTreeUpdate), ok = dets:close(enter_order_4), ok = dets:close(b_tree_4_dets_new), dets:close(b_tree_4_dets). @@ -1177,12 +1177,12 @@ enter_b_tree_order_4_dets_test(Config) -> enter_b_tree_order_4_ets_test(Config) -> KeyValues = ?config(key_values_from, Config), StateTarget = ets:new(enter_order_4, []), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), BTree = enter_b_tree(KeyValues, B_TREE_EMPTY), - test_generator:check_equal(?config(b_tree_4_ets, Config), BTree), + b_trees_generator:check_equal(?config(b_tree_4_ets, Config), BTree), KeyValuesUpdate = ?config(key_values_from_update, Config), BTreeUpdate = enter_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_4_ets_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_4_ets_new, Config), BTreeUpdate), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTreeUpdate), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), true = ets:delete(StateTarget), @@ -1196,12 +1196,12 @@ enter_b_tree_order_4_mnesia_test(Config) -> KeyValues = ?config(key_values_from, Config), {atomic, ok} = mnesia:create_table(enter_order_4, [{record_name, subtrees}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {enter_order_4, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {enter_order_4, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3}), BTree = enter_b_tree(KeyValues, B_TREE_EMPTY), - test_generator:check_equal(?config(b_tree_4_mnesia, Config), BTree), + b_trees_generator:check_equal(?config(b_tree_4_mnesia, Config), BTree), KeyValuesUpdate = ?config(key_values_from_update, Config), BTreeUpdate = enter_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_4_mnesia_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_4_mnesia_new, Config), BTreeUpdate), ok. %%-------------------------------------------------------------------- @@ -1309,8 +1309,8 @@ from_dict_b_tree_order_1024_dets_test(Config) -> BTree = ?config(b_tree_1024_dets, Config), KeyValues = ?config(key_values_from, Config), {ok, _} = dets:open_file(from_dict_order_1024, [{file, ?DIRECTORY_DETS ++ "from_dict_order_1024"}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {from_dict_order_1024, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3}), - test_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {from_dict_order_1024, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3}), + b_trees_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), dets:close(b_tree_1024_dets). %%-------------------------------------------------------------------- @@ -1321,9 +1321,9 @@ from_dict_b_tree_order_1024_ets_test(Config) -> BTree = ?config(b_tree_1024_ets, Config), KeyValues = ?config(key_values_from, Config), StateTarget = ets:new(from_dict_order_1024, []), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), B_TREE_FROM_DICT = b_trees:from_dict(B_TREE_EMPTY, KeyValues), - test_generator:check_equal(BTree, B_TREE_FROM_DICT), + b_trees_generator:check_equal(BTree, B_TREE_FROM_DICT), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_FROM_DICT), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), true = ets:delete(StateTarget), @@ -1337,8 +1337,8 @@ from_dict_b_tree_order_1024_mnesia_test(Config) -> BTree = ?config(b_tree_1024_mnesia, Config), KeyValues = ?config(key_values_from, Config), {atomic, ok} = mnesia:create_table(from_dict_order_1024, [{record_name, subtrees}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {from_dict_order_1024, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3}), - test_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(1024), state, {from_dict_order_1024, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3}), + b_trees_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), ok. %%-------------------------------------------------------------------- @@ -1430,8 +1430,8 @@ from_dict_b_tree_order_4_dets_test(Config) -> BTree = ?config(b_tree_4_dets, Config), KeyValues = ?config(key_values_from, Config), {ok, _} = dets:open_file(from_dict_order_4, [{file, ?DIRECTORY_DETS ++ "from_dict_order_4"}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {from_dict_order_4, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3, fun test_generator:persistence_by_dets/3}), - test_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {from_dict_order_4, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3, fun b_trees_generator:persistence_by_dets/3}), + b_trees_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), dets:close(b_tree_4_dets). %%-------------------------------------------------------------------- @@ -1442,9 +1442,9 @@ from_dict_b_tree_order_4_ets_test(Config) -> BTree = ?config(b_tree_4_ets, Config), KeyValues = ?config(key_values_from, Config), StateTarget = ets:new(from_dict_order_4, []), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3, fun test_generator:persistence_by_ets/3}), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {StateTarget, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3, fun b_trees_generator:persistence_by_ets/3}), B_TREE_FROM_DICT = b_trees:from_dict(B_TREE_EMPTY, KeyValues), - test_generator:check_equal(BTree, B_TREE_FROM_DICT), + b_trees_generator:check_equal(BTree, B_TREE_FROM_DICT), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(B_TREE_FROM_DICT), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), true = ets:delete(StateTarget), @@ -1458,8 +1458,8 @@ from_dict_b_tree_order_4_mnesia_test(Config) -> BTree = ?config(b_tree_4_mnesia, Config), KeyValues = ?config(key_values_from, Config), {atomic, ok} = mnesia:create_table(from_dict_order_4, [{record_name, subtrees}]), - B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {from_dict_order_4, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3, fun test_generator:persistence_by_mnesia/3}), - test_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), + B_TREE_EMPTY = b_trees:set_parameter(b_trees:empty(4), state, {from_dict_order_4, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3, fun b_trees_generator:persistence_by_mnesia/3}), + b_trees_generator:check_equal(BTree, b_trees:from_dict(B_TREE_EMPTY, KeyValues)), ok. %%-------------------------------------------------------------------- @@ -1759,10 +1759,10 @@ get_gb_tree([Key | Tail], GBTree) -> %%-------------------------------------------------------------------- insert_b_tree_order_1024_dets_test(_Config) -> - BTree = test_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, insert_order_1024_dets), + BTree = b_trees_generator:generate_b_tree_from_number_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, insert_order_1024_dets), {ok, _} = dets:open_file(b_tree_1024_dets, [{file, ?DIRECTORY_DETS ++ "b_tree_1024_dets"}]), {ok, _} = dets:open_file(insert_order_1024_dets, [{file, ?DIRECTORY_DETS ++ "insert_order_1024_dets"}]), - test_generator:check_equal(?config(b_tree_1024_dets, _Config), BTree), + b_trees_generator:check_equal(?config(b_tree_1024_dets, _Config), BTree), ?assert(b_trees:height(BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(1024 div 2)))), dets:close(b_tree_1024_dets), dets:close(insert_order_1024_dets). @@ -1772,8 +1772,8 @@ insert_b_tree_order_1024_dets_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_1024_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, insert_order_1024_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(?config(b_tree_1024_ets, _Config), BTree), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, insert_order_1024_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(?config(b_tree_1024_ets, _Config), BTree), ?assert(b_trees:height(BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(1024 div 2)))), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -1784,8 +1784,8 @@ insert_b_tree_order_1024_ets_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_1024_mnesia_test(_Config) -> - BTree = test_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, insert_order_1024_mnesia), - test_generator:check_equal(?config(b_tree_1024_mnesia, _Config), BTree), + BTree = b_trees_generator:generate_b_tree_from_number_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, insert_order_1024_mnesia), + b_trees_generator:check_equal(?config(b_tree_1024_mnesia, _Config), BTree), ?assert(b_trees:height(BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(1024 div 2)))), ok. @@ -1794,7 +1794,7 @@ insert_b_tree_order_1024_mnesia_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_1024_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(1024, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(1024, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_1024, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(1024 div 2)))), ok. @@ -1804,7 +1804,7 @@ insert_b_tree_order_1024_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_128_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(128, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(128, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_128, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(128 div 2)))), ok. @@ -1814,7 +1814,7 @@ insert_b_tree_order_128_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_16_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(16, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(16, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_16, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(16 div 2)))), ok. @@ -1824,7 +1824,7 @@ insert_b_tree_order_16_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_256_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(256, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(256, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_256, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(256 div 2)))), ok. @@ -1834,7 +1834,7 @@ insert_b_tree_order_256_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_32_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(32, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(32, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_32, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(32 div 2)))), ok. @@ -1844,10 +1844,10 @@ insert_b_tree_order_32_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_4_dets_test(_Config) -> - BTree = test_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, insert_order_4_dets), + BTree = b_trees_generator:generate_b_tree_from_number_dets(4, ?NUMBER_ACTIONS, ?WIDTH, insert_order_4_dets), {ok, _} = dets:open_file(b_tree_4_dets, [{file, ?DIRECTORY_DETS ++ "b_tree_4_dets"}]), {ok, _} = dets:open_file(insert_order_4_dets, [{file, ?DIRECTORY_DETS ++ "insert_order_4_dets"}]), - test_generator:check_equal(?config(b_tree_4_dets, _Config), BTree), + b_trees_generator:check_equal(?config(b_tree_4_dets, _Config), BTree), ?assert(b_trees:height(BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), dets:close(b_tree_4_dets), dets:close(insert_order_4_dets). @@ -1857,8 +1857,8 @@ insert_b_tree_order_4_dets_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_4_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, insert_order_4_ets, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(?config(b_tree_4_ets, _Config), BTree), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:generate_b_tree_from_number_ets(4, ?NUMBER_ACTIONS, ?WIDTH, insert_order_4_ets, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(?config(b_tree_4_ets, _Config), BTree), ?assert(b_trees:height(BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), @@ -1870,7 +1870,7 @@ insert_b_tree_order_4_ets_test(_Config) -> insert_b_tree_order_4_even_odd_test(Config) -> KeyValues = ?config(key_values_from_even_odd, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 4), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 4), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), ok. @@ -1880,8 +1880,8 @@ insert_b_tree_order_4_even_odd_test(Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_4_mnesia_test(_Config) -> - BTree = test_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, insert_order_4_mnesia), - test_generator:check_equal(?config(b_tree_4_mnesia, _Config), BTree), + BTree = b_trees_generator:generate_b_tree_from_number_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, insert_order_4_mnesia), + b_trees_generator:check_equal(?config(b_tree_4_mnesia, _Config), BTree), ?assert(b_trees:height(BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), ok. @@ -1891,7 +1891,7 @@ insert_b_tree_order_4_mnesia_test(_Config) -> insert_b_tree_order_4_odd_even_test(Config) -> KeyValues = ?config(key_values_from_odd_even, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 4), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 4), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), ok. @@ -1902,7 +1902,7 @@ insert_b_tree_order_4_odd_even_test(Config) -> insert_b_tree_order_4_random_test(Config) -> KeyValues = ?config(key_values_random, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 4), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 4), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), ok. @@ -1912,7 +1912,7 @@ insert_b_tree_order_4_random_test(Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_4_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(4, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_4, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), ok. @@ -1922,7 +1922,7 @@ insert_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_4_till_test(_Config) -> - _BTree = test_generator:generate_b_tree_till_number(4, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_till_number(4, ?NUMBER_ACTIONS, ?WIDTH), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(4 div 2)))), ok. @@ -1932,7 +1932,7 @@ insert_b_tree_order_4_till_test(_Config) -> insert_b_tree_order_5_even_odd_test(Config) -> KeyValues = ?config(key_values_from_even_odd, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 5), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 5), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(5 div 2)))), ok. @@ -1943,7 +1943,7 @@ insert_b_tree_order_5_even_odd_test(Config) -> insert_b_tree_order_5_odd_even_test(Config) -> KeyValues = ?config(key_values_from_odd_even, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 5), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 5), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(5 div 2)))), ok. @@ -1954,7 +1954,7 @@ insert_b_tree_order_5_odd_even_test(Config) -> insert_b_tree_order_5_random_test(Config) -> KeyValues = ?config(key_values_random, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 5), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 5), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(5 div 2)))), ok. @@ -1964,7 +1964,7 @@ insert_b_tree_order_5_random_test(Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_5_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(5, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_5, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(5 div 2)))), ok. @@ -1974,7 +1974,7 @@ insert_b_tree_order_5_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_5_till_test(_Config) -> - _BTree = test_generator:generate_b_tree_till_number(5, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_till_number(5, ?NUMBER_ACTIONS, ?WIDTH), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(5 div 2)))), ok. @@ -1983,7 +1983,7 @@ insert_b_tree_order_5_till_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_6_test(_Config) -> - _BTree = test_generator:generate_b_tree_till_number(6, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_till_number(6, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_6_till, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(6 div 2)))), ok. @@ -1993,7 +1993,7 @@ insert_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_6_till_test(_Config) -> - _BTree = test_generator:generate_b_tree_till_number(6, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_till_number(6, ?NUMBER_ACTIONS, ?WIDTH), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(6 div 2)))), ok. @@ -2002,7 +2002,7 @@ insert_b_tree_order_6_till_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_512_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(512, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(512, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_512, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(512 div 2)))), ok. @@ -2012,7 +2012,7 @@ insert_b_tree_order_512_test(_Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_64_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(64, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(64, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_64, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(64 div 2)))), ok. @@ -2023,7 +2023,7 @@ insert_b_tree_order_64_test(_Config) -> insert_b_tree_order_8_even_odd_test(Config) -> KeyValues = ?config(key_values_from_even_odd, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 8), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 8), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(8 div 2)))), ok. @@ -2034,7 +2034,7 @@ insert_b_tree_order_8_even_odd_test(Config) -> insert_b_tree_order_8_odd_even_test(Config) -> KeyValues = ?config(key_values_from_odd_even, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 8), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 8), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(8 div 2)))), ok. @@ -2045,7 +2045,7 @@ insert_b_tree_order_8_odd_even_test(Config) -> insert_b_tree_order_8_random_test(Config) -> KeyValues = ?config(key_values_random, Config), - _BTree = test_generator:generate_b_tree_list_and_order(KeyValues, 8), + _BTree = b_trees_generator:generate_b_tree_list_and_order(KeyValues, 8), ?assertEqual(?NUMBER_ACTIONS, b_trees:size_key_values(_BTree)), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(8 div 2)))), ok. @@ -2055,7 +2055,7 @@ insert_b_tree_order_8_random_test(Config) -> %%-------------------------------------------------------------------- insert_b_tree_order_8_test(_Config) -> - _BTree = test_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH), + _BTree = b_trees_generator:generate_b_tree_from_number(8, ?NUMBER_ACTIONS, ?WIDTH), ?assertEqual(?config(b_tree_8, _Config), _BTree), ?assert(b_trees:height(_BTree) =< trunc((math:log((?NUMBER_ACTIONS + 1) / 2) / math:log(8 div 2)))), ok. @@ -2065,7 +2065,7 @@ insert_b_tree_order_8_test(_Config) -> %%-------------------------------------------------------------------- insert_gb_tree_test(_Config) -> - ?assertEqual(?config(gb_tree, _Config), test_generator:generate_gb_tree_from_number(?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(?config(gb_tree, _Config), b_trees_generator:generate_gb_tree_from_number(?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -2897,7 +2897,7 @@ map_b_tree_order_1024_dets_test(Config) -> BTree = ?config(b_tree_1024_dets_map, Config), BTreeNew = ?config(b_tree_1024_dets_new, Config), {ok, _} = dets:open_file(b_tree_1024_dets_map, [{file, ?DIRECTORY_DETS ++ "b_tree_1024_dets_map"}]), - test_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), + b_trees_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), dets:close(b_tree_1024_dets_map). %%-------------------------------------------------------------------- @@ -2908,7 +2908,7 @@ map_b_tree_order_1024_ets_test(Config) -> BTree = ?config(b_tree_1024_ets_map, Config), BTreeNew = ?config(b_tree_1024_ets_new, Config), {_, _, _, _, {StateTarget, _, _, _}, _} = BTreeMap = b_trees:map(fun map_value_to_new/2, BTree), - test_generator:check_equal(BTreeNew, BTreeMap), + b_trees_generator:check_equal(BTreeNew, BTreeMap), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTreeMap), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -2920,7 +2920,7 @@ map_b_tree_order_1024_ets_test(Config) -> map_b_tree_order_1024_mnesia_test(Config) -> BTree = ?config(b_tree_1024_mnesia_map, Config), BTreeNew = ?config(b_tree_1024_mnesia_new, Config), - test_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), + b_trees_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), ok. %%-------------------------------------------------------------------- @@ -2984,7 +2984,7 @@ map_b_tree_order_4_dets_test(Config) -> BTree = ?config(b_tree_4_dets_map, Config), BTreeNew = ?config(b_tree_4_dets_new, Config), {ok, _} = dets:open_file(b_tree_4_dets_map, [{file, ?DIRECTORY_DETS ++ "b_tree_4_dets_map"}]), - test_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), + b_trees_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), dets:close(b_tree_4_dets_map). %%-------------------------------------------------------------------- @@ -2995,7 +2995,7 @@ map_b_tree_order_4_ets_test(Config) -> BTree = ?config(b_tree_4_ets_map, Config), BTreeNew = ?config(b_tree_4_ets_new, Config), {_, _, _, _, {StateTarget, _, _, _}, _} = BTreeMap = b_trees:map(fun map_value_to_new/2, BTree), - test_generator:check_equal(BTreeNew, BTreeMap), + b_trees_generator:check_equal(BTreeNew, BTreeMap), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTreeMap), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -3007,7 +3007,7 @@ map_b_tree_order_4_ets_test(Config) -> map_b_tree_order_4_mnesia_test(Config) -> BTree = ?config(b_tree_4_mnesia_map, Config), BTreeNew = ?config(b_tree_4_mnesia_new, Config), - test_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), + b_trees_generator:check_equal(BTreeNew, b_trees:map(fun map_value_to_new/2, BTree)), ok. %%-------------------------------------------------------------------- @@ -3218,7 +3218,7 @@ smallest_gb_tree_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_1024_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(1024)}, test_generator:take_any_b_tree_from(1024, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(1024)}, b_trees_generator:take_any_b_tree_from(1024, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3226,7 +3226,7 @@ take_any_b_tree_order_1024_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_128_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(128)}, test_generator:take_any_b_tree_from(128, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(128)}, b_trees_generator:take_any_b_tree_from(128, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3234,7 +3234,7 @@ take_any_b_tree_order_128_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_16_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(16)}, test_generator:take_any_b_tree_from(16, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(16)}, b_trees_generator:take_any_b_tree_from(16, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3242,7 +3242,7 @@ take_any_b_tree_order_16_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_256_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(256)}, test_generator:take_any_b_tree_from(256, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(256)}, b_trees_generator:take_any_b_tree_from(256, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3250,7 +3250,7 @@ take_any_b_tree_order_256_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_32_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(32)}, test_generator:take_any_b_tree_from(32, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(32)}, b_trees_generator:take_any_b_tree_from(32, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3258,7 +3258,7 @@ take_any_b_tree_order_32_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_4_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(4)}, test_generator:take_any_b_tree_from(4, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(4)}, b_trees_generator:take_any_b_tree_from(4, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3266,7 +3266,7 @@ take_any_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_512_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(512)}, test_generator:take_any_b_tree_from(512, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(512)}, b_trees_generator:take_any_b_tree_from(512, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3274,7 +3274,7 @@ take_any_b_tree_order_512_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_5_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(5)}, test_generator:take_any_b_tree_from(5, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(5)}, b_trees_generator:take_any_b_tree_from(5, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3282,7 +3282,7 @@ take_any_b_tree_order_5_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_64_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(64)}, test_generator:take_any_b_tree_from(64, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(64)}, b_trees_generator:take_any_b_tree_from(64, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3290,7 +3290,7 @@ take_any_b_tree_order_64_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_6_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(6)}, test_generator:take_any_b_tree_from(6, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(6)}, b_trees_generator:take_any_b_tree_from(6, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3298,7 +3298,7 @@ take_any_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- take_any_b_tree_order_8_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(8)}, test_generator:take_any_b_tree_from(8, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(8)}, b_trees_generator:take_any_b_tree_from(8, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3308,7 +3308,7 @@ take_any_b_tree_order_8_test(_Config) -> take_any_gb_tree_test(_Config) -> case ?OTP_RELEASE > "19" of true -> - ?assertEqual({?LARGEST_VALUE, gb_trees:empty()}, test_generator:take_any_gb_tree_from(?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, gb_trees:empty()}, b_trees_generator:take_any_gb_tree_from(?NUMBER_ACTIONS, ?WIDTH)), ok; _ -> not_available @@ -3319,7 +3319,7 @@ take_any_gb_tree_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_1024_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(1024)}, test_generator:take_b_tree_from(1024, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(1024)}, b_trees_generator:take_b_tree_from(1024, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3327,7 +3327,7 @@ take_b_tree_order_1024_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_128_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(128)}, test_generator:take_b_tree_from(128, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(128)}, b_trees_generator:take_b_tree_from(128, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3335,7 +3335,7 @@ take_b_tree_order_128_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_16_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(16)}, test_generator:take_b_tree_from(16, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(16)}, b_trees_generator:take_b_tree_from(16, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3343,7 +3343,7 @@ take_b_tree_order_16_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_256_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(256)}, test_generator:take_b_tree_from(256, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(256)}, b_trees_generator:take_b_tree_from(256, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3351,7 +3351,7 @@ take_b_tree_order_256_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_32_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(32)}, test_generator:take_b_tree_from(32, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(32)}, b_trees_generator:take_b_tree_from(32, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3359,7 +3359,7 @@ take_b_tree_order_32_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_4_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(4)}, test_generator:take_b_tree_from(4, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(4)}, b_trees_generator:take_b_tree_from(4, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3367,7 +3367,7 @@ take_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_512_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(512)}, test_generator:take_b_tree_from(512, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(512)}, b_trees_generator:take_b_tree_from(512, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3375,7 +3375,7 @@ take_b_tree_order_512_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_5_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(5)}, test_generator:take_b_tree_from(5, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(5)}, b_trees_generator:take_b_tree_from(5, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3383,7 +3383,7 @@ take_b_tree_order_5_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_64_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(64)}, test_generator:take_b_tree_from(64, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(64)}, b_trees_generator:take_b_tree_from(64, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3391,7 +3391,7 @@ take_b_tree_order_64_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_6_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(6)}, test_generator:take_b_tree_from(6, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(6)}, b_trees_generator:take_b_tree_from(6, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3399,7 +3399,7 @@ take_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- take_b_tree_order_8_test(_Config) -> - ?assertEqual({?LARGEST_VALUE, b_trees:empty(8)}, test_generator:take_b_tree_from(8, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, b_trees:empty(8)}, b_trees_generator:take_b_tree_from(8, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3409,7 +3409,7 @@ take_b_tree_order_8_test(_Config) -> take_gb_tree_test(_Config) -> case ?OTP_RELEASE > "19" of true -> - ?assertEqual({?LARGEST_VALUE, gb_trees:empty()}, test_generator:take_gb_tree_from(?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual({?LARGEST_VALUE, gb_trees:empty()}, b_trees_generator:take_gb_tree_from(?NUMBER_ACTIONS, ?WIDTH)), ok; _ -> not_available @@ -3420,7 +3420,7 @@ take_gb_tree_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_1024_dets_test(_Config) -> - test_generator:check_equal(b_trees:empty(1024), test_generator:take_largest_b_tree_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_1024)), + b_trees_generator:check_equal(b_trees:empty(1024), b_trees_generator:take_largest_b_tree_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_1024)), ok. %%-------------------------------------------------------------------- @@ -3428,8 +3428,8 @@ take_largest_b_tree_order_1024_dets_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_1024_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:take_largest_b_tree_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_1024, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(1024), BTree), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:take_largest_b_tree_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_1024, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(1024), BTree), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -3439,7 +3439,7 @@ take_largest_b_tree_order_1024_ets_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_1024_mnesia_test(_Config) -> - test_generator:check_equal(b_trees:empty(1024), test_generator:take_largest_b_tree_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_1024)), + b_trees_generator:check_equal(b_trees:empty(1024), b_trees_generator:take_largest_b_tree_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_1024)), ok. %%-------------------------------------------------------------------- @@ -3447,7 +3447,7 @@ take_largest_b_tree_order_1024_mnesia_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_1024_test(_Config) -> - ?assertEqual(b_trees:empty(1024), test_generator:take_largest_b_tree(1024, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(1024), b_trees_generator:take_largest_b_tree(1024, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3455,7 +3455,7 @@ take_largest_b_tree_order_1024_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_128_test(_Config) -> - ?assertEqual(b_trees:empty(128), test_generator:take_largest_b_tree(128, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(128), b_trees_generator:take_largest_b_tree(128, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3463,7 +3463,7 @@ take_largest_b_tree_order_128_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_16_test(_Config) -> - ?assertEqual(b_trees:empty(16), test_generator:take_largest_b_tree(16, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(16), b_trees_generator:take_largest_b_tree(16, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3471,7 +3471,7 @@ take_largest_b_tree_order_16_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_256_test(_Config) -> - ?assertEqual(b_trees:empty(256), test_generator:take_largest_b_tree(256, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(256), b_trees_generator:take_largest_b_tree(256, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3479,7 +3479,7 @@ take_largest_b_tree_order_256_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_32_test(_Config) -> - ?assertEqual(b_trees:empty(32), test_generator:take_largest_b_tree(32, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(32), b_trees_generator:take_largest_b_tree(32, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3487,7 +3487,7 @@ take_largest_b_tree_order_32_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_4_dets_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:take_largest_b_tree_dets(4, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_4)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:take_largest_b_tree_dets(4, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_4)), ok. %%-------------------------------------------------------------------- @@ -3495,8 +3495,8 @@ take_largest_b_tree_order_4_dets_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_4_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:take_largest_b_tree_ets(4, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_4, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(4), BTree), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:take_largest_b_tree_ets(4, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_4, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(4), BTree), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -3506,7 +3506,7 @@ take_largest_b_tree_order_4_ets_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_4_mnesia_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:take_largest_b_tree_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_4)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:take_largest_b_tree_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, take_largest_order_4)), ok. %%-------------------------------------------------------------------- @@ -3514,7 +3514,7 @@ take_largest_b_tree_order_4_mnesia_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_4_test(_Config) -> - ?assertEqual(b_trees:empty(4), test_generator:take_largest_b_tree(4, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(4), b_trees_generator:take_largest_b_tree(4, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3522,7 +3522,7 @@ take_largest_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_5_test(_Config) -> - ?assertEqual(b_trees:empty(5), test_generator:take_largest_b_tree(5, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(5), b_trees_generator:take_largest_b_tree(5, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3530,7 +3530,7 @@ take_largest_b_tree_order_5_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_6_test(_Config) -> - ?assertEqual(b_trees:empty(6), test_generator:take_largest_b_tree(6, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(6), b_trees_generator:take_largest_b_tree(6, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3538,7 +3538,7 @@ take_largest_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_512_test(_Config) -> - ?assertEqual(b_trees:empty(512), test_generator:take_largest_b_tree(512, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(512), b_trees_generator:take_largest_b_tree(512, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3546,7 +3546,7 @@ take_largest_b_tree_order_512_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_64_test(_Config) -> - ?assertEqual(b_trees:empty(64), test_generator:take_largest_b_tree(64, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(64), b_trees_generator:take_largest_b_tree(64, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3554,7 +3554,7 @@ take_largest_b_tree_order_64_test(_Config) -> %%-------------------------------------------------------------------- take_largest_b_tree_order_8_test(_Config) -> - ?assertEqual(b_trees:empty(8), test_generator:take_largest_b_tree(8, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(8), b_trees_generator:take_largest_b_tree(8, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3562,7 +3562,7 @@ take_largest_b_tree_order_8_test(_Config) -> %%-------------------------------------------------------------------- take_largest_gb_tree_test(_Config) -> - ?assertEqual(gb_trees:empty(), test_generator:take_largest_gb_tree(?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(gb_trees:empty(), b_trees_generator:take_largest_gb_tree(?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3570,7 +3570,7 @@ take_largest_gb_tree_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_1024_dets_test(_Config) -> - test_generator:check_equal(b_trees:empty(1024), test_generator:take_smallest_b_tree_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_1024)), + b_trees_generator:check_equal(b_trees:empty(1024), b_trees_generator:take_smallest_b_tree_dets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_1024)), ok. %%-------------------------------------------------------------------- @@ -3578,8 +3578,8 @@ take_smallest_b_tree_order_1024_dets_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_1024_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:take_smallest_b_tree_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_1024, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(1024), BTree), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:take_smallest_b_tree_ets(1024, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_1024, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(1024), BTree), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -3589,7 +3589,7 @@ take_smallest_b_tree_order_1024_ets_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_1024_mnesia_test(_Config) -> - test_generator:check_equal(b_trees:empty(1024), test_generator:take_smallest_b_tree_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_1024)), + b_trees_generator:check_equal(b_trees:empty(1024), b_trees_generator:take_smallest_b_tree_mnesia(1024, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_1024)), ok. %%-------------------------------------------------------------------- @@ -3597,7 +3597,7 @@ take_smallest_b_tree_order_1024_mnesia_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_1024_test(_Config) -> - ?assertEqual(b_trees:empty(1024), test_generator:take_smallest_b_tree(1024, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(1024), b_trees_generator:take_smallest_b_tree(1024, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3605,7 +3605,7 @@ take_smallest_b_tree_order_1024_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_128_test(_Config) -> - ?assertEqual(b_trees:empty(128), test_generator:take_smallest_b_tree(128, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(128), b_trees_generator:take_smallest_b_tree(128, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3613,7 +3613,7 @@ take_smallest_b_tree_order_128_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_16_test(_Config) -> - ?assertEqual(b_trees:empty(16), test_generator:take_smallest_b_tree(16, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(16), b_trees_generator:take_smallest_b_tree(16, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3621,7 +3621,7 @@ take_smallest_b_tree_order_16_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_256_test(_Config) -> - ?assertEqual(b_trees:empty(256), test_generator:take_smallest_b_tree(256, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(256), b_trees_generator:take_smallest_b_tree(256, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3629,7 +3629,7 @@ take_smallest_b_tree_order_256_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_32_test(_Config) -> - ?assertEqual(b_trees:empty(32), test_generator:take_smallest_b_tree(32, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(32), b_trees_generator:take_smallest_b_tree(32, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3637,7 +3637,7 @@ take_smallest_b_tree_order_32_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_4_dets_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:take_smallest_b_tree_dets(4, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_4)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:take_smallest_b_tree_dets(4, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_4)), ok. %%-------------------------------------------------------------------- @@ -3645,8 +3645,8 @@ take_smallest_b_tree_order_4_dets_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_4_ets_test(_Config) -> - {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = test_generator:take_smallest_b_tree_ets(4, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_4, spawn(fun test_generator:ets_owner/0)), - test_generator:check_equal(b_trees:empty(4), BTree), + {_, _, _, _, {StateTarget, _, _, _}, _} = BTree = b_trees_generator:take_smallest_b_tree_ets(4, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_4, spawn(fun b_trees_generator:ets_owner/0)), + b_trees_generator:check_equal(b_trees:empty(4), BTree), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTree), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -3656,7 +3656,7 @@ take_smallest_b_tree_order_4_ets_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_4_mnesia_test(_Config) -> - test_generator:check_equal(b_trees:empty(4), test_generator:take_smallest_b_tree_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_4)), + b_trees_generator:check_equal(b_trees:empty(4), b_trees_generator:take_smallest_b_tree_mnesia(4, ?NUMBER_ACTIONS, ?WIDTH, take_smallest_order_4)), ok. %%-------------------------------------------------------------------- @@ -3664,7 +3664,7 @@ take_smallest_b_tree_order_4_mnesia_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_4_test(_Config) -> - ?assertEqual(b_trees:empty(4), test_generator:take_smallest_b_tree(4, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(4), b_trees_generator:take_smallest_b_tree(4, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3672,7 +3672,7 @@ take_smallest_b_tree_order_4_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_5_test(_Config) -> - ?assertEqual(b_trees:empty(5), test_generator:take_smallest_b_tree(5, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(5), b_trees_generator:take_smallest_b_tree(5, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3680,7 +3680,7 @@ take_smallest_b_tree_order_5_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_6_test(_Config) -> - ?assertEqual(b_trees:empty(6), test_generator:take_smallest_b_tree(6, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(6), b_trees_generator:take_smallest_b_tree(6, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3688,7 +3688,7 @@ take_smallest_b_tree_order_6_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_512_test(_Config) -> - ?assertEqual(b_trees:empty(512), test_generator:take_smallest_b_tree(512, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(512), b_trees_generator:take_smallest_b_tree(512, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3696,7 +3696,7 @@ take_smallest_b_tree_order_512_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_64_test(_Config) -> - ?assertEqual(b_trees:empty(64), test_generator:take_smallest_b_tree(64, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(64), b_trees_generator:take_smallest_b_tree(64, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3704,7 +3704,7 @@ take_smallest_b_tree_order_64_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_b_tree_order_8_test(_Config) -> - ?assertEqual(b_trees:empty(8), test_generator:take_smallest_b_tree(8, ?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(b_trees:empty(8), b_trees_generator:take_smallest_b_tree(8, ?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3712,7 +3712,7 @@ take_smallest_b_tree_order_8_test(_Config) -> %%-------------------------------------------------------------------- take_smallest_gb_tree_test(_Config) -> - ?assertEqual(gb_trees:empty(), test_generator:take_smallest_gb_tree(?NUMBER_ACTIONS, ?WIDTH)), + ?assertEqual(gb_trees:empty(), b_trees_generator:take_smallest_gb_tree(?NUMBER_ACTIONS, ?WIDTH)), ok. %%-------------------------------------------------------------------- @@ -3889,7 +3889,7 @@ update_b_tree_order_1024_dets_test(Config) -> BTree = ?config(b_tree_1024_dets_update, Config), KeyValuesUpdate = ?config(key_values_from_update, Config), {ok, _} = dets:open_file(b_tree_1024_dets_update, [{file, ?DIRECTORY_DETS ++ "b_tree_1024_dets_update"}]), - test_generator:check_equal(?config(b_tree_1024_dets_new, Config), update_b_tree(KeyValuesUpdate, BTree)), + b_trees_generator:check_equal(?config(b_tree_1024_dets_new, Config), update_b_tree(KeyValuesUpdate, BTree)), dets:close(b_tree_1024_dets_update). %%-------------------------------------------------------------------- @@ -3900,7 +3900,7 @@ update_b_tree_order_1024_ets_test(Config) -> BTree = ?config(b_tree_1024_ets_update, Config), KeyValuesUpdate = ?config(key_values_from_update, Config), {_, _, _, _, {StateTarget, _, _, _}, _} = BTreeUpdate = update_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_1024_ets_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_1024_ets_new, Config), BTreeUpdate), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTreeUpdate), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -3912,7 +3912,7 @@ update_b_tree_order_1024_ets_test(Config) -> update_b_tree_order_1024_mnesia_test(Config) -> BTree = ?config(b_tree_1024_mnesia_update, Config), KeyValuesUpdate = ?config(key_values_from_update, Config), - test_generator:check_equal(?config(b_tree_1024_mnesia_new, Config), update_b_tree(KeyValuesUpdate, BTree)), + b_trees_generator:check_equal(?config(b_tree_1024_mnesia_new, Config), update_b_tree(KeyValuesUpdate, BTree)), ok. %%-------------------------------------------------------------------- @@ -3978,7 +3978,7 @@ update_b_tree_order_4_dets_test(Config) -> BTree = ?config(b_tree_4_dets_update, Config), KeyValuesUpdate = ?config(key_values_from_update, Config), {ok, _} = dets:open_file(b_tree_4_dets_update, [{file, ?DIRECTORY_DETS ++ "b_tree_4_dets_update"}]), - test_generator:check_equal(?config(b_tree_4_dets_new, Config), update_b_tree(KeyValuesUpdate, BTree)), + b_trees_generator:check_equal(?config(b_tree_4_dets_new, Config), update_b_tree(KeyValuesUpdate, BTree)), dets:close(b_tree_4_dets_update). %%-------------------------------------------------------------------- @@ -3989,7 +3989,7 @@ update_b_tree_order_4_ets_test(Config) -> BTree = ?config(b_tree_4_ets_update, Config), KeyValuesUpdate = ?config(key_values_from_update, Config), {_, _, _, _, {StateTarget, _, _, _}, _} = BTreeUpdate = update_b_tree(KeyValuesUpdate, BTree), - test_generator:check_equal(?config(b_tree_4_ets_new, Config), BTreeUpdate), + b_trees_generator:check_equal(?config(b_tree_4_ets_new, Config), BTreeUpdate), {SizeNodesTotal, SizeNodesLeafes} = b_trees:size_nodes(BTreeUpdate), ?assertEqual(SizeNodesTotal - SizeNodesLeafes, length(ets:tab2list(StateTarget))), ok. @@ -4001,7 +4001,7 @@ update_b_tree_order_4_ets_test(Config) -> update_b_tree_order_4_mnesia_test(Config) -> BTree = ?config(b_tree_4_mnesia_update, Config), KeyValuesUpdate = ?config(key_values_from_update, Config), - test_generator:check_equal(?config(b_tree_4_mnesia_new, Config), update_b_tree(KeyValuesUpdate, BTree)), + b_trees_generator:check_equal(?config(b_tree_4_mnesia_new, Config), update_b_tree(KeyValuesUpdate, BTree)), ok. %%--------------------------------------------------------------------