aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_appup_test.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-03-16 06:54:37 +0000
committerErlang/OTP <[email protected]>2010-03-16 06:54:37 +0000
commit7a18238092f56b6c49c1fa798fa5b3858dbce5cc (patch)
treebdc73c3a8fd680a016985e5a4984f74510fc1dde /lib/asn1/test/asn1_appup_test.erl
parent3aa73b1a0345c0ce851081567c220697eeba4233 (diff)
parent878f36c7a66e8f7459de660bf2713fb1f75c2dfb (diff)
downloadotp-7a18238092f56b6c49c1fa798fa5b3858dbce5cc.tar.gz
otp-7a18238092f56b6c49c1fa798fa5b3858dbce5cc.tar.bz2
otp-7a18238092f56b6c49c1fa798fa5b3858dbce5cc.zip
Merge branch 'bg/asn1-tests' into dev
* bg/asn1-tests: asn1 tests: Let ts:run() build the tests asn1 tests: No longer tolerate compilation warnings asn1 tests: Eliminate use of deprecated concat_binary/1 asn1 tests: Eliminate warning for an unused variable asn1 tests: Modernize guard tests asn1 tests: Clean up comments asn1 tests: Don't refer to $ERL_TOP in compiler options OTP-8520 bg/asn1-tests
Diffstat (limited to 'lib/asn1/test/asn1_appup_test.erl')
-rw-r--r--lib/asn1/test/asn1_appup_test.erl56
1 files changed, 21 insertions, 35 deletions
diff --git a/lib/asn1/test/asn1_appup_test.erl b/lib/asn1/test/asn1_appup_test.erl
index 644c0f7d03..81701328a6 100644
--- a/lib/asn1/test/asn1_appup_test.erl
+++ b/lib/asn1/test/asn1_appup_test.erl
@@ -1,43 +1,29 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
%%----------------------------------------------------------------------
-%% Purpose: Verify the application specifics of the Megaco application
+%% Purpose: Verify the application specifics of the asn1 application
%%----------------------------------------------------------------------
-module(asn1_appup_test).
-compile(export_all).
-%-include("megaco_test_lib.hrl").
-
-
-%t() -> megaco_test_lib:t(?MODULE).
-%t(Case) -> megaco_test_lib:t({?MODULE, Case}).
-
-
-%% Test server callbacks
-% init_per_testcase(Case, Config) ->
-% megaco_test_lib:init_per_testcase(Case, Config).
-
-% fin_per_testcase(Case, Config) ->
-% megaco_test_lib:fin_per_testcase(Case, Config).
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
all(suite) ->
@@ -51,7 +37,7 @@ all(suite) ->
appup_init(suite) -> [];
appup_init(doc) -> [];
-appup_init(Config) when list(Config) ->
+appup_init(Config) when is_list(Config) ->
AppFile = file_name(asn1, ".app"),
AppupFile = file_name(asn1, ".appup"),
[{app_file, AppFile}, {appup_file, AppupFile}|Config].
@@ -64,7 +50,7 @@ file_name(App, Ext) ->
appup_fin(suite) -> [];
appup_fin(doc) -> [];
-appup_fin(Config) when list(Config) ->
+appup_fin(Config) when is_list(Config) ->
Config.
@@ -74,7 +60,7 @@ appup(suite) ->
[];
appup(doc) ->
"perform a simple check of the appup file";
-appup(Config) when list(Config) ->
+appup(Config) when is_list(Config) ->
AppupFile = key1search(appup_file, Config),
AppFile = key1search(app_file, Config),
Modules = modules(AppFile),
@@ -161,14 +147,14 @@ check_instructions(UpDown, [Instr|Instrs], AllInstr, Good, Bad, Modules) ->
%% A new module is added
check_instruction(up, {add_module, Module}, _, Modules)
- when atom(Module) ->
+ when is_atom(Module) ->
d("check_instruction -> entry when up-add_module instruction with"
"~n Module: ~p", [Module]),
check_module(Module, Modules);
%% An old module is re-added
check_instruction(down, {add_module, Module}, _, Modules)
- when atom(Module) ->
+ when is_atom(Module) ->
d("check_instruction -> entry when down-add_module instruction with"
"~n Module: ~p", [Module]),
case (catch check_module(Module, Modules)) of
@@ -182,7 +168,7 @@ check_instruction(down, {add_module, Module}, _, Modules)
%% - the module has been removed from the app-file.
%% - check that no module depends on this (removed) module
check_instruction(up, {remove, {Module, Pre, Post}}, _, Modules)
- when atom(Module), atom(Pre), atom(Post) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post) ->
d("check_instruction -> entry when up-remove instruction with"
"~n Module: ~p"
"~n Pre: ~p"
@@ -198,7 +184,7 @@ check_instruction(up, {remove, {Module, Pre, Post}}, _, Modules)
%% Removing a module on downgrade: the module exist
%% in the app-file.
check_instruction(down, {remove, {Module, Pre, Post}}, AllInstr, Modules)
- when atom(Module), atom(Pre), atom(Post) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post) ->
d("check_instruction -> entry when down-remove instruction with"
"~n Module: ~p"
"~n Pre: ~p"
@@ -214,7 +200,7 @@ check_instruction(down, {remove, {Module, Pre, Post}}, AllInstr, Modules)
check_instruction(_, {load_module, Module, Pre, Post, Depend},
AllInstr, Modules)
- when atom(Module), atom(Pre), atom(Post), list(Depend) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post), is_list(Depend) ->
d("check_instruction -> entry when load_module instruction with"
"~n Module: ~p"
"~n Pre: ~p"
@@ -228,7 +214,7 @@ check_instruction(_, {load_module, Module, Pre, Post, Depend},
check_instruction(_, {update, Module, Change, Pre, Post, Depend},
AllInstr, Modules)
- when atom(Module), atom(Pre), atom(Post), list(Depend) ->
+ when is_atom(Module), is_atom(Pre), is_atom(Post), is_list(Depend) ->
d("check_instruction -> entry when update instruction with"
"~n Module: ~p"
"~n Change: ~p"
@@ -244,7 +230,7 @@ check_instruction(_, {update, Module, Change, Pre, Post, Depend},
check_instruction(_, {apply, {Module, Function, Args}},
_AllInstr, Modules)
- when atom(Module), atom(Function), list(Args) ->
+ when is_atom(Module), is_atom(Function), is_list(Args) ->
d("check_instruction -> entry when apply instruction with"
"~n Module: ~p"
"~n Function: ~p"
@@ -289,13 +275,13 @@ instruction_module(Instr) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-check_version(V) when list(V) ->
+check_version(V) when is_list(V) ->
ok;
check_version(V) ->
error({bad_version, V}).
-check_module(M, Modules) when atom(M) ->
+check_module(M, Modules) when is_atom(M) ->
case lists:member(M,Modules) of
true ->
ok;
@@ -307,7 +293,7 @@ check_module(M, _) ->
check_apply(Module,Function,Args) ->
case (catch Module:module_info()) of
- Info when list(Info) ->
+ Info when is_list(Info) ->
check_exported(Function,Args,Info);
{'EXIT',{undef,_}} ->
error({not_existing_module,Module})
@@ -326,11 +312,11 @@ check_exported(Function,Args,Info) ->
error({bad_export,Info})
end.
-check_module_depend(M, [], _) when atom(M) ->
+check_module_depend(M, [], _) when is_atom(M) ->
d("check_module_depend -> entry with"
"~n M: ~p", [M]),
ok;
-check_module_depend(M, Deps, Modules) when atom(M), list(Deps) ->
+check_module_depend(M, Deps, Modules) when is_atom(M), is_list(Deps) ->
d("check_module_depend -> entry with"
"~n M: ~p"
"~n Deps: ~p"