[0.3.x] updated : tests

git-svn-id: https://pykd.svn.codeplex.com/svn@84021 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-06-09 15:23:05 +00:00 committed by Mikhail I. Izmestev
parent 663ffdf641
commit d68acf97ea

View File

@ -235,17 +235,21 @@ class TypedVarTest( unittest.TestCase ):
self.assertEqual( 5, tv.m_fieldOfUnNamed ) self.assertEqual( 5, tv.m_fieldOfUnNamed )
def testPointerToFunction(self): def testPointerToFunction(self):
tv1 = target.module.typedVar( "g_unTypedPtrToFunction" )
funcptr = target.module.typedVar( "CdeclFuncPtr" )
self.assertEqual( funcptr, target.module.CdeclFunc )
#tv1 = target.module.typedVar( "g_unTypedPtrToFunction" )
# if debug: g_unTypedPtrToFunction point to jmp EnumWindowsProc2 (e9 xxxxxxxx) # if debug: g_unTypedPtrToFunction point to jmp EnumWindowsProc2 (e9 xxxxxxxx)
self.assertTrue( ( target.module.offset("EnumWindowsProc2") == tv1 ) or #self.assertTrue( ( target.module.offset("EnumWindowsProc2") == tv1 ) or
( 0xE9 == pykd.ptrByte( long(tv1) ) ) ) # ( 0xE9 == pykd.ptrByte( long(tv1) ) ) )
tv2 = target.module.typedVar( "g_unTypedPtrToFunction" ) #tv2 = target.module.typedVar( "g_unTypedPtrToFunction" )
self.assertEqual( tv1, tv2 ) #self.assertEqual( tv1, tv2 )
self.assertRaises( pykd.TypeException, tv1.deref ) #self.assertRaises( pykd.TypeException, tv1.deref )
self.assertRaises( pykd.TypeException, tv2.deref ) #self.assertRaises( pykd.TypeException, tv2.deref )
def testTypeVarArg(self): def testTypeVarArg(self):
tv1 = target.module.typedVar( "structTest", target.module.g_structTest ) tv1 = target.module.typedVar( "structTest", target.module.g_structTest )
@ -313,7 +317,7 @@ class TypedVarTest( unittest.TestCase ):
def testDeadlockList(self): def testDeadlockList(self):
lst = [] lst = []
entry = pykd.typedVar("entry1").Flink entry = pykd.typedVar("deadlockEntry").flink
for i in range( 0, 100000 ): for i in range( 0, 100000 ):
lst.append(entry) lst.append(entry)
entry = entry.deref().Flink entry = entry.deref().flink