summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2010-04-02 20:01:11 +0000
committerDamien F. Katz <damien@apache.org>2010-04-02 20:01:11 +0000
commitc1ba70c38adef885ee50687210732c3999951a08 (patch)
treec96c961c0f08cde85d990151937a6aa58b43e294 /test
parent3a30ebac70a7baef18719357c8b7ff00edbbfa83 (diff)
Deterministic/synchronous shutdown code.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@930363 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rwxr-xr-xtest/etap/010-file-basics.t15
-rwxr-xr-xtest/etap/040-util.t25
2 files changed, 15 insertions, 25 deletions
diff --git a/test/etap/010-file-basics.t b/test/etap/010-file-basics.t
index 09b2f2b1..a3599f1a 100755
--- a/test/etap/010-file-basics.t
+++ b/test/etap/010-file-basics.t
@@ -16,7 +16,7 @@ filename() -> test_util:build_file("test/etap/temp.010").
main(_) ->
test_util:init_code_path(),
- etap:plan(16),
+ etap:plan(19),
case (catch test()) of
ok ->
etap:end_tests();
@@ -67,6 +67,19 @@ test() ->
{ok, BinPos} = couch_file:append_binary(Fd, <<131,100,0,3,102,111,111>>),
etap:is({ok, foo}, couch_file:pread_term(Fd, BinPos),
"Reading a term from a written binary term representation succeeds."),
+
+ BigBin = list_to_binary(lists:duplicate(100000, 0)),
+ {ok, BigBinPos} = couch_file:append_binary(Fd, BigBin),
+ etap:is({ok, BigBin}, couch_file:pread_binary(Fd, BigBinPos),
+ "Reading a large term from a written representation succeeds."),
+
+ ok = couch_file:write_header(Fd, hello),
+ etap:is({ok, hello}, couch_file:read_header(Fd),
+ "Reading a header succeeds."),
+
+ {ok, BigBinPos2} = couch_file:append_binary(Fd, BigBin),
+ etap:is({ok, BigBin}, couch_file:pread_binary(Fd, BigBinPos2),
+ "Reading a large term from a written representation succeeds 2."),
% append_binary == append_iolist?
% Possible bug in pread_iolist or iolist() -> append_binary
diff --git a/test/etap/040-util.t b/test/etap/040-util.t
index 4500d38a..8f80db87 100755
--- a/test/etap/040-util.t
+++ b/test/etap/040-util.t
@@ -17,7 +17,7 @@ main(_) ->
test_util:init_code_path(),
application:start(crypto),
- etap:plan(16),
+ etap:plan(14),
case (catch test()) of
ok ->
etap:end_tests();
@@ -35,29 +35,6 @@ test() ->
etap:is(foobarbaz, couch_util:to_existing_atom("foobarbaz"),
"A list of atoms is one munged atom."),
- % terminate_linked
- Self = self(),
-
- spawn(fun() ->
- SecondSelf = self(),
- ChildPid = spawn_link(fun() ->
- SecondSelf ! {child, started},
- receive shutdown -> ok end
- end),
- PidUp = receive
- {child, started} -> ok
- after 1000 ->
- {error, timeout}
- end,
- etap:is(ok, PidUp, "Started a linked process."),
- couch_util:terminate_linked(normal),
- Self ! {pid, ChildPid}
- end),
- receive
- {pid, Pid} ->
- etap:ok(not is_process_alive(Pid), "Linked process was killed.")
- end,
-
% implode
etap:is([1, 38, 2, 38, 3], couch_util:implode([1,2,3],"&"),
"use & as separator in list."),