Skip to content

Commit

Permalink
Merge pull request hallidave#15 from kachick/improve-remove_warnings
Browse files Browse the repository at this point in the history
Remove some warnings
  • Loading branch information
hallidave committed Mar 12, 2013
2 parents 60f8134 + 0521780 commit 1306c9b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/snmp/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def send(data, host, port)

def recvfrom(max_bytes)
data, host_info = @socket.recvfrom(max_bytes)
flags, host_port, host_name, host_ip = host_info
_, host_port, _, host_ip = host_info
return data, host_ip, host_port
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_ber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ def test_decode_timeticks

# Decode ASN.1 octet string
def test_decode_octet_string
s, data = decode_octet_string("\004\202\000\005hello")
s, _ = decode_octet_string("\004\202\000\005hello")
assert_equal("hello",s)
assert_raise(InvalidTag) {
decode_octet_string("\005\202\000\005hello")
}
end

def test_decode_ip_address
ip, data = decode_ip_address("@\004\001\002\003\004")
ip, _ = decode_ip_address("@\004\001\002\003\004")
assert_equal(ip, "\001\002\003\004")
assert_raise(InvalidTag) {
decode_ip_address("\004\004\001\002\003\004")
Expand Down
2 changes: 1 addition & 1 deletion test/test_pdu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_message_decode_v2c

def test_message_decoder_v3
assert_raise(SNMP::UnsupportedVersion) do
message = SNMP::Message.decode("0>\002\001\0030\021\002\004&\266\342\314\002\003\000\377\343\004\001\004\002\001\003\004\0200\016\004\000\002\001\000\002\001\000\004\000\004\000\004\0000\024\004\000\004\000\240\016\002\004\v\3623\233\002\001\000\002\001\0000\000")
SNMP::Message.decode("0>\002\001\0030\021\002\004&\266\342\314\002\003\000\377\343\004\001\004\002\001\003\004\0200\016\004\000\002\001\000\002\001\000\004\000\004\000\004\0000\024\004\000\004\000\240\016\002\004\v\3623\233\002\001\000\002\001\0000\000")
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/test_retry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def close

def send(data, host, port)
bad_id_data = data.dup
bad_msg = SNMP::Message.decode(data)
bad_msg = SNMP::Message.decode(bad_id_data)
bad_msg.pdu.request_id -= 3 # corrupt request_id
@data << bad_msg.encode # insert corrupted PDU before real data
@data << data
@data << bad_id_data
end

def recv(max_bytes)
Expand Down

0 comments on commit 1306c9b

Please sign in to comment.