* add dotted quad validation tests (to prove the current one is broken :P )

git-svn-id: file:///home/svn/incoming/trunk@3669 4d416f70-5f16-0410-b530-b9f4589650da
unstable
bmc 2006-06-15 22:41:31 +00:00
parent 54540f7eb7
commit e70b6f7cfe
1 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,15 @@ require 'rex/socket/tcp'
class Rex::Socket::UnitTest < Test::Unit::TestCase
def test_ip
assert_equal(true,Rex::Socket.dotted_ip?('0.0.0.0'), 'valid IP min')
assert_equal(true,Rex::Socket.dotted_ip?('255.255.255.255'), 'valid IP max')
assert_equal(false,Rex::Socket.dotted_ip?('0.0.0.0.0'), 'too many sections')
assert_equal(false,Rex::Socket.dotted_ip?('0..0.0.0'), 'too many dots')
assert_equal(false,Rex::Socket.dotted_ip?('00.0.0'), 'not enough dots')
assert_equal(false,Rex::Socket.dotted_ip?('256.256.256.256'), 'numbers too big')
end
def test_create
port = 64442
serv = TCPServer.new('127.0.0.1', port)