aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-08-30 14:21:01 +0200
committerPatrik Nyblom <[email protected]>2010-08-30 14:21:01 +0200
commit5b91c9f8e79f0e8eb0a5816fd54c5603f1c6df29 (patch)
tree75f82a9f7ef3367a8bfceff7333ff265023700b4 /erts/emulator/test
parent1297a3ade2851be787a4c6a64d5f57d81761c8f5 (diff)
parent7e6fe78278c203c3756ce0d6bf23a6bd6cf7bb5d (diff)
downloadotp-5b91c9f8e79f0e8eb0a5816fd54c5603f1c6df29.tar.gz
otp-5b91c9f8e79f0e8eb0a5816fd54c5603f1c6df29.tar.bz2
otp-5b91c9f8e79f0e8eb0a5816fd54c5603f1c6df29.zip
Merge branch 'pan/local_univ_time_bsd/OTP-8580' into dev
* pan/local_univ_time_bsd/OTP-8580: Teach erl_time_sup to handle timezones w/o DST on FreeBSD as on other platforms
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/time_SUITE.erl37
1 files changed, 36 insertions, 1 deletions
diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl
index 2ad1f0d201..095e9dd1af 100644
--- a/erts/emulator/test/time_SUITE.erl
+++ b/erts/emulator/test/time_SUITE.erl
@@ -34,6 +34,8 @@
consistency/1,
now/1, now_unique/1, now_update/1, timestamp/1]).
+-export([local_to_univ_utc/1]).
+
-include("test_server.hrl").
-export([linear_time/1]).
@@ -53,7 +55,40 @@
-define(dst_timezone, 2).
all(suite) -> [univ_to_local, local_to_univ,
- bad_univ_to_local, bad_local_to_univ, consistency, now, timestamp].
+ local_to_univ_utc,
+ bad_univ_to_local, bad_local_to_univ,
+ consistency, now, timestamp].
+
+local_to_univ_utc(suite) ->
+ [];
+local_to_univ_utc(doc) ->
+ ["Test that DST = true on timezones without DST is ignored"];
+local_to_univ_utc(Config) when is_list(Config) ->
+ case os:type() of
+ {unix,_} ->
+ %% TZ variable has a meaning
+ ?line {ok, Node} =
+ test_server:start_node(local_univ_utc,peer,
+ [{args, "-env TZ UTC"}]),
+ ?line {{2008,8,1},{0,0,0}} =
+ rpc:call(Node,
+ erlang,localtime_to_universaltime,
+ [{{2008, 8, 1}, {0, 0, 0}},
+ false]),
+ ?line {{2008,8,1},{0,0,0}} =
+ rpc:call(Node,
+ erlang,localtime_to_universaltime,
+ [{{2008, 8, 1}, {0, 0, 0}},
+ true]),
+ ?line [{{2008,8,1},{0,0,0}}] =
+ rpc:call(Node,
+ calendar,local_time_to_universal_time_dst,
+ [{{2008, 8, 1}, {0, 0, 0}}]),
+ ?line test_server:stop_node(Node),
+ ok;
+ _ ->
+ {skip,"Only valid on Unix"}
+ end.
%% Tests conversion from univeral to local time.