From 7d6f67acd1a8d89a39b8e57170ef7871441920ae Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" <SND\kernelnet_cp@9b283d60-5439-405e-af05-b73fd8c4d996> Date: Thu, 17 Jan 2013 12:02:07 +0000 Subject: [PATCH] [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 --- test/scripts/customtypestest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/scripts/customtypestest.py b/test/scripts/customtypestest.py index bf91e4c..bd702ed 100644 --- a/test/scripts/customtypestest.py +++ b/test/scripts/customtypestest.py @@ -121,4 +121,13 @@ class CustomTypesTest(unittest.TestCase): self.assertEqual( 4, pykd.typeBuilder(4).UInt1B.ptrTo().size() ) self.assertEqual( 8, pykd.typeBuilder(8).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() ) +