aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_util.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2015-05-29 12:40:18 +0200
committerErlang/OTP <[email protected]>2015-05-29 12:40:18 +0200
commite7c279de571a1436af5531597d1f8a7a5b6de490 (patch)
tree5d319950adbdddc669571e6f750b00f11a984653 /lib/diameter/test/diameter_util.erl
parent6c179d9c4184ca44e6bff649642f710125906977 (diff)
parentd13288d8116e7780a577d023517b24ae329ac823 (diff)
downloadotp-e7c279de571a1436af5531597d1f8a7a5b6de490.tar.gz
otp-e7c279de571a1436af5531597d1f8a7a5b6de490.tar.bz2
otp-e7c279de571a1436af5531597d1f8a7a5b6de490.zip
Merge branch 'anders/diameter/test/OTP-12767' into maint-17
* anders/diameter/test/OTP-12767: Replace config suite call to erlang:now/0 Fix incorrect suite usage of OTP 18 monotonic time Make tls suite crash more verbosely
Diffstat (limited to 'lib/diameter/test/diameter_util.erl')
-rw-r--r--lib/diameter/test/diameter_util.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/diameter/test/diameter_util.erl b/lib/diameter/test/diameter_util.erl
index c496876ee1..df7d268429 100644
--- a/lib/diameter/test/diameter_util.erl
+++ b/lib/diameter/test/diameter_util.erl
@@ -204,13 +204,14 @@ seed() ->
%% unique_string/0
unique_string() ->
- us(diameter_lib:now()).
-
-us({M,S,U}) ->
- tl(lists:append(["-" ++ integer_to_list(N) || N <- [M,S,U]]));
-
-us(MonoT) ->
- integer_to_list(MonoT).
+ try erlang:unique_integer() of
+ N ->
+ integer_to_list(N)
+ catch
+ error: undef -> %% OTP < 18
+ {M,S,U} = timestamp(),
+ tl(lists:append(["-" ++ integer_to_list(N) || N <- [M,S,U]]))
+ end.
%% ---------------------------------------------------------------------------
%% have_sctp/0