use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.
the class BaseTypeHelpersTests method testFindMemberArrayType3.
@Test
public void testFindMemberArrayType3() {
final WalkResult result = BaseTypeHelpers.findMember(typeSystem.uintArrayType, typeSystem.uintArrayType.getBitSize() + 1);
assertTrue(result.isValid());
assertEquals("unsigned int[10]+1", result.getPathString());
assertEquals(Lists.newArrayList(typeSystem.uintArrayTypeMember), result.getPath());
assertEquals(typeSystem.uintArrayTypeMember, result.getMember());
}
use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.
the class BaseTypeHelpersTests method testFindMemberNestedStructType6.
@Test
public void testFindMemberNestedStructType6() {
final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 96 + 320 - 32);
assertNotNull(result);
assertTrue(result.isValid());
assertEquals(typeSystem.ssArrayMember, result.getMember());
assertEquals(Lists.newArrayList(typeSystem.dnsNestedStructMember, typeSystem.nsSimpleStructMember, typeSystem.ssArrayMember), result.getPath());
assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsNestedStructMember.getName() + "." + typeSystem.nsSimpleStructMember.getName() + "." + typeSystem.ssArrayMember.getName() + "[9]", result.getPathString());
}
use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.
the class BaseTypeHelpersTests method testFindMemberNestedStructType7.
@Test
public void testFindMemberNestedStructType7() {
final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 96 + 320);
assertNotNull(result);
assertTrue(result.isValid());
assertEquals(typeSystem.dnsIntMember, result.getMember());
assertEquals(Lists.newArrayList(typeSystem.dnsIntMember), result.getPath());
assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsIntMember.getName(), result.getPathString());
}
use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.
the class BaseTypeHelpersTests method testFindMemberArrayType2.
@Test
public void testFindMemberArrayType2() {
final WalkResult result = BaseTypeHelpers.findMember(typeSystem.uintArrayType, 32);
assertNotNull(result);
assertTrue(result.isValid());
assertNotNull(result.getMember());
assertEquals(typeSystem.uintArrayTypeMember, result.getMember());
assertEquals(Lists.newArrayList(typeSystem.uintArrayTypeMember), result.getPath());
assertEquals("unsigned int[1]", result.getPathString());
}
use of com.google.security.zynamics.binnavi.disassembly.types.BaseTypeHelpers.WalkResult in project binnavi by google.
the class BaseTypeHelpersTests method testFindMemberNestedStructType5.
@Test
public void testFindMemberNestedStructType5() {
final WalkResult result = BaseTypeHelpers.findMember(typeSystem.doubleNestedStruct, 128);
assertNotNull(result);
assertTrue(result.isValid());
assertEquals(typeSystem.ssArrayMember, result.getMember());
assertEquals(Lists.newArrayList(typeSystem.dnsNestedStructMember, typeSystem.nsSimpleStructMember, typeSystem.ssArrayMember), result.getPath());
assertEquals(typeSystem.doubleNestedStruct.getName() + "." + typeSystem.dnsNestedStructMember.getName() + "." + typeSystem.nsSimpleStructMember.getName() + "." + typeSystem.ssArrayMember.getName() + "[1]", result.getPathString());
}
Aggregations