You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2011/10/26 20:41:48 UTC

git commit: Add a test for COUCHDB-1319

Updated Branches:
  refs/heads/1319-large-headers-are-corrupted c923e8757 -> ce3d81304


Add a test for COUCHDB-1319


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ce3d8130
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ce3d8130
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ce3d8130

Branch: refs/heads/1319-large-headers-are-corrupted
Commit: ce3d813049d7e58a7ea966f1499b3d33b33c0342
Parents: c923e87
Author: Adam Kocoloski <ko...@apache.org>
Authored: Wed Oct 26 14:41:34 2011 -0400
Committer: Adam Kocoloski <ko...@apache.org>
Committed: Wed Oct 26 14:43:37 2011 -0400

----------------------------------------------------------------------
 test/etap/011-file-headers.t |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ce3d8130/test/etap/011-file-headers.t
----------------------------------------------------------------------
diff --git a/test/etap/011-file-headers.t b/test/etap/011-file-headers.t
index 81ffdb2..a26b032 100755
--- a/test/etap/011-file-headers.t
+++ b/test/etap/011-file-headers.t
@@ -22,7 +22,7 @@ main(_) ->
     {S1, S2, S3} = now(),
     random:seed(S1, S2, S3),
 
-    etap:plan(17),
+    etap:plan(18),
     case (catch test()) of
         ok ->
             etap:end_tests();
@@ -68,6 +68,13 @@ test() ->
     etap:is({ok, Size2}, couch_file:bytes(Fd),
         "Rewriting the same second header returns the same second size."),
 
+    couch_file:write_header(Fd, erlang:make_tuple(5000, <<"CouchDB">>)),
+    etap:is(
+        couch_file:read_header(Fd),
+        {ok, erlang:make_tuple(5000, <<"CouchDB">>)},
+        "Headers larger than the block size can be saved (COUCHDB-1319)"
+    ),
+
     ok = couch_file:close(Fd),
 
     % Now for the fun stuff. Try corrupting the second header and see