diff options
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/code_SUITE.erl | 40 | ||||
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 5 | ||||
-rw-r--r-- | lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c | 2 | ||||
-rw-r--r-- | lib/kernel/test/prim_file_SUITE.erl | 15 |
4 files changed, 42 insertions, 20 deletions
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 37b9200942..08b6477c9d 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -543,8 +543,8 @@ add_del_path(Config) when is_list(Config) -> ?line code:del_path(Dir2), ?line PrivDir1 = code:priv_dir(dummy_app), ok. - - + + clash(Config) when is_list(Config) -> DDir = ?config(data_dir,Config)++"clash/", P = code:get_path(), @@ -555,11 +555,11 @@ clash(Config) when is_list(Config) -> ?line true = code:del_path("."), ?line true = code:add_path(DDir++"foobar-0.1/ebin"), ?line true = code:add_path(DDir++"zork-0.8/ebin"), - ?line test_server:capture_start(), - ?line code:clash(), - ?line test_server:capture_stop(), - ?line OKMsg = test_server:capture_get(), - ?line lists:prefix("** Found 0 name clashes in code paths", OKMsg), + test_server:capture_start(), + ?line ok = code:clash(), + test_server:capture_stop(), + ?line [OKMsg|_] = test_server:capture_get(), + ?line true = lists:prefix("** Found 0 name clashes", OKMsg), ?line true = code:set_path(P), %% test clashing entries @@ -568,13 +568,29 @@ clash(Config) when is_list(Config) -> ?line true = code:del_path("."), ?line true = code:add_path(DDir++"foobar-0.1/ebin"), ?line true = code:add_path(DDir++"foobar-0.1.ez/foobar-0.1/ebin"), - ?line test_server:capture_start(), - ?line code:clash(), - ?line test_server:capture_stop(), - ?line [ErrMsg1|_] = test_server:capture_get(), - ?line {match, [" hides "]} = re:run(ErrMsg1, "\\*\\* .*( hides ).*", + test_server:capture_start(), + ?line ok = code:clash(), + test_server:capture_stop(), + ?line [ClashMsg|_] = test_server:capture_get(), + ?line {match, [" hides "]} = re:run(ClashMsg, "\\*\\* .*( hides ).*", [{capture,all_but_first,list}]), ?line true = code:set_path(P), + + %% test "Bad path can't read" + + %% remove "." to prevent clash with test-server path + Priv = ?config(priv_dir, Config), + ?line true = code:del_path("."), + TmpEzFile = Priv++"foobar-0.tmp.ez", + ?line {ok, _} = file:copy(DDir++"foobar-0.1.ez", TmpEzFile), + ?line true = code:add_path(TmpEzFile++"/foobar-0.1/ebin"), + ?line ok = file:delete(TmpEzFile), + test_server:capture_start(), + ?line ok = code:clash(), + test_server:capture_stop(), + ?line [BadPathMsg|_] = test_server:capture_get(), + ?line true = lists:prefix("** Bad path can't read", BadPathMsg), + ?line true = code:set_path(P), ok. ext_mod_dep(suite) -> diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index d01e1f1fcf..1d170790a3 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -270,7 +270,10 @@ make_del_dir(Config) when is_list(Config) -> %% Try deleting some bad directories %% Deleting the parent directory to the current, sounds dangerous, huh? %% Don't worry ;-) the parent directory should never be empty, right? - ?line {error, eexist} = ?FILE_MODULE:del_dir('..'), + case ?FILE_MODULE:del_dir('..') of + {error, eexist} -> ok; + {error, einval} -> ok %FreeBSD + end, ?line {error, enoent} = ?FILE_MODULE:del_dir(""), ?line {error, badarg} = ?FILE_MODULE:del_dir([3,2,1,{}]), diff --git a/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c b/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c index fb3c622909..f24c93edf5 100644 --- a/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c +++ b/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c @@ -1,4 +1,4 @@ -#if defined(VXWORKS) || defined(__OSE__) +#if defined(VXWORKS) #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 860aeecbf4..6badbb5090 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 2000-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% %% -module(prim_file_SUITE). @@ -243,7 +243,10 @@ make_del_dir(Config, Handle, Suffix) -> %% Try deleting some bad directories %% Deleting the parent directory to the current, sounds dangerous, huh? %% Don't worry ;-) the parent directory should never be empty, right? - ?line {error, eexist} = ?PRIM_FILE_call(del_dir, Handle, [".."]), + case ?PRIM_FILE_call(del_dir, Handle, [".."]) of + {error, eexist} -> ok; + {error, einval} -> ok %FreeBSD + end, ?line {error, enoent} = ?PRIM_FILE_call(del_dir, Handle, [""]), ?line {error, badarg} = ?PRIM_FILE_call(del_dir, Handle, [[3,2,1,{}]]), |