remove my code out of the tree, tests all passing. thanks chao-mu!

git-svn-id: file:///home/svn/framework3/trunk@12413 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Jonathan Cran 2011-04-23 02:49:14 +00:00
parent c9ab8f248d
commit 56049012cb
1 changed files with 0 additions and 111 deletions

View File

@ -173,114 +173,3 @@ end
end
end
end
def MockClient
def initialize(x64=false)
@x64 = x64
end
def send_request(request)
if @x64
## TODO - we can probably parse up the TLV, or fake it
## Parse up the TLV here
only_out_size_bytes = ""
literal_pairs_blob = ""
in_only_buffer = ""
inout_buffer = ""
dll_path = ""
function_windows_name = ""
return MockResponse(function_windows_name)
else
raise "Unimplemented"
end
end
end
class MockResponse(function)
def initialize(function)
@fuction_to_mock = function
end
def get_tlv_value(TLV_CONST)
if @function_to_mock == ""
return ##TODO
elsif @function_to_mock == "whateverx2"
else
raise "Unknown TLV_CONST - We don't know how to mock this?"
end
end
end
## This stuff probably shouldn't be mocked, but we're in a hurry.
class MockFunction
def initialize(name)
@name = name
@hash = {} ##TODO
end
def params
if @name == "ActivateActCtx"
@hash = {} ## TODO
return @hash
else
raise "That function: #{@name} is not implemented."
end
def return_type
return "" ##TODO
end
end
module Rex
module Post
module Meterpreter
module Extensions
module Stdapi
module Railgun
class DLL::UnitTest < Test::Unit::TestCase
## x64 testing
def test_add_function_x64
dll = DLL.new("kernel32.dll", Mockclient.new)
end
def test_process_function_call_x64
dll = DLL.new("kernel32.dll", Mockclient.new(true))
process_function_call(MockFunction("ActivateActCtx"),
assert ##TODO
end
def test_method_missing_x64
dll = DLL.new("kernel32.dll", Mockclient.new)
end
## x86 testing
def test_add_function_x86
dll = DLL.new("kernel32.dll", Mockclient.new(true))
end
def test_process_function_call_x86
dll = DLL.new("kernel32.dll", Mockclient.new(true) )
end
def test_method_missing_x86
dll = DLL.new("kernel32.dll", Mockclient.new(true))
end
end
end
end
end
end
end
end