diff options
author | Sverker Eriksson <[email protected]> | 2014-03-12 17:10:32 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-03-24 21:09:49 +0100 |
commit | f52688de73577b59475cf95acc80fb199e1dc08e (patch) | |
tree | 2f617464c7b85bf98b44930c67780d4494c4f247 /lib/kernel/test/file_SUITE.erl | |
parent | 2d2ce325546bc93178d1343e2a53911b890cc259 (diff) | |
download | otp-f52688de73577b59475cf95acc80fb199e1dc08e.tar.gz otp-f52688de73577b59475cf95acc80fb199e1dc08e.tar.bz2 otp-f52688de73577b59475cf95acc80fb199e1dc08e.zip |
erts: Skip tests of file:set_cwd for too long path on Windows
Diffstat (limited to 'lib/kernel/test/file_SUITE.erl')
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index e4eca4b756..2ffdf30cb3 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -416,14 +416,13 @@ make_del_dir(Config) when is_list(Config) -> % because there are processes having that directory as current. ?line ok = ?FILE_MODULE:make_dir(NewDir), ?line {ok,CurrentDir} = file:get_cwd(), - case {os:type(), length(NewDir) >= 260 } of - {{win32,_}, true} -> - io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH)\n", []), - io:format("\nNewDir = ~p\n", [NewDir]), - ok; - _ -> - ?line ok = ?FILE_MODULE:set_cwd(NewDir) - end, + case {os:type(), length(NewDir) >= 260 } of + {{win32,_}, true} -> + io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH)\n", []), + io:format("\nNewDir = ~p\n", [NewDir]); + _ -> + ?line ok = ?FILE_MODULE:set_cwd(NewDir) + end, try %% Check that we get an error when trying to create... %% a deep directory @@ -480,39 +479,38 @@ cur_dir_0(Config) when is_list(Config) -> atom_to_list(?MODULE) ++"_curdir"), ?line ok = ?FILE_MODULE:make_dir(NewDir), - case {os:type(), length(NewDir) >= 260} of - {{win32,_}, true} -> - io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH):\n"), - io:format("\nNewDir = ~p\n", [NewDir]), - ok; - _ -> - io:format("cd to ~s",[NewDir]), - ok = ?FILE_MODULE:set_cwd(NewDir), - - %% Create a file in the new current directory, and check that it - %% really is created there - UncommonName = "uncommon.fil", - {ok,Fd} = ?FILE_MODULE:open(UncommonName,read_write), - ok = ?FILE_MODULE:close(Fd), - {ok,NewDirFiles} = ?FILE_MODULE:list_dir("."), - true = lists:member(UncommonName,NewDirFiles), - - %% Delete the directory and return to the old current directory - %% and check that the created file isn't there (too!) - expect({error, einval}, {error, eacces}, - ?FILE_MODULE:del_dir(NewDir)), - ?FILE_MODULE:delete(UncommonName), - {ok,[]} = ?FILE_MODULE:list_dir("."), - ok = ?FILE_MODULE:set_cwd(Dir1), - io:format("cd back to ~s",[Dir1]), - - ok = ?FILE_MODULE:del_dir(NewDir), - {error, enoent} = ?FILE_MODULE:set_cwd(NewDir), - ok = ?FILE_MODULE:set_cwd(Dir1), - io:format("cd back to ~s",[Dir1]), - {ok,OldDirFiles} = ?FILE_MODULE:list_dir("."), - false = lists:member(UncommonName,OldDirFiles) - end, + case {os:type(), length(NewDir) >= 260} of + {{win32,_}, true} -> + io:format("Skip set_cwd for windows path longer than 260 (MAX_PATH):\n"), + io:format("\nNewDir = ~p\n", [NewDir]); + _ -> + io:format("cd to ~s",[NewDir]), + ok = ?FILE_MODULE:set_cwd(NewDir), + + %% Create a file in the new current directory, and check that it + %% really is created there + UncommonName = "uncommon.fil", + {ok,Fd} = ?FILE_MODULE:open(UncommonName,read_write), + ok = ?FILE_MODULE:close(Fd), + {ok,NewDirFiles} = ?FILE_MODULE:list_dir("."), + true = lists:member(UncommonName,NewDirFiles), + + %% Delete the directory and return to the old current directory + %% and check that the created file isn't there (too!) + expect({error, einval}, {error, eacces}, + ?FILE_MODULE:del_dir(NewDir)), + ?FILE_MODULE:delete(UncommonName), + {ok,[]} = ?FILE_MODULE:list_dir("."), + ok = ?FILE_MODULE:set_cwd(Dir1), + io:format("cd back to ~s",[Dir1]), + + ok = ?FILE_MODULE:del_dir(NewDir), + {error, enoent} = ?FILE_MODULE:set_cwd(NewDir), + ok = ?FILE_MODULE:set_cwd(Dir1), + io:format("cd back to ~s",[Dir1]), + {ok,OldDirFiles} = ?FILE_MODULE:list_dir("."), + false = lists:member(UncommonName,OldDirFiles) + end, %% Try doing some bad things ?line {error, badarg} = ?FILE_MODULE:set_cwd({foo,bar}), |