1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 07:55:24 +02:00

- refactored tests a bit to localize failure on breakpoint misses

This commit is contained in:
Alena Laskavaia 2010-04-08 19:04:58 +00:00
parent 2db4f5c708
commit c9bd45c6cc

View file

@ -525,7 +525,7 @@ public class BreakpointTests extends AbstractDebugTest {
} }
public void testCondBreak2() throws CoreException, MIException, IOException, CDIException, InterruptedException { public void testCondBreak2() throws CoreException, MIException, IOException, CDIException, InterruptedException {
boolean caught = false;
ICDITarget cdiTarget = currentTarget; ICDITarget cdiTarget = currentTarget;
/*********************************************************************** /***********************************************************************
@ -543,11 +543,17 @@ public class BreakpointTests extends AbstractDebugTest {
location = cdiTarget.createFunctionLocation(null, "func1"); location = cdiTarget.createFunctionLocation(null, "func1");
assertNotNull(location); assertNotNull(location);
cdiTarget.setFunctionBreakpoint(0, location, cond, false); cdiTarget.setFunctionBreakpoint(0, location, cond, false);
}
public void testCondBreakError() {
ICDITarget cdiTarget = currentTarget;
ICDICondition cond;
ICDIFunctionLocation location;
/*********************************************************************** /***********************************************************************
* Create a break point on a generic function with an invalid condition * Create a break point on a generic function with an invalid condition
* We expect to get a CDIException when we try to set the breakpoint. * We expect to get a CDIException when we try to set the breakpoint.
**********************************************************************/ **********************************************************************/
boolean caught = false;
cond = cdiTarget.createCondition(0, "nonexist<10"); cond = cdiTarget.createCondition(0, "nonexist<10");
location = cdiTarget.createFunctionLocation(null, "func1"); location = cdiTarget.createFunctionLocation(null, "func1");
assertNotNull(location); assertNotNull(location);
@ -560,12 +566,24 @@ public class BreakpointTests extends AbstractDebugTest {
} }
public void testHitCond() throws CoreException, MIException, IOException, CDIException, InterruptedException { public void testHitCond() throws CoreException, MIException, IOException, CDIException, InterruptedException {
// this currently fails sometimes - after set bad breakpoint it does not hit any
setBreakOnMain(); setBreakOnMain();
testCondBreak2(); testCondBreak2();
resumeCurrentTarget(); resumeCurrentTarget();
waitSuspend(currentTarget); waitSuspend(currentTarget);
} }
public void testHitCondWithError() throws CoreException, MIException, IOException, CDIException, InterruptedException {
// this currently fails sometimes - after set bad breakpoint it does not hit any
// only reproducible when setting invalid condition breakpoint, reason unknown
setBreakOnMain();
testCondBreak2();
testCondBreakError();
pause();
/* We should now have 3 breakpoints left. */
ICDIBreakpoint[] breakpoints = currentTarget.getBreakpoints();
assertTrue(breakpoints.length == 3);
resumeCurrentTarget();
waitSuspend(currentTarget);
}
/*************************************************************************** /***************************************************************************
* A test to make sure setting address breakpoints works as * A test to make sure setting address breakpoints works as
* expected. * expected.