* blah, rex exceptions

git-svn-id: file:///home/svn/incoming/trunk@3560 4d416f70-5f16-0410-b530-b9f4589650da
unstable
bmc 2006-03-08 17:25:59 +00:00
parent 9d54b40c63
commit f5ec95bf80
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
$:.unshift(File.join(File.dirname(__FILE__), '..', '..'))
require 'test/unit'
require 'rex/exceptions'
require 'rex/encoder/xdr'
class Rex::Encoder::XDR::UnitTest < Test::Unit::TestCase
@ -12,7 +13,7 @@ class Rex::Encoder::XDR::UnitTest < Test::Unit::TestCase
assert_equal("\377\377\377\322", Rex::Encoder::XDR.encode_lchar(1234), 'encode_lchar')
assert_equal("\000\000\000\003abc\000", Rex::Encoder::XDR.encode_string('abc'), 'encode_string')
assert_equal("\000\000\000\003abc\000", Rex::Encoder::XDR.encode_string('abc', 4), 'encode_string with maxlen')
assert_raises(ArgumentError) {
assert_raises(Rex::ArgumentError) {
Rex::Encoder::XDR.encode_string('abc', 2)
}
assert_equal("\000\000\000\003\000\000\000\001\000\000\000\002\000\000\000\003", Rex::Encoder::XDR.encode_varray([1,2,3]) {|i| Rex::Encoder::XDR.encode_int(i) }, 'encode_varray')