summaryrefslogtreecommitdiff
path: root/test/etap/011-file-headers.t
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-05-31 00:22:25 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-05-31 00:22:25 +0000
commit3f6d703833af0c2c7b6aa31525b6593588312e94 (patch)
tree3458f76061f5d6d5d14f8275881eab3081b4ac0a /test/etap/011-file-headers.t
parent2b21b31c73dfc500762360253b6e390024c7cf28 (diff)
Had to swap macro definitions to support R12B.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@780350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/etap/011-file-headers.t')
-rwxr-xr-xtest/etap/011-file-headers.t12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/etap/011-file-headers.t b/test/etap/011-file-headers.t
index f9d0c948..83478d34 100755
--- a/test/etap/011-file-headers.t
+++ b/test/etap/011-file-headers.t
@@ -2,8 +2,8 @@
%% -*- erlang -*-
%%! -pa ./src/couchdb -sasl errlog_type error -boot start_sasl -noshell
--define(FILE_NAME, "./test/etap/temp.011").
--define(SIZE_BLOCK, 4096). % Need to keep this in sync with couch_file.erl
+filename() -> "./test/etap/temp.011".
+sizeblock() -> 4096. % Need to keep this in sync with couch_file.erl
main(_) ->
code:add_pathz("src/couchdb"),
@@ -21,7 +21,7 @@ main(_) ->
ok.
test() ->
- {ok, Fd} = couch_file:open(?FILE_NAME, [create,overwrite]),
+ {ok, Fd} = couch_file:open(filename(), [create,overwrite]),
etap:is({ok, 0}, couch_file:bytes(Fd),
"File should be initialized to contain zero bytes."),
@@ -103,8 +103,8 @@ test() ->
ok.
check_header_recovery(CheckFun) ->
- {ok, Fd} = couch_file:open(?FILE_NAME, [create,overwrite]),
- {ok, RawFd} = file:open(?FILE_NAME, [read, write, raw, binary]),
+ {ok, Fd} = couch_file:open(filename(), [create,overwrite]),
+ {ok, RawFd} = file:open(filename(), [read, write, raw, binary]),
{ok, _} = write_random_data(Fd),
ExpectHeader = {some_atom, <<"a binary">>, 756},
@@ -124,7 +124,7 @@ write_random_data(Fd) ->
write_random_data(Fd, 0) ->
{ok, Bytes} = couch_file:bytes(Fd),
- {ok, (1 + Bytes div ?SIZE_BLOCK) * ?SIZE_BLOCK};
+ {ok, (1 + Bytes div sizeblock()) * sizeblock()};
write_random_data(Fd, N) ->
Choices = [foo, bar, <<"bizzingle">>, "bank", ["rough", stuff]],
Term = lists:nth(random:uniform(4) + 1, Choices),