aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-08-21 08:10:50 +0200
committerHans Bolinder <[email protected]>2018-08-21 08:20:53 +0200
commit4734964a6290c32fc20095d46140053e193379f5 (patch)
treee25b33491894c738916e59d6beab2e987ad9f735 /lib/stdlib/test
parentf2fec6ae41ba9300404614e96b3833613ee1db0d (diff)
downloadotp-4734964a6290c32fc20095d46140053e193379f5.tar.gz
otp-4734964a6290c32fc20095d46140053e193379f5.tar.bz2
otp-4734964a6290c32fc20095d46140053e193379f5.zip
stdlib: Let dets:open_file() crash when given raw file name
See also ERL-55 and OTP-13229.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/dets_SUITE.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl
index fe324391af..65977a764a 100644
--- a/lib/stdlib/test/dets_SUITE.erl
+++ b/lib/stdlib/test/dets_SUITE.erl
@@ -3417,6 +3417,7 @@ otp_11709(Config) when is_list(Config) ->
ok.
%% OTP-13229. open_file() exits with badarg when given binary file name.
+%% Also OTP-15253.
otp_13229(_Config) ->
F = <<"binfile.tab">>,
try dets:open_file(name, [{file, F}]) of
@@ -3425,6 +3426,20 @@ otp_13229(_Config) ->
catch
error:badarg ->
ok
+ end,
+ try dets:open_file(F, []) of % OTP-15253
+ R2 ->
+ exit({open_succeeded, R2})
+ catch
+ error:badarg ->
+ ok
+ end,
+ try dets:open_file(F) of
+ R3 ->
+ exit({open_succeeded, R3})
+ catch
+ error:badarg ->
+ ok
end.
%% OTP-13260. Race when opening a table.