mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-22 00:15:25 +02:00
- refactored tests a bit to localize failure on breakpoint misses
This commit is contained in:
parent
2db4f5c708
commit
c9bd45c6cc
1 changed files with 23 additions and 5 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Reference in a new issue