fixed some stuff

git-svn-id: file:///home/svn/incoming/trunk@2588 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-06-05 23:54:04 +00:00
parent a0b6980813
commit e1c4b45e2f
2 changed files with 3 additions and 10 deletions

View File

@ -10,9 +10,6 @@ module Msf
class Exploit::UnitTest < Test::Unit::TestCase
class StubExploit < Msf::Exploit
def auto_target
return nil
end
end
class Stub2Exploit < Msf::Exploit
@ -21,9 +18,6 @@ class Exploit::UnitTest < Test::Unit::TestCase
end
def test_support
assert_equal(false, Exploit.new.supports_auto_target?, "auto target support check failed")
assert_equal(true, StubExploit.new.supports_auto_target?, "auto target deriv enabled support check failed")
assert_equal(false, Stub2Exploit.new.supports_auto_target?, "auto target deriv disabled support check failed")
assert_equal(false, Exploit.new.supports_check?, "auto target support check failed")
assert_equal(false, StubExploit.new.supports_check?, "auto target deriv enabled support check failed")
assert_equal(true, Stub2Exploit.new.supports_check?, "auto target deriv disabled support check failed")
@ -36,7 +30,6 @@ class Exploit::UnitTest < Test::Unit::TestCase
e = Exploit.new
assert_equal(Msf::Exploit::CheckCode::Unsupported, e.check, "invalid default check")
assert_equal(nil, e.auto_target, "invalid default auto_target")
end
end

View File

@ -13,7 +13,7 @@ class Rex::Encoding::Xor::Generic::UnitTest < Test::Unit::TestCase
def hook_static_encode(data, key, expected)
if enc.keysize != 0 && key.length != enc.keysize
assert_raise(ArgumentError) { enc.encode(data,key) }
assert_raise(Rex::ArgumentError) { enc.encode(data,key) }
else
assert_equal(enc.encode(data, key), expected)
end
@ -21,10 +21,10 @@ class Rex::Encoding::Xor::Generic::UnitTest < Test::Unit::TestCase
def test_static_encode
# Test key of zero length
assert_raise(ArgumentError) { enc.encode("\x00", "") }
assert_raise(Rex::ArgumentError) { enc.encode("\x00", "") }
# Test non-string key
assert_raise(ArgumentError) { enc.encode("\x00\x01", 1) }
assert_raise(Rex::ArgumentError) { enc.encode("\x00\x01", 1) }
# some simple single byte tests with 0x00
30.times {