aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test/inets_SUITE.erl
diff options
context:
space:
mode:
authorErland Schönbeck <[email protected]>2015-03-17 11:56:14 +0100
committerRickard Green <[email protected]>2015-03-20 15:28:54 +0100
commit7cdde7537deccd53d95d03860379f3d20ad2e265 (patch)
tree8d2c7cc5b86e6a57e840efcd781abe8067c9f614 /lib/inets/test/inets_SUITE.erl
parent87ae700c7383b74b8ddade6bfe30481dcdc5b6c7 (diff)
downloadotp-7cdde7537deccd53d95d03860379f3d20ad2e265.tar.gz
otp-7cdde7537deccd53d95d03860379f3d20ad2e265.tar.bz2
otp-7cdde7537deccd53d95d03860379f3d20ad2e265.zip
inets: Cleanup of multiple copies of functions
Add inets_lib with common functions used by multiple modules
Diffstat (limited to 'lib/inets/test/inets_SUITE.erl')
-rw-r--r--lib/inets/test/inets_SUITE.erl19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/inets/test/inets_SUITE.erl b/lib/inets/test/inets_SUITE.erl
index 6510c70d08..a07dc79c02 100644
--- a/lib/inets/test/inets_SUITE.erl
+++ b/lib/inets/test/inets_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -549,25 +549,12 @@ tsf(Reason) ->
tsp(F) ->
tsp(F, []).
tsp(F, A) ->
- Timestamp = formated_timestamp(),
+ Timestamp = inets_lib:formated_timestamp(),
test_server:format("** ~s ** ~p ~p:" ++ F ++ "~n", [Timestamp, self(), ?MODULE | A]).
i(F) ->
i(F, []).
i(F, A) ->
- Timestamp = formated_timestamp(),
+ Timestamp = inets_lib:formated_timestamp(),
io:format("*** ~s ~w:" ++ F ++ "~n", [Timestamp, ?MODULE | A]).
-
-formated_timestamp() ->
- format_timestamp( os:timestamp() ).
-
-format_timestamp({_N1, _N2, N3} = Now) ->
- {Date, Time} = calendar:now_to_datetime(Now),
- {YYYY,MM,DD} = Date,
- {Hour,Min,Sec} = Time,
- FormatDate =
- io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w 4~w",
- [YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
- lists:flatten(FormatDate).
-