mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-17 13:15:44 +02:00
2004-10-17 Alain Magloire
Remove deprecated method in CDI adjust the implementation. * core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java * core/org/eclipse/cdt/debug/core/tests/DebugTests.java * core/org/eclipse/cdt/debug/core/tests/LocationTests.java
This commit is contained in:
parent
6bc057c303
commit
479dfcc366
4 changed files with 47 additions and 20 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-10-17 Alain Magloire
|
||||||
|
Remove deprecated method in CDI adjust the implementation.
|
||||||
|
* core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
|
||||||
|
* core/org/eclipse/cdt/debug/core/tests/DebugTests.java
|
||||||
|
* core/org/eclipse/cdt/debug/core/tests/LocationTests.java
|
||||||
|
|
||||||
2004-10-15 Alain Magloire
|
2004-10-15 Alain Magloire
|
||||||
Adjust to the change in the CDI
|
Adjust to the change in the CDI
|
||||||
* core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
|
* core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
|
||||||
|
|
|
@ -62,9 +62,9 @@ public class BreakpointTests extends TestCase {
|
||||||
root = workspace.getRoot();
|
root = workspace.getRoot();
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
if (workspace == null)
|
if (workspace == null)
|
||||||
fail("Workspace was not setup");
|
fail("Workspace was not setup"); //$NON-NLS-1$
|
||||||
if (root == null)
|
if (root == null)
|
||||||
fail("Workspace root was not setup");
|
fail("Workspace root was not setup"); //$NON-NLS-1$
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,10 +81,10 @@ public class BreakpointTests extends TestCase {
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Create a new project and import the test source.
|
* Create a new project and import the test source.
|
||||||
*/
|
*/
|
||||||
Path imputFile = new Path("resources/debugTest.zip");
|
Path imputFile = new Path("resources/debugTest.zip"); //$NON-NLS-1$
|
||||||
testProject = CProjectHelper.createCProjectWithImport("filetest", imputFile);
|
testProject = CProjectHelper.createCProjectWithImport("filetest", imputFile); //$NON-NLS-1$
|
||||||
if (testProject == null)
|
if (testProject == null)
|
||||||
fail("Unable to create project");
|
fail("Unable to create project"); //$NON-NLS-1$
|
||||||
/* Build the test project.. */
|
/* Build the test project.. */
|
||||||
|
|
||||||
testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
|
testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
|
||||||
|
@ -167,16 +167,19 @@ public class BreakpointTests extends TestCase {
|
||||||
ICDITarget cdiTarget;
|
ICDITarget cdiTarget;
|
||||||
ICDILocation location;
|
ICDILocation location;
|
||||||
boolean caught = false;
|
boolean caught = false;
|
||||||
session = CDebugHelper.createSession("main", testProject);
|
session = CDebugHelper.createSession("main", testProject); //$NON-NLS-1$
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
cdiTarget = session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Create a break point on a generic function
|
* Create a break point on a generic function
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
location = cdiTarget.createLocation(null, "func1", 0);
|
location = cdiTarget.createLocation(null, "func1", 0); //$NON-NLS-1$
|
||||||
assertNotNull(location);
|
assertNotNull(location);
|
||||||
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
||||||
|
|
||||||
|
@ -184,7 +187,7 @@ public class BreakpointTests extends TestCase {
|
||||||
* Create a break point on main
|
* Create a break point on main
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
location = cdiTarget.createLocation(null, "main", 0);
|
location = cdiTarget.createLocation(null, "main", 0); //$NON-NLS-1$
|
||||||
assertNotNull(location);
|
assertNotNull(location);
|
||||||
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
||||||
|
|
||||||
|
@ -194,7 +197,7 @@ public class BreakpointTests extends TestCase {
|
||||||
* CDIException
|
* CDIException
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
location = cdiTarget.createLocation(null, "badname", 0);
|
location = cdiTarget.createLocation(null, "badname", 0); //$NON-NLS-1$
|
||||||
assertNotNull(location);
|
assertNotNull(location);
|
||||||
try {
|
try {
|
||||||
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
||||||
|
@ -210,7 +213,7 @@ public class BreakpointTests extends TestCase {
|
||||||
* and stop program execution.
|
* and stop program execution.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
location = cdiTarget.createLocation(null, "func1", 0);
|
location = cdiTarget.createLocation(null, "func1", 0); //$NON-NLS-1$
|
||||||
assertNotNull(location);
|
assertNotNull(location);
|
||||||
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
||||||
targets = session.getTargets();
|
targets = session.getTargets();
|
||||||
|
@ -237,8 +240,8 @@ public class BreakpointTests extends TestCase {
|
||||||
assertTrue(targets[0].isSuspended());
|
assertTrue(targets[0].isSuspended());
|
||||||
location = targets[0].getCurrentThread().getStackFrames()[0].getLocation();
|
location = targets[0].getCurrentThread().getStackFrames()[0].getLocation();
|
||||||
assertTrue(location.getLineNumber() == 6);
|
assertTrue(location.getLineNumber() == 6);
|
||||||
assertTrue(location.getFunction().equals("func1"));
|
assertTrue(location.getFunction().equals("func1")); //$NON-NLS-1$
|
||||||
assertTrue(location.getFile().equals("main.c"));
|
assertTrue(location.getFile().equals("main.c")); //$NON-NLS-1$
|
||||||
|
|
||||||
/* clean up the session */
|
/* clean up the session */
|
||||||
targets[0].terminate();
|
targets[0].terminate();
|
||||||
|
@ -264,7 +267,10 @@ public class BreakpointTests extends TestCase {
|
||||||
boolean caught = false;
|
boolean caught = false;
|
||||||
session = CDebugHelper.createSession("main", testProject);
|
session = CDebugHelper.createSession("main", testProject);
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
cdiTarget = session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -380,7 +386,10 @@ public class BreakpointTests extends TestCase {
|
||||||
ICDILocationBreakpoint curbreak;
|
ICDILocationBreakpoint curbreak;
|
||||||
session = CDebugHelper.createSession("main", testProject);
|
session = CDebugHelper.createSession("main", testProject);
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
cdiTarget = session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -451,7 +460,10 @@ public class BreakpointTests extends TestCase {
|
||||||
|
|
||||||
session = CDebugHelper.createSession("main", testProject);
|
session = CDebugHelper.createSession("main", testProject);
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
cdiTarget = session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
|
|
||||||
/* Make sure initially we don't have any breakpoints */
|
/* Make sure initially we don't have any breakpoints */
|
||||||
|
@ -604,7 +616,10 @@ public class BreakpointTests extends TestCase {
|
||||||
boolean caught = false;
|
boolean caught = false;
|
||||||
session = CDebugHelper.createSession("main", testProject);
|
session = CDebugHelper.createSession("main", testProject);
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
ICDITarget cdiTarget = session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
ICDITarget cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -124,12 +124,15 @@ public class DebugTests extends TestCase {
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
source=session.getSourceManager();
|
source=session.getSourceManager();
|
||||||
assertNotNull(source);
|
assertNotNull(source);
|
||||||
cdiTarget=session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
location=cdiTarget.createLocation(null, "func1", 0);
|
location=cdiTarget.createLocation(null, "func1", 0);
|
||||||
assertNotNull(location);
|
assertNotNull(location);
|
||||||
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
cdiTarget.setLocationBreakpoint(0, location, null, false);
|
||||||
session.getCurrentTarget().resume();
|
cdiTarget.resume();
|
||||||
session.terminate();
|
session.terminate();
|
||||||
session=null;
|
session=null;
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,10 @@ public class LocationTests extends TestCase {
|
||||||
ICDILocationBreakpoint curbreak;
|
ICDILocationBreakpoint curbreak;
|
||||||
session=CDebugHelper.createSession("main",testProject);
|
session=CDebugHelper.createSession("main",testProject);
|
||||||
assertNotNull(session);
|
assertNotNull(session);
|
||||||
cdiTarget=session.getCurrentTarget();
|
ICDITarget[] targets = session.getTargets();
|
||||||
|
assertNotNull(targets);
|
||||||
|
assertTrue(targets.length > 0);
|
||||||
|
cdiTarget = targets[0];
|
||||||
assertNotNull(cdiTarget);
|
assertNotNull(cdiTarget);
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
Loading…
Add table
Reference in a new issue