diff options
author | Jan Lehnardt <jan@apache.org> | 2017-10-28 13:51:21 +0200 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2017-10-29 08:58:34 +0100 |
commit | afb7c8e4f92833fe93b5931bd15f8068bf219260 (patch) | |
tree | db9577c6cc8ec37c5f1f216faf3619f5e8cb2658 | |
parent | cf605365f1f3d76a66c6b3bcc4b5e089f1b6fa54 (diff) | |
download | couchdb-afb7c8e4f92833fe93b5931bd15f8068bf219260.tar.gz |
feat: port time funs, as per #883
-rw-r--r-- | src/couch/include/couch_eunit.hrl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/couch/include/couch_eunit.hrl b/src/couch/include/couch_eunit.hrl index d3000ae5d..8a1527bcc 100644 --- a/src/couch/include/couch_eunit.hrl +++ b/src/couch/include/couch_eunit.hrl @@ -40,22 +40,21 @@ -define(tempfile, fun() -> - {A, B, C} = erlang:now(), + A = integer_to_list(couch_util:unique_monotonic_integer()), N = node(), - FileName = lists:flatten(io_lib:format("~p-~p.~p.~p", [N, A, B, C])), + FileName = lists:flatten(io_lib:format("~p-~p", [N, A])), filename:join([?TEMPDIR, FileName]) end). -define(tempdb, fun() -> - Nums = tuple_to_list(erlang:now()), + Nums = integer_to_list(couch_util:unique_monotonic_integer()), Prefix = "eunit-test-db", Suffix = lists:concat([integer_to_list(Num) || Num <- Nums]), list_to_binary(Prefix ++ "-" ++ Suffix) end). -define(docid, fun() -> - {A, B, C} = erlang:now(), - lists:flatten(io_lib:format("~p~p~p", [A, B, C])) + integer_to_list(couch_util:unique_monotonic_integer()) end). %% Like assertEqual, but using == instead of =:= |