Skip to content

Commit

Permalink
Remove old style type tests from test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
richcarl committed Dec 16, 2024
1 parent a5c67eb commit daf231f
Show file tree
Hide file tree
Showing 16 changed files with 211 additions and 379 deletions.
32 changes: 16 additions & 16 deletions lib/compiler/test/compilation_SUITE_data/compiler_1.erl
Original file line number Diff line number Diff line change
Expand Up @@ -171,24 +171,24 @@ system_info(Nodes) ->
?match(Nodes,mnesia:system_info(db_nodes)),
?match(Nodes,mnesia:system_info(running_db_nodes)),
?match(true,mnesia:system_info(have_disc)),
?match(A when atom(A),mnesia:system_info(debug)),
?match(L when list(L),mnesia:system_info(directory)),
?match(L when list(L),mnesia:system_info(log_version)),
?match(A when is_atom(A),mnesia:system_info(debug)),
?match(L when is_list(L),mnesia:system_info(directory)),
?match(L when is_list(L),mnesia:system_info(log_version)),
?match({_,_},mnesia:system_info(schema_version)),
?match(L when list(L),mnesia:system_info(tables)),
?match(L when list(L),mnesia:system_info(local_tables)),
?match(L when list(L),mnesia:system_info(held_locks)),
?match(L when list(L),mnesia:system_info(lock_queue)),
?match(L when list(L),mnesia:system_info(transactions)),
?match(I when integer(I),mnesia:system_info(transaction_failures)),
?match(I when integer(I),mnesia:system_info(transaction_commits)),
?match(I when integer(I),mnesia:system_info(transaction_restarts)),
?match(L when list(L),mnesia:system_info(checkpoints)),
?match(A when atom(A),mnesia:system_info(backup_module)),
?match(L when is_list(L),mnesia:system_info(tables)),
?match(L when is_list(L),mnesia:system_info(local_tables)),
?match(L when is_list(L),mnesia:system_info(held_locks)),
?match(L when is_list(L),mnesia:system_info(lock_queue)),
?match(L when is_list(L),mnesia:system_info(transactions)),
?match(I when is_integer(I),mnesia:system_info(transaction_failures)),
?match(I when is_integer(I),mnesia:system_info(transaction_commits)),
?match(I when is_integer(I),mnesia:system_info(transaction_restarts)),
?match(L when is_list(L),mnesia:system_info(checkpoints)),
?match(A when is_atom(A),mnesia:system_info(backup_module)),
?match(true,mnesia:system_info(auto_repair)),
?match({_,_},mnesia:system_info(dump_log_interval)),
?match(A when atom(A),mnesia:system_info(dump_log_update_in_place)),
?match(I when integer(I),mnesia:system_info(transaction_log_writes)),
?match(A when is_atom(A),mnesia:system_info(dump_log_update_in_place)),
?match(I when is_integer(I),mnesia:system_info(transaction_log_writes)),
?match({'EXIT',{aborted,badarg}},mnesia:system_info(ali_baba)),
done.

Expand All @@ -210,7 +210,7 @@ table_info(Nodes) ->
Keys = lists:seq(1,Size),
Records = [{Tab,A,7} || A <- Keys],
lists:foreach(fun(Rec) -> ?match(ok,mnesia:dirty_write(Rec)) end,Records),
?match(Mem when integer(Mem),mnesia:table_info(Tab,memory)),
?match(Mem when is_integer(Mem),mnesia:table_info(Tab,memory)),
?match(Size,mnesia:table_info(Tab,size)),
?match(Type,mnesia:table_info(Tab,type)),
?match([Node3],mnesia:table_info(Tab,disc_copies)),
Expand Down
30 changes: 15 additions & 15 deletions lib/compiler/test/compilation_SUITE_data/convopts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ convopts(Opts) ->
[case Active of
[{active, true}] ->
[{R, <<?UINT32_MAX:32>>}];
[{active, N}] when integer(N),
[{active, N}] when is_integer(N),
0 =< N, N < ?UINT32_MAX ->
[{R, <<N:32>>}];
[{active, N}] when integer(N),
[{active, N}] when is_integer(N),
-?UINT32_MAX < N, N < 0 ->
[{RR, <<-N:32>>}];
[{active, once}] ->
Expand Down Expand Up @@ -92,17 +92,17 @@ convopts(Opts) ->
case Dest of
%% Port addressed message
[{dest, {tipc_port_id, Port, Proc}}]
when binary(Port),
integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX
when is_binary(Port),
is_integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX
;
list(Port),
integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX ->
is_list(Port),
is_integer(Proc), 0 =< Proc, Proc =< ?UINT32_MAX ->
[{$p, [Port | <<Proc:32>>]}];
%% Name addressed message
[{dest, {tipc_name, Type, Inst, Zone}}]
when integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
integer(Zone), 0 =< Zone, Zone =< ?UINT32_MAX ->
when is_integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
is_integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
is_integer(Zone), 0 =< Zone, Zone =< ?UINT32_MAX ->
[{$B, <<Type:32, Inst:32, Zone:32>>}];
%%
%% This undocumented clause uses an undocumented
Expand All @@ -117,13 +117,13 @@ convopts(Opts) ->
[{dest, {tipc_name, Type, Inst,
{tipc_processor_id,
Zone, Subnetwork, Processor}}}]
when integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
integer(Zone),
when is_integer(Type), 0 =< Type, Type =< ?UINT32_MAX,
is_integer(Inst), 0 =< Inst, Inst =< ?UINT32_MAX,
is_integer(Zone),
0 =< Zone, Zone < 16#FF,
integer(Subnetwork),
is_integer(Subnetwork),
0 =< Subnetwork, Subnetwork < 16#FFF,
integer(Processor),
is_integer(Processor),
0 =< Processor, Processor < 16#FFF ->
[{$B, <<Type:32,
Inst:32,
Expand All @@ -140,7 +140,7 @@ convopts(Opts) ->



getopts(List, Options) when list(List), list(Options) ->
getopts(List, Options) when is_list(List), is_list(Options) ->
getopts_1(Options, List, []).

getopts_1([], List, Result) ->
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/test/compilation_SUITE_data/otp_5235.erl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ run(0, L) -> L;
run(N, L) -> run(N-1, reverse(L)).

reverse([]) -> [];
reverse([H|R]) when record(H, commit) ->
reverse([H|R]) when is_record(H, commit) ->
[H#commit{
ram_copies = lists:reverse(H#commit.ram_copies),
disc_copies = lists:reverse(H#commit.disc_copies),
Expand Down
Loading

0 comments on commit daf231f

Please sign in to comment.