1
0
Fork 0
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:
Alain Magloire 2004-10-17 21:28:28 +00:00
parent 6bc057c303
commit 479dfcc366
4 changed files with 47 additions and 20 deletions

View file

@ -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
Adjust to the change in the CDI
* core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java

View file

@ -62,9 +62,9 @@ public class BreakpointTests extends TestCase {
root = workspace.getRoot();
monitor = new NullProgressMonitor();
if (workspace == null)
fail("Workspace was not setup");
fail("Workspace was not setup"); //$NON-NLS-1$
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.
*/
Path imputFile = new Path("resources/debugTest.zip");
testProject = CProjectHelper.createCProjectWithImport("filetest", imputFile);
Path imputFile = new Path("resources/debugTest.zip"); //$NON-NLS-1$
testProject = CProjectHelper.createCProjectWithImport("filetest", imputFile); //$NON-NLS-1$
if (testProject == null)
fail("Unable to create project");
fail("Unable to create project"); //$NON-NLS-1$
/* Build the test project.. */
testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
@ -167,16 +167,19 @@ public class BreakpointTests extends TestCase {
ICDITarget cdiTarget;
ICDILocation location;
boolean caught = false;
session = CDebugHelper.createSession("main", testProject);
session = CDebugHelper.createSession("main", testProject); //$NON-NLS-1$
assertNotNull(session);
cdiTarget = session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
cdiTarget = targets[0];
assertNotNull(cdiTarget);
/***********************************************************************
* 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);
cdiTarget.setLocationBreakpoint(0, location, null, false);
@ -184,7 +187,7 @@ public class BreakpointTests extends TestCase {
* Create a break point on main
**********************************************************************/
location = cdiTarget.createLocation(null, "main", 0);
location = cdiTarget.createLocation(null, "main", 0); //$NON-NLS-1$
assertNotNull(location);
cdiTarget.setLocationBreakpoint(0, location, null, false);
@ -194,7 +197,7 @@ public class BreakpointTests extends TestCase {
* CDIException
**********************************************************************/
location = cdiTarget.createLocation(null, "badname", 0);
location = cdiTarget.createLocation(null, "badname", 0); //$NON-NLS-1$
assertNotNull(location);
try {
cdiTarget.setLocationBreakpoint(0, location, null, false);
@ -210,7 +213,7 @@ public class BreakpointTests extends TestCase {
* and stop program execution.
**********************************************************************/
location = cdiTarget.createLocation(null, "func1", 0);
location = cdiTarget.createLocation(null, "func1", 0); //$NON-NLS-1$
assertNotNull(location);
cdiTarget.setLocationBreakpoint(0, location, null, false);
targets = session.getTargets();
@ -237,8 +240,8 @@ public class BreakpointTests extends TestCase {
assertTrue(targets[0].isSuspended());
location = targets[0].getCurrentThread().getStackFrames()[0].getLocation();
assertTrue(location.getLineNumber() == 6);
assertTrue(location.getFunction().equals("func1"));
assertTrue(location.getFile().equals("main.c"));
assertTrue(location.getFunction().equals("func1")); //$NON-NLS-1$
assertTrue(location.getFile().equals("main.c")); //$NON-NLS-1$
/* clean up the session */
targets[0].terminate();
@ -264,7 +267,10 @@ public class BreakpointTests extends TestCase {
boolean caught = false;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
cdiTarget = session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
cdiTarget = targets[0];
assertNotNull(cdiTarget);
/***********************************************************************
@ -380,7 +386,10 @@ public class BreakpointTests extends TestCase {
ICDILocationBreakpoint curbreak;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
cdiTarget = session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
cdiTarget = targets[0];
assertNotNull(cdiTarget);
/***********************************************************************
@ -451,7 +460,10 @@ public class BreakpointTests extends TestCase {
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
cdiTarget = session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
cdiTarget = targets[0];
assertNotNull(cdiTarget);
/* Make sure initially we don't have any breakpoints */
@ -604,7 +616,10 @@ public class BreakpointTests extends TestCase {
boolean caught = false;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
ICDITarget cdiTarget = session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
ICDITarget cdiTarget = targets[0];
assertNotNull(cdiTarget);
/***********************************************************************

View file

@ -124,12 +124,15 @@ public class DebugTests extends TestCase {
assertNotNull(session);
source=session.getSourceManager();
assertNotNull(source);
cdiTarget=session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
cdiTarget = targets[0];
assertNotNull(cdiTarget);
location=cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
cdiTarget.setLocationBreakpoint(0, location, null, false);
session.getCurrentTarget().resume();
cdiTarget.resume();
session.terminate();
session=null;

View file

@ -120,7 +120,10 @@ public class LocationTests extends TestCase {
ICDILocationBreakpoint curbreak;
session=CDebugHelper.createSession("main",testProject);
assertNotNull(session);
cdiTarget=session.getCurrentTarget();
ICDITarget[] targets = session.getTargets();
assertNotNull(targets);
assertTrue(targets.length > 0);
cdiTarget = targets[0];
assertNotNull(cdiTarget);
/**********************************************************************