aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-05-06 17:41:04 +0200
committerHans Nilsson <[email protected]>2015-05-06 17:41:04 +0200
commit446dbe8accfdc27ebe72161d763888acc0c90d1c (patch)
treeab4a4d56b7a41832e47840c356c9e45f7f743ecf /lib
parentd4ad455c16a85ee6103d5916ff91cdda31247ca9 (diff)
downloadotp-446dbe8accfdc27ebe72161d763888acc0c90d1c.tar.gz
otp-446dbe8accfdc27ebe72161d763888acc0c90d1c.tar.bz2
otp-446dbe8accfdc27ebe72161d763888acc0c90d1c.zip
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) ->