aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/test/erl_global_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-12-30 17:48:36 +0100
committerBjörn-Egil Dahlberg <[email protected]>2010-12-30 17:48:36 +0100
commitbcbe0813a0b97f86a7db354e09bf0397cf68f787 (patch)
tree22d5d112515692f3af2ae645ee77dbf22ad6f536 /lib/erl_interface/test/erl_global_SUITE.erl
parent384b85a75212cf73253f901a8c88d4286a5962ba (diff)
downloadotp-bcbe0813a0b97f86a7db354e09bf0397cf68f787.tar.gz
otp-bcbe0813a0b97f86a7db354e09bf0397cf68f787.tar.bz2
otp-bcbe0813a0b97f86a7db354e09bf0397cf68f787.zip
Fix testcases erl_global_whereis, erl_global_names
Enable erl_global_whereis and erl_global names.
Diffstat (limited to 'lib/erl_interface/test/erl_global_SUITE.erl')
-rw-r--r--lib/erl_interface/test/erl_global_SUITE.erl20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/erl_interface/test/erl_global_SUITE.erl b/lib/erl_interface/test/erl_global_SUITE.erl
index 9826e47d55..4f332037c6 100644
--- a/lib/erl_interface/test/erl_global_SUITE.erl
+++ b/lib/erl_interface/test/erl_global_SUITE.erl
@@ -31,7 +31,7 @@
-define(GLOBAL_NAME, global_register_node_test).
all(suite) ->
- [erl_global_registration].
+ [erl_global_registration, erl_global_whereis, erl_global_names].
init_per_testcase(_Case, Config) ->
Dog = ?t:timetrap(?t:minutes(0.25)),
@@ -59,7 +59,7 @@ erl_global_whereis(Config) when is_list(Config) ->
?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
?line Self = self(),
- ?line global:register_name(?GLOBAL_NAME, Self),
+ ?line yes = global:register_name(?GLOBAL_NAME, Self),
?line Self = erl_global_whereis(P, Fd, ?GLOBAL_NAME),
?line global:unregister_name(?GLOBAL_NAME),
?line 0 = erl_close_connection(P, Fd),
@@ -73,14 +73,16 @@ erl_global_names(Config) when is_list(Config) ->
?line Self = self(),
?line global:register_name(?GLOBAL_NAME, Self),
- ?line {[?GLOBAL_NAME], 1} = erl_global_names(P, Fd),
+ ?line {Names1, _N1} = erl_global_names(P, Fd),
+ ?line true = lists:member(atom_to_list(?GLOBAL_NAME), Names1),
?line global:unregister_name(?GLOBAL_NAME),
+ ?line {Names2, _N2} = erl_global_names(P, Fd),
+ ?line false = lists:member(atom_to_list(?GLOBAL_NAME), Names2),
?line 0 = erl_close_connection(P, Fd),
?line runner:send_eot(P),
?line runner:recv_eot(P),
ok.
-
%%% Interface functions for erl_interface functions.
erl_connect(P, Node, Num, Cookie, Creation) ->
@@ -102,11 +104,17 @@ erl_global_register(P, Fd, Name) ->
erl_global_whereis(P, Fd, Name) ->
send_command(P, erl_global_whereis, [Fd,Name]),
- get_send_result(P).
+ case get_term(P) of
+ {term, What} ->
+ What
+ end.
erl_global_names(P, Fd) ->
send_command(P, erl_global_names, [Fd]),
- get_send_result(P).
+ case get_term(P) of
+ {term, What} ->
+ What
+ end.
erl_global_unregister(P, Fd, Name) ->
send_command(P, erl_global_unregister, [Fd,Name]),