aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-05-11 12:24:33 +0200
committerHans Nilsson <[email protected]>2015-05-11 12:24:33 +0200
commitb5ed0f90e7a57c5c51e32f58ed217e87aad7112d (patch)
tree9cb10a6d328028461089b2f01a9edd1ff8b23265 /lib
parentccb1a2f06aa2b0ab77447572797d7fd75b2bd3c4 (diff)
parent446dbe8accfdc27ebe72161d763888acc0c90d1c (diff)
downloadotp-b5ed0f90e7a57c5c51e32f58ed217e87aad7112d.tar.gz
otp-b5ed0f90e7a57c5c51e32f58ed217e87aad7112d.tar.bz2
otp-b5ed0f90e7a57c5c51e32f58ed217e87aad7112d.zip
Merge branch 'hans/eldap/cuddle_test_cases'
* hans/eldap/cuddle_test_cases: eldap: Test suite uppdated to new time handling
Diffstat (limited to 'lib')
-rw-r--r--lib/eldap/test/eldap_basic_SUITE.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/eldap/test/eldap_basic_SUITE.erl b/lib/eldap/test/eldap_basic_SUITE.erl
index 137c61b2d9..8d754e934c 100644
--- a/lib/eldap/test/eldap_basic_SUITE.erl
+++ b/lib/eldap/test/eldap_basic_SUITE.erl
@@ -896,9 +896,9 @@ client_timeout(Fun, Config) ->
T = 1000,
case eldap:open([Host], [{timeout,T},{port,Port}|Opts]) of
{ok,H} ->
- T0 = now(),
+ T0 = erlang:monotonic_time(),
{error,{gen_tcp_error,timeout}} = Fun(H),
- T_op = diff(T0,now()),
+ T_op = ms_passed(T0),
ct:log("Time = ~p, Timeout spec = ~p",[T_op,T]),
if
T_op < T ->
@@ -910,8 +910,12 @@ client_timeout(Fun, Config) ->
Other -> ct:fail("eldap:open failed: ~p",[Other])
end.
-diff({M1,S1,U1},{M2,S2,U2}) ->
- ( ((M2-M1)*1000 + (S2-S1))*1000 + (U2-U1) ).
+%% Help function, elapsed milliseconds since T0
+ms_passed(T0) ->
+ %% OTP 18
+ erlang:convert_time_unit(erlang:monotonic_time() - T0,
+ native,
+ micro_seconds) / 1000.
%%%----------------------------------------------------------------
init_ssl_certs_et_al(Config) ->