aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_util.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-05-30 10:31:47 +0200
committerAnders Svensson <[email protected]>2015-05-30 10:31:47 +0200
commit8260f916c2ab9b9dff9752b47e47d07ac3d95c92 (patch)
treee901cd45191dae850de941fa6cefd5360be3cc2f /lib/diameter/test/diameter_util.erl
parent23501295ea5289897a75cb52a23685f8e6fcf18c (diff)
parentf3fefbae24a2569a13b538d80d0e99129963ebef (diff)
downloadotp-8260f916c2ab9b9dff9752b47e47d07ac3d95c92.tar.gz
otp-8260f916c2ab9b9dff9752b47e47d07ac3d95c92.tar.bz2
otp-8260f916c2ab9b9dff9752b47e47d07ac3d95c92.zip
Merge branch 'maint'
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