couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject git commit: Add a test for COUCHDB-1319
Date Wed, 26 Oct 2011 18:41:48 GMT
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 <kocolosk@apache.org>
Authored: Wed Oct 26 14:41:34 2011 -0400
Committer: Adam Kocoloski <kocolosk@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


Mime
View raw message