aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorAndrey Pampukha <[email protected]>2010-03-15 18:12:29 +0100
committerRaimo Niskanen <[email protected]>2010-06-09 16:19:13 +0200
commit542a73f9c405b424f743fb0ab679a23f60db2a17 (patch)
tree4d14f7f05bb9ba0c021452c0bee51ba04c08ba2c /lib/common_test
parenta9c315929d96c7d0d0e5e79f8fc0ba0c7f17e94d (diff)
downloadotp-542a73f9c405b424f743fb0ab679a23f60db2a17.tar.gz
otp-542a73f9c405b424f743fb0ab679a23f60db2a17.tar.bz2
otp-542a73f9c405b424f743fb0ab679a23f60db2a17.zip
Eliminate compilation warning
Modified debug function never called.
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_telnet_client.erl61
1 files changed, 31 insertions, 30 deletions
diff --git a/lib/common_test/src/ct_telnet_client.erl b/lib/common_test/src/ct_telnet_client.erl
index 1a12c5e343..2e0536ec2d 100644
--- a/lib/common_test/src/ct_telnet_client.erl
+++ b/lib/common_test/src/ct_telnet_client.erl
@@ -35,8 +35,6 @@
-export([open/1, open/2, open/3, open/4, close/1]).
-export([send_data/2, get_data/1]).
--define(DBG, false).
-
-define(TELNET_PORT, 23).
-define(OPEN_TIMEOUT,10000).
-define(IDLE_TIMEOUT,10000).
@@ -287,35 +285,38 @@ get_subcmd([?SE | Rest], Acc) ->
get_subcmd([Opt | Rest], Acc) ->
get_subcmd(Rest, [Opt | Acc]).
-
+-ifdef(debug).
dbg(_Str,_Args) ->
- if ?DBG -> io:format(_Str,_Args);
- true -> ok
+ io:format(_Str,_Args).
+
+cmd_dbg(_Cmd) ->
+ case _Cmd of
+ [?IAC|Cmd1] ->
+ cmd_dbg(Cmd1);
+ [Ctrl|Opts] ->
+ CtrlStr =
+ case Ctrl of
+ ?DO -> "DO";
+ ?DONT -> "DONT";
+ ?WILL -> "WILL";
+ ?WONT -> "WONT";
+ ?NOP -> "NOP";
+ _ -> "CMD"
+ end,
+ Opts1 =
+ case Opts of
+ [Opt] -> Opt;
+ _ -> Opts
+ end,
+ io:format("~s(~w): ~w\n", [CtrlStr,Ctrl,Opts1]);
+ Any ->
+ io:format("Unexpected in cmd_dbg:~n~w~n",[Any])
end.
+-else.
+dbg(_Str,_Args) ->
+ ok.
+
cmd_dbg(_Cmd) ->
- if ?DBG ->
- case _Cmd of
- [?IAC|Cmd1] ->
- cmd_dbg(Cmd1);
- [Ctrl|Opts] ->
- CtrlStr =
- case Ctrl of
- ?DO -> "DO";
- ?DONT -> "DONT";
- ?WILL -> "WILL";
- ?WONT -> "WONT";
- ?NOP -> "NOP";
- _ -> "CMD"
- end,
- Opts1 =
- case Opts of
- [Opt] -> Opt;
- _ -> Opts
- end,
- io:format("~s(~w): ~w\n", [CtrlStr,Ctrl,Opts1]);
- Any ->
- io:format("Unexpected in cmd_dbg:~n~w~n",[Any])
- end;
- true -> ok
- end.
+ ok.
+-endif. \ No newline at end of file