mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.2.x] added: test for issue #12591 ( typeBuilder generates a error alignment for array fields )
git-svn-id: https://pykd.svn.codeplex.com/svn@86824 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
aefe5b4706
commit
27d8ce7296
@ -129,5 +129,20 @@ class CustomTypesTest(unittest.TestCase):
|
|||||||
mySubStruct.append( "m_uint2", tb.UInt2B )
|
mySubStruct.append( "m_uint2", tb.UInt2B )
|
||||||
mySubStructPtr = mySubStruct.ptrTo()
|
mySubStructPtr = mySubStruct.ptrTo()
|
||||||
self.assertEqual( pykd.ptrSize(), mySubStructPtr.size() )
|
self.assertEqual( pykd.ptrSize(), mySubStructPtr.size() )
|
||||||
|
|
||||||
|
def testAlign(self):
|
||||||
|
tb = pykd.typeBuilder()
|
||||||
|
struct = tb.createStruct(name ="MyAlignStruct", align=4)
|
||||||
|
struct.append( "m_field1", tb.UInt1B )
|
||||||
|
self.assertEqual( 1, struct.size() )
|
||||||
|
struct.append( "m_field2", tb.UInt1B )
|
||||||
|
self.assertEqual( 2, struct.size() )
|
||||||
|
struct.append( "m_field3", tb.UInt1B )
|
||||||
|
struct.append( "m_field4", tb.UInt2B )
|
||||||
|
self.assertEqual( 6, struct.size() )
|
||||||
|
struct.append( "m_field5", tb.UInt4B )
|
||||||
|
self.assertEqual( 12, struct.size() )
|
||||||
|
struct.append( "m_field6", tb.UInt1B )
|
||||||
|
self.assertEqual( 16, struct.size() )
|
||||||
|
struct.append( "m_field7", tb.UInt1B.arrayOf(5) )
|
||||||
|
self.assertEqual( 20, struct.size() )
|
||||||
|
Loading…
Reference in New Issue
Block a user