diff options
author | Raimo Niskanen <[email protected]> | 2014-05-02 16:47:52 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2014-07-25 12:15:14 +0200 |
commit | 89ca2960d421a43bced0a9f228a62b8ab3089663 (patch) | |
tree | 68ae9d75d80138ca0cdf460941eb5796b6a797e8 /lib/snmp/test/klas3.erl | |
parent | abbd9936144da7bcff9b4819785e597455ac7f35 (diff) | |
download | otp-89ca2960d421a43bced0a9f228a62b8ab3089663.tar.gz otp-89ca2960d421a43bced0a9f228a62b8ab3089663.tar.bz2 otp-89ca2960d421a43bced0a9f228a62b8ab3089663.zip |
wip: passes all regression tests
Diffstat (limited to 'lib/snmp/test/klas3.erl')
-rw-r--r-- | lib/snmp/test/klas3.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/snmp/test/klas3.erl b/lib/snmp/test/klas3.erl index ec78d19dbb..4c7c03e2ca 100644 --- a/lib/snmp/test/klas3.erl +++ b/lib/snmp/test/klas3.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2014. 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 @@ -67,8 +67,11 @@ fname(get) -> end, case snmpa:current_address() of {value, {[_A,_B,_C,_D], E}} when is_integer(E) -> ok; - {value, _} -> throw("bad_ip"); - _ -> throw("bad_adr") + {value, {D, _}} when is_atom(D) -> ok; + {value, Ip} -> + throw(format_string("bad_ip: ~p", [Ip])); + Other -> + throw(format_string("bad_adr: ~p", [Other])) end, case snmpa:current_net_if_data() of {value, []} -> ok; @@ -160,3 +163,6 @@ ftab2(get_next, [9], _Cols) -> % bad return value io:format("** Here comes Error Report get_next 3 bad return~n"), [{[1,5],1},{[2,5],3},{[2,6],3}]. + +format_string(Format, Args) -> + lists:flatten(io_lib:format(Format, Args)). |