mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53: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
@ -130,4 +130,19 @@ class CustomTypesTest(unittest.TestCase):
|
||||
mySubStructPtr = mySubStruct.ptrTo()
|
||||
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