Search in sources :

Example 6 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberPointerType1.

@Test
public void testFindMemberPointerType1() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.uintPointerType, 1);
    assertNotNull(result);
    assertFalse(result.isValid());
    assertNull(result.getMember());
    assertNull(result.getPath());
    assertEquals("", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 7 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberStructType5.

@Test
public void testFindMemberStructType5() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.simpleStruct, 352);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.ssArrayMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.ssArrayMember), result.getPath());
    assertEquals("SimpleStruct.ss_array_member[9]", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 8 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberNestedStructType1.

@Test
public void testFindMemberNestedStructType1() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 0);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.nsIntMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.dnsNestedStructMember, typeSystem.nsIntMember), result.getPath());
    assertEquals("DoubleNestedStruct.dns_nested_struct_member.ns_int_member", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 9 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberStructType1.

@Test
public void testFindMemberStructType1() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.simpleStruct, 0);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.ssIntMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.ssIntMember), result.getPath());
    assertEquals("SimpleStruct.ss_int_member", result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Example 10 with WalkResult

use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.

the class BaseTypeHelpersTests method testFindMemberNestedStructType8.

@Test
public void testFindMemberNestedStructType8() {
    final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 96 + 320 + 32);
    assertNotNull(result);
    assertTrue(result.isValid());
    assertEquals(typeSystem.dnsPointerMember, result.getMember());
    assertEquals(Lists.newArrayList(typeSystem.dnsPointerMember), result.getPath());
    assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsPointerMember.getName(), result.getPathString());
}
Also used : WalkResult(com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult) Test(org.junit.Test)

Aggregations

WalkResult (com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult)20 Test (org.junit.Test)19 TypeMemberTreeNode (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.TypeMemberTreeNode)1 TypeMember (com.google.security.zynamics.binnavi.disassembly.types.TypeMember)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1