mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.3.x] added : breakpoint tests
git-svn-id: https://pykd.svn.codeplex.com/svn@90490 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
4caa408721
commit
9ef49e4e8d
@ -47,6 +47,16 @@ class BreakpointTest( unittest.TestCase ):
|
||||
bp.remove()
|
||||
self.assertEqual( pykd.executionStatus.NoDebuggee, pykd.go() )
|
||||
|
||||
def testDeleteBp(self):
|
||||
processId = pykd.startProcess( target.appPath + " breakhandlertest" )
|
||||
targetModule = pykd.module( target.moduleName )
|
||||
targetModule.reload()
|
||||
with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess :
|
||||
pykd.go()
|
||||
bp = pykd.setBp( targetModule.CdeclFunc )
|
||||
del bp
|
||||
self.assertEqual( pykd.executionStatus.NoDebuggee, pykd.go() )
|
||||
|
||||
def testBreakCallback(self):
|
||||
processId = pykd.startProcess( target.appPath + " breakhandlertest" )
|
||||
targetModule = pykd.module( target.moduleName )
|
||||
@ -199,3 +209,30 @@ class BreakpointTest( unittest.TestCase ):
|
||||
bp = pykd.setBp( targetModule.CdeclFunc)
|
||||
bp.remove()
|
||||
self.assertEqual(0, pykd.getNumberBreakpoints())
|
||||
|
||||
def testLambdaBpContinue(self):
|
||||
|
||||
processId = pykd.startProcess( target.appPath + " breakhandlertest" )
|
||||
targetModule = pykd.module( target.moduleName )
|
||||
targetModule.reload()
|
||||
with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess :
|
||||
pykd.go()
|
||||
bp1 = pykd.setBp(targetModule.CdeclFunc, lambda : None )
|
||||
bp2 = pykd.setBp(targetModule.CdeclFunc, lambda : False )
|
||||
self.assertEqual( pykd.executionStatus.NoDebuggee, pykd.go() )
|
||||
|
||||
|
||||
def testLambdaBpBreak(self):
|
||||
|
||||
processId = pykd.startProcess( target.appPath + " breakhandlertest" )
|
||||
targetModule = pykd.module( target.moduleName )
|
||||
targetModule.reload()
|
||||
with testutils.ContextCallIt( testutils.KillProcess(processId) ) as killStartedProcess :
|
||||
pykd.go()
|
||||
bp2 = pykd.setBp(targetModule.CdeclFunc, lambda : True )
|
||||
self.assertEqual( pykd.executionStatus.Break, pykd.go() )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user