frysk.stepping
Class TestStepping

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by frysk.junit.TestCase
              extended by frysk.testbed.TestLib
                  extended by frysk.stepping.TestStepping
All Implemented Interfaces:
Test

public class TestStepping
extends TestLib

Main testcase for frysk.stepping. Test cases work as follows: 1. Define a class implementing SteppingTest, with whatever assertions are to be made in the runAssertions() method. 2. Define the source file, initialize the test string token scanner Object, and declare the starting and ending lines for the test. 3. Create a new DaemonBlockedAtEntry for the process to be tested on. 4. Call initTaskWithTask() to initialize the LockObserver and other data structures, as well as set the initial breakpoints for the test. This method will run the program to the initial breakpoint. 5. Perform the actual stepping operation - i.e. SteppingEngine.stepLine(Task). 6. When the step has completed, the LockObserver will update and call the runAssertions() method in the current TestStepping class defined above.


Nested Class Summary
private static class TestStepping.AssertLine
           
(package private)  class TestStepping.LockObserver
           
private static interface TestStepping.SteppingTest
           
private  class TestStepping.TestSteppingBreakpoint
          A custom SourceBreakpintObserver for stopping the event loop when hit.
 
Field Summary
private  TestStepping.SteppingTest currentTest
           
(package private)  DaemonBlockedAtEntry dbae
           
(package private)  boolean genericUpdate
           
private  HashMap lineMap
           
private  TestStepping.LockObserver lock
           
private  TestfileTokenScanner scanner
           
private  SteppingEngine se
           
(package private)  boolean testStarted
           
 
Fields inherited from class frysk.testbed.TestLib
host
 
Constructor Summary
TestStepping()
           
 
Method Summary
 void cleanup()
           
 Task initTask(Offspring process, File source, int startLine, int endLine)
           
 void initTaskWithTask(Task myTask, File source, int startLine, int endLine)
           
 void runTest(String source, int line, Task task)
           
 void testASMFramelessFunctionCall()
           
 void testASMFramelessFunctionReturn()
           
 void testASMFramelessFunctionStepOut()
           
 void testASMFramelessFunctionStepOver()
           
 void testASMFunctionReturn()
           
 void testASMFunctionStepOut()
           
 void testASMFunctionStepOver()
           
 void testASMFunctionStepOverPrologue()
          Tests that the line stepper steps OK even when stack pointer changes.
 void testASMJump()
           
 void testASMMultiStep()
           
 void testASMSingleStep()
           
 void testFramelessFunctionEntry()
           
 void testFunctionEntry()
           
 void testInstructionStepThroughSection()
           
 void testLineStepFunctionCall()
           
 void testLineStepFunctionReturn()
           
 void testLineStepIfStatementFail()
           
 void testLineStepIfStatementPass()
           
 void testStepGoto()
           
 void testStepSigLongJmp()
           
 void testStepSigRaise()
           
 
Methods inherited from class frysk.testbed.TestLib
addToTearDown, addToTearDown, assertRunToFindProc, assertRunUntilStop, assertRunUntilStop, getExecPath, isChildOf, isChildOfMine, isDescendantOf, isDescendantOfMine, runPending, setUp, tearDown
 
Methods inherited from class frysk.junit.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, getTimeoutMilliseconds, getTimeoutSeconds, missing32or64, unresolved, unresolvedOffUtrace, unresolvedOn32On64, unresolvedOnIA32, unresolvedOnPPC, unresolvedOnUtrace, unresolvedOnx8664, unsupported
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lineMap

private HashMap lineMap

se

private SteppingEngine se

scanner

private TestfileTokenScanner scanner

lock

private TestStepping.LockObserver lock

currentTest

private TestStepping.SteppingTest currentTest

genericUpdate

boolean genericUpdate

dbae

DaemonBlockedAtEntry dbae

testStarted

boolean testStarted
Constructor Detail

TestStepping

public TestStepping()
Method Detail

testLineStepFunctionCall

public void testLineStepFunctionCall()

testLineStepIfStatementPass

public void testLineStepIfStatementPass()

testLineStepIfStatementFail

public void testLineStepIfStatementFail()

testLineStepFunctionReturn

public void testLineStepFunctionReturn()

testStepSigLongJmp

public void testStepSigLongJmp()

testStepGoto

public void testStepGoto()

testStepSigRaise

public void testStepSigRaise()

testASMSingleStep

public void testASMSingleStep()

testASMMultiStep

public void testASMMultiStep()

testASMJump

public void testASMJump()

testFunctionEntry

public void testFunctionEntry()

testASMFunctionReturn

public void testASMFunctionReturn()

testASMFunctionStepOver

public void testASMFunctionStepOver()

testASMFunctionStepOut

public void testASMFunctionStepOut()

testFramelessFunctionEntry

public void testFramelessFunctionEntry()

testASMFramelessFunctionStepOver

public void testASMFramelessFunctionStepOver()

testASMFramelessFunctionStepOut

public void testASMFramelessFunctionStepOut()

testASMFramelessFunctionCall

public void testASMFramelessFunctionCall()

testASMFramelessFunctionReturn

public void testASMFramelessFunctionReturn()

testASMFunctionStepOverPrologue

public void testASMFunctionStepOverPrologue()
Tests that the line stepper steps OK even when stack pointer changes.


testInstructionStepThroughSection

public void testInstructionStepThroughSection()

initTask

public Task initTask(Offspring process,
                     File source,
                     int startLine,
                     int endLine)

initTaskWithTask

public void initTaskWithTask(Task myTask,
                             File source,
                             int startLine,
                             int endLine)

runTest

public void runTest(String source,
                    int line,
                    Task task)

cleanup

public void cleanup()