[0.3.x] add: workitem 13815 tests

git-svn-id: https://pykd.svn.codeplex.com/svn@90902 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2016-01-12 12:46:12 +00:00 committed by Mikhail I. Izmestev
parent 34b59bc4a5
commit 215d5cc950

View File

@ -257,10 +257,16 @@ class TypeInfoTest( unittest.TestCase ):
functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref() functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref()
self.assertTrue( functype.isFunction() ) self.assertTrue( functype.isFunction() )
functype = target.module.typedVar( "g_variadicFuncPtr" ).type().deref()
self.assertTrue( functype.isFunction() )
def testFunctionArgs(self): def testFunctionArgs(self):
functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref() functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref()
self.assertEqual( [ arg.name() for arg in functype ], ["Int4B", "Float"] ) self.assertEqual( [ arg.name() for arg in functype ], ["Int4B", "Float"] )
functype = target.module.typedVar( "g_variadicFuncPtr" ).type().deref()
self.assertEqual( [ arg.name() for arg in functype ], ["Int4B", "..."] )
def testFunctionCallConv(self): def testFunctionCallConv(self):
functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref() functype = target.module.typedVar( "CdeclFuncPtr" ).type().deref()
self.assertEqual( functype.getCallingConvention(), pykd.callingConvention.NearC ) self.assertEqual( functype.getCallingConvention(), pykd.callingConvention.NearC )
@ -285,6 +291,9 @@ class TypeInfoTest( unittest.TestCase ):
functype = target.module.typedVar( "ArrayOfMethodPtr" ).type()[0].deref() functype = target.module.typedVar( "ArrayOfMethodPtr" ).type()[0].deref()
self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::)()") self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::)()")
functype = target.module.typedVar( "g_variadicFuncPtr" ).type().deref()
self.assertEqual(functype.name(), "Void(__cdecl)(Int4B, ...)")
def testFunctionPtrName(self): def testFunctionPtrName(self):
funcptrtype = target.module.typedVar( "CdeclFuncPtr" ).type() funcptrtype = target.module.typedVar( "CdeclFuncPtr" ).type()
self.assertEqual(funcptrtype.name(), "Void(__cdecl*)(Int4B, Float)") self.assertEqual(funcptrtype.name(), "Void(__cdecl*)(Int4B, Float)")
@ -292,6 +301,9 @@ class TypeInfoTest( unittest.TestCase ):
functype = target.module.typedVar( "MethodPtr" ).type() functype = target.module.typedVar( "MethodPtr" ).type()
self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::*)()") self.assertEqual(functype.name(), "Void(__thiscall FuncTestClass::*)()")
funcptrtype = target.module.typedVar( "g_variadicFuncPtr" ).type()
self.assertEqual(funcptrtype.name(), "Void(__cdecl*)(Int4B, ...)")
def testFunctionArrName(self): def testFunctionArrName(self):
funcptrtype = target.module.typedVar( "ArrayOfCdeclFuncPtr" ).type() funcptrtype = target.module.typedVar( "ArrayOfCdeclFuncPtr" ).type()
self.assertEqual(funcptrtype.name(), "Void(__cdecl*[3])(Int4B, Float)") self.assertEqual(funcptrtype.name(), "Void(__cdecl*[3])(Int4B, Float)")