Skip to content

Commit 1f693ce

Browse files
committed
In progress updates to PropEr tests for rings
1 parent 80748db commit 1f693ce

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ERLC_OPTS := +debug_info +"{cover_enabled, true}"
1010
TEST_ERLC_OPTS := -I include -I test/epocxy $(ERLC_OPTS)
1111

1212
CT_OPTS := -cover test/epocxy.coverspec
13-
CT_SUITES = epocxy_sup epocxy_ets_fsm ets_ring_buffer_ro ets_buffer cxy_ctl cxy_cache
13+
CT_SUITES = ets_ring_buffer_ro
14+
## epocxy_sup epocxy_ets_fsm ets_ring_buffer_ro ets_buffer cxy_ctl cxy_cache
1415

1516
DIALYZER_OPTS := -I include -Werror_handling -Wrace_conditions -Wunmatched_returns
1617

test/epocxy/ets_ring_buffer_ro_SUITE.erl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
]).
2323

2424
-export([
25-
proper_check_create/1
25+
proper_new_ring_is_empty/1
2626
]).
2727

2828
-include("epocxy_common_test.hrl").
@@ -33,7 +33,7 @@
3333
-spec all() -> [test_case() | {group, test_group()}].
3434

3535
all() -> [
36-
proper_check_create % Ensure we can create new rings
36+
proper_new_ring_is_empty % Ensure we can create new rings
3737
].
3838

3939
%% -spec groups() -> [test_group(), [sequence], [test_case() | {group, test_group()}]].
@@ -70,17 +70,17 @@ end_per_testcase (_Test_Case, Config) -> Config.
7070
gen_ring_names() ->
7171
?LET(Ring_Names, list(atom()), Ring_Names).
7272

73-
%% Validate any atom can be used as a ring_name and list will report properly.
73+
%% Validate any atom can be used as a ring_name and ring is empty by default.
7474
-spec proper_check_create(config()) -> ok.
75-
proper_check_create(_Config) ->
75+
proper_new_ring_is_empty(_Config) ->
7676
{ok, Sup_Pid} = epocxy_sup:start_link(),
7777
Fsm_Pid = whereis(epocxy_ets_fsm),
7878

7979
ct:log("Test using an atom as a ring name"),
8080
Test_Ring_Name = ?FORALL(Names, gen_ring_names(),
8181
case [N || N <- Names, N =/= ''] of
8282
[] -> true;
83-
Ring_Names -> check_create_test(Ring_Names, Sup_Pid, Fsm_Pid)
83+
Ring_Names -> check_empty_create(Ring_Names, Sup_Pid, Fsm_Pid)
8484
end),
8585
true = proper:quickcheck(Test_Ring_Name, ?PQ_NUM(5)),
8686
ct:comment("Successfully tested atoms as ring_names"),
@@ -89,16 +89,14 @@ proper_check_create(_Config) ->
8989
cleanup(Sup_Pid, Fsm_Pid),
9090
ok.
9191

92-
check_create_test(Ring_Names, Sup_Pid, Fsm_Pid) ->
92+
check_empty_create(Ring_Names, Sup_Pid, Fsm_Pid) ->
9393
%% No rings exist yet...
9494
[] = ?TM:list(),
9595
[] = ?TM:list(missing_ring),
9696

9797
ct:comment ("Testing ring_names ~p", [Ring_Names]),
9898
ct:log ("Testing ring_names ~p", [Ring_Names]),
99-
Num_Rings = length(Ring_Names),
100-
Exp_Counts = lists:duplicate(Num_Rings, 0),
101-
Exp_Counts = [check_one_ring(R) || R <- Ring_Names],
99+
[check_empty_ring(R) || R <- Ring_Names],
102100

103101
ct:comment("Deleting all rings"),
104102
Exp_Deletes = lists:duplicate(Num_Rings, true),
@@ -107,7 +105,7 @@ check_create_test(Ring_Names, Sup_Pid, Fsm_Pid) ->
107105

108106
true.
109107

110-
check_one_ring(Ring_Name) ->
108+
check_empty_ring(Ring_Name) ->
111109
true = ?TM:create (Ring_Name),
112110
0 = ?TM:ring_size (Ring_Name).
113111

0 commit comments

Comments
 (0)