You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2017/10/31 20:34:35 UTC
[couchdb] 06/17: feat: port time funs, as per #883
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch 211-update-2
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit d361aed1b03137762514b0ee2c4f4956a765a5e2
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Sat Oct 28 13:51:21 2017 +0200
feat: port time funs, as per #883
---
src/couch/include/couch_eunit.hrl | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/couch/include/couch_eunit.hrl b/src/couch/include/couch_eunit.hrl
index d3000ae..8a1527b 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 =:=
--
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.