From 9ef49e4e8dd8a599150a046f4784d3508ef2d09f Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Fri, 24 Apr 2015 11:57:31 +0000 Subject: [PATCH] [0.3.x] added : breakpoint tests git-svn-id: https://pykd.svn.codeplex.com/svn@90490 9b283d60-5439-405e-af05-b73fd8c4d996 --- test/scripts/breakpoint.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/scripts/breakpoint.py b/test/scripts/breakpoint.py index b8b4b9f..f2f5078 100644 --- a/test/scripts/breakpoint.py +++ b/test/scripts/breakpoint.py @@ -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() ) + + + + +