[0.2.x] added : test testPtrToCustomType reproducing bug ( size of pointer to a custom defined type is equal zero )

git-svn-id: https://pykd.svn.codeplex.com/svn@82318 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-01-17 12:02:07 +00:00 committed by Mikhail I. Izmestev
parent 45cc9ea644
commit 7d6f67acd1

View File

@ -122,3 +122,12 @@ class CustomTypesTest(unittest.TestCase):
self.assertEqual( 8, pykd.typeBuilder(8).UInt1B.ptrTo().size() ) self.assertEqual( 8, pykd.typeBuilder(8).UInt1B.ptrTo().size() )
self.assertEqual( pykd.ptrSize(), pykd.typeBuilder().UInt1B.ptrTo().size() ) self.assertEqual( pykd.ptrSize(), pykd.typeBuilder().UInt1B.ptrTo().size() )
def testPtrToCustomType(self):
tb = pykd.typeBuilder()
mySubStruct =tb.createStruct("MySubCustomStruct")
mySubStruct.append( "m_uint1", tb.UInt1B )
mySubStruct.append( "m_uint2", tb.UInt2B )
mySubStructPtr = mySubStruct.ptrTo()
self.assertEqual( pykd.ptrSize(), mySubStructPtr.size() )