frysk.debuginfo
Class TestObjectDeclarationSearchEngine

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.debuginfo.TestObjectDeclarationSearchEngine
All Implemented Interfaces:
Test

public class TestObjectDeclarationSearchEngine
extends TestLib

Tests @link CppVariableSearchEngine. Each tests is testing the the @link ObjectDeclarationSearchEngine can find the correct variable, by insuring that the line number of the found Variable is the same as the line number of the variable in the source file. To add a new test copy one of the tests here and change the variable name the variable token if the variable name is not unique, fileName if you do not want to use funit-c-scopes, and finally exec and src paths of they are something other than the default.


Field Summary
(package private)  ObjectDeclarationSearchEngine objectDeclarationSearchEngine
           
 
Fields inherited from class frysk.testbed.TestLib
host
 
Constructor Summary
TestObjectDeclarationSearchEngine()
           
 
Method Summary
private  File getSrc(String name)
           
 void testFindArg1Scopes()
           
 void testFindFirstElfSymbols()
           
 void testFindFirstScopes()
           
 void testFindFirstScopesClass()
           
 void testFindFirstScopesNamespace()
           
 void testFindIScopesShadowing()
           
 void testFindTwoScopesEnum()
           
 void testFindVar1Scopes()
           
 void testFindVar2Scopes()
           
private  void verifyVariable(String variableName, String variableToken, String fileName, File srcPath)
          Runs the given executable until it sigfaults then searches for the variable with the given name from that point.
private  void verifyVariableByValue(String variableName, String valueString, String fileName)
          This function should only be used when it is not possible to use verifyVariable, since it relies on the expression evaluation code and the type system.
 
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

objectDeclarationSearchEngine

ObjectDeclarationSearchEngine objectDeclarationSearchEngine
Constructor Detail

TestObjectDeclarationSearchEngine

public TestObjectDeclarationSearchEngine()
Method Detail

getSrc

private File getSrc(String name)

testFindVar1Scopes

public void testFindVar1Scopes()

testFindVar2Scopes

public void testFindVar2Scopes()

testFindArg1Scopes

public void testFindArg1Scopes()

testFindIScopesShadowing

public void testFindIScopesShadowing()

testFindFirstScopesNamespace

public void testFindFirstScopesNamespace()

testFindTwoScopesEnum

public void testFindTwoScopesEnum()

testFindFirstScopesClass

public void testFindFirstScopesClass()

testFindFirstScopes

public void testFindFirstScopes()

testFindFirstElfSymbols

public void testFindFirstElfSymbols()

verifyVariable

private void verifyVariable(String variableName,
                            String variableToken,
                            String fileName,
                            File srcPath)
Runs the given executable until it sigfaults then searches for the variable with the given name from that point. Then it verifies that the line number of the variable found is the same as the line number in the source file where the given token is.

Parameters:
variableName - Name of the variable to search for.
variableToken - a token string from the source file that is found on the same line as the variable.
fileName - name of the test file.
execPath - path to the executable to be run.
srcPath - path to the source file from which the executable was created

verifyVariableByValue

private void verifyVariableByValue(String variableName,
                                   String valueString,
                                   String fileName)
This function should only be used when it is not possible to use verifyVariable, since it relies on the expression evaluation code and the type system. Runs the given executable until it sigfaults then searches for the variable with the given name from that point. Then it verifies that variable has the expected value.

Parameters:
variableName - Name of the variable to search for.
variableToken - a token string from the source file that is found on the same line as the variable.
fileName - name of the test file.
execPath - path to the executable to be run.