aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/dets_SUITE.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2010-10-21 09:16:09 +0200
committerHans Bolinder <[email protected]>2010-10-21 09:16:09 +0200
commit4e79fa3b1b6797f2583848d307d6b85cec94a920 (patch)
treea3a48f84f022bd48feb07e672d6f535db6e3398c /lib/stdlib/test/dets_SUITE.erl
parentce97ee6c7747fa5211257957688082e97d69d57f (diff)
parent74af6abf8fe889f04f9fcfc70d5a5facf0aa7053 (diff)
downloadotp-4e79fa3b1b6797f2583848d307d6b85cec94a920.tar.gz
otp-4e79fa3b1b6797f2583848d307d6b85cec94a920.tar.bz2
otp-4e79fa3b1b6797f2583848d307d6b85cec94a920.zip
Merge branch 'hb/stdlib/dets_fixed_dirty/OTP-8898' into dev
* hb/stdlib/dets_fixed_dirty/OTP-8898: Fix a bug concerning truncated Dets files Conflicts: lib/stdlib/src/dets.erl lib/stdlib/test/dets_SUITE.erl
Diffstat (limited to 'lib/stdlib/test/dets_SUITE.erl')
-rw-r--r--lib/stdlib/test/dets_SUITE.erl27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl
index b32d372889..ab8f3f300c 100644
--- a/lib/stdlib/test/dets_SUITE.erl
+++ b/lib/stdlib/test/dets_SUITE.erl
@@ -50,7 +50,7 @@
otp_4208/1, otp_4989/1, many_clients/1, otp_4906/1, otp_5402/1,
simultaneous_open/1, insert_new/1, repair_continuation/1,
otp_5487/1, otp_6206/1, otp_6359/1, otp_4738/1, otp_7146/1,
- otp_8070/1, otp_8856/1]).
+ otp_8070/1, otp_8856/1, otp_8898/1]).
-export([dets_dirty_loop/0]).
@@ -108,7 +108,7 @@ all(suite) ->
cache_duplicate_bags_v9, otp_4208, otp_4989, many_clients,
otp_4906, otp_5402, simultaneous_open, insert_new,
repair_continuation, otp_5487, otp_6206, otp_6359, otp_4738,
- otp_7146, otp_8070, otp_8856]}
+ otp_7146, otp_8070, otp_8856, otp_8898]}
end.
not_run(suite) -> [];
@@ -2935,6 +2935,29 @@ ets_init(Tab, N) ->
ets:insert(Tab, {N,N}),
ets_init(Tab, N - 1).
+otp_8898(doc) ->
+ ["OTP-8898. Truncated Dets file."];
+otp_8898(suite) ->
+ [];
+otp_8898(Config) when is_list(Config) ->
+ Tab = otp_8898,
+ ?line FName = filename(Tab, Config),
+
+ Server = self(),
+
+ ?line file:delete(FName),
+ ?line {ok, _} = dets:open_file(Tab,[{file, FName}]),
+ ?line [P1,P2,P3] = new_clients(3, Tab),
+
+ Seq = [{P1,[sync]},{P2,[{lookup,1,[]}]},{P3,[{insert,{1,b}}]}],
+ ?line atomic_requests(Server, Tab, [[]], Seq),
+ ?line true = get_replies([{P1,ok},{P2,ok},{P3,ok}]),
+ ?line ok = dets:close(Tab),
+ ?line {ok, _} = dets:open_file(Tab,[{file, FName}]),
+ ?line file:delete(FName),
+
+ ok.
+
many_clients(doc) ->
["Several clients accessing a table simultaneously."];
many_clients(suite) ->