lib.dwfl
Class TestElf

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by frysk.junit.TestCase
              extended by lib.dwfl.TestElf
All Implemented Interfaces:
Test

public class TestElf
extends TestCase


Nested Class Summary
(package private)  class TestElf.SymbolChecker
           
 
Field Summary
private  TestElf.SymbolChecker symbolChecker
           
 
Constructor Summary
TestElf()
           
 
Method Summary
private  void checkAuxv(Elf testElf, int wordSize, long[] types, long[] values)
           
private  ElfData findNoteSegment(Elf testElf)
          Helper routine that give an Elf object, find the note segment and returns the contents in ElfData
private static ElfSection getElfSectionWithAddr(Elf elfFile, long addr)
           
private  long getRegisterByOffset(byte[] buffer, int offset, int length, ByteOrder endian)
          Helper routine that given a buffer, offset and length returns a register value as a long
private static void reverseArray(byte[] array)
           
 void testCore_x86()
           
 void testCore_x8664()
           
 void testElfCorePrAuxvNotes_x86()
          Test 32 bit PrAuxv note info.
 void testElfCorePrAuxvNotes_x8664()
          Test 64 bit PrAuxv note info.
 void testElfCorePrpsNotes_x86()
          Test i386 Prpsinfo note info.
 void testElfCorePrpsNotes_x8664()
          Test x8664 Prpsinfo note info.
 void testElfCorePrstatusNotes_x86()
          Test i386 Prstatus note info.
 void testElfCorePrstatusNotes_x8664()
          Test x8664 Prstatus note info.
 void testLibraryVersions()
           
 void testObjectFile()
           
 void testObjectFileTables()
           
 void testSetByteOrder()
          Verify write/read of word-size is sane; that 32- and 64-bit word sizes are correct decoded is checked in the core-file tests above.
 void testSetWordSize()
          Verify write/read of word-size is sane; that 32- and 64-bit word sizes are correct decoded is checked in the core-file tests above.
 void testXFPRegSet()
           
 
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, setUp, tearDown, 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

symbolChecker

private TestElf.SymbolChecker symbolChecker
Constructor Detail

TestElf

public TestElf()
Method Detail

testCore_x8664

public void testCore_x8664()

testCore_x86

public void testCore_x86()

testElfCorePrpsNotes_x8664

public void testElfCorePrpsNotes_x8664()
Test x8664 Prpsinfo note info. Read the note data segment, pass it to ElfPrpsinfo to find the relative pstatus data, and parse.


testElfCorePrpsNotes_x86

public void testElfCorePrpsNotes_x86()
Test i386 Prpsinfo note info. Read the note data segment, pass it to ElfPrpsinfo to find the relative pstatus data, and parse.


testElfCorePrstatusNotes_x86

public void testElfCorePrstatusNotes_x86()
Test i386 Prstatus note info. Read the note data segment, pass it to ElfPrstatus to find the relative pstatus data, and parse.


testElfCorePrstatusNotes_x8664

public void testElfCorePrstatusNotes_x8664()
Test x8664 Prstatus note info. Read the note data segment, pass it to ElfPrstatus to find the relative pstatus data, and parse.


checkAuxv

private void checkAuxv(Elf testElf,
                       int wordSize,
                       long[] types,
                       long[] values)

testElfCorePrAuxvNotes_x8664

public void testElfCorePrAuxvNotes_x8664()
Test 64 bit PrAuxv note info. Read the note data segment, pass it to ElfPrAuxv to find the relative pstatus data, and parse.


testElfCorePrAuxvNotes_x86

public void testElfCorePrAuxvNotes_x86()
Test 32 bit PrAuxv note info. Read the note data segment, pass it to ElfPrAuxv to find the relative pstatus data, and parse.


testXFPRegSet

public void testXFPRegSet()
                   throws ElfException,
                          ElfFileException
Throws:
ElfException
ElfFileException

testObjectFile

public void testObjectFile()

testObjectFileTables

public void testObjectFileTables()

getElfSectionWithAddr

private static ElfSection getElfSectionWithAddr(Elf elfFile,
                                                long addr)

testLibraryVersions

public void testLibraryVersions()

reverseArray

private static void reverseArray(byte[] array)

getRegisterByOffset

private long getRegisterByOffset(byte[] buffer,
                                 int offset,
                                 int length,
                                 ByteOrder endian)
Helper routine that given a buffer, offset and length returns a register value as a long


findNoteSegment

private ElfData findNoteSegment(Elf testElf)
Helper routine that give an Elf object, find the note segment and returns the contents in ElfData


testSetWordSize

public void testSetWordSize()
Verify write/read of word-size is sane; that 32- and 64-bit word sizes are correct decoded is checked in the core-file tests above.


testSetByteOrder

public void testSetByteOrder()
Verify write/read of word-size is sane; that 32- and 64-bit word sizes are correct decoded is checked in the core-file tests above.