Search in sources :

Example 1 with IRawModuleListener

use of com.google.security.zynamics.binnavi.disassembly.IRawModuleListener in project binnavi by google.

the class CRawModuleTest method testCRawModule_1.

@Test
public void testCRawModule_1() {
    final MockSqlProvider sqlProvider = new MockSqlProvider();
    final MockDatabase mockDatabase = new MockDatabase(sqlProvider);
    try {
        @SuppressWarnings("unused") final CRawModule rawModule = new CRawModule(0, null, 0, false, null);
        fail();
    } catch (final IllegalArgumentException e) {
    }
    try {
        @SuppressWarnings("unused") final CRawModule rawModule = new CRawModule(23, null, 0, false, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CRawModule rawModule = new CRawModule(23, "rawModule", 0, false, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CRawModule rawModule = new CRawModule(23, "rawModule", 1, false, null);
        fail();
    } catch (final NullPointerException e) {
    }
    final CRawModule rawModule = new CRawModule(23, "rawModule", 1, false, sqlProvider);
    @SuppressWarnings("unused") final IRawModuleListener listener;
    assertEquals(1, rawModule.getFunctionCount());
    assertEquals(23, rawModule.getId());
    assertEquals("rawModule", rawModule.getName());
    assertTrue(rawModule.inSameDatabase(sqlProvider));
    assertTrue(rawModule.inSameDatabase(mockDatabase));
    assertFalse(rawModule.isComplete());
}
Also used : MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) IRawModuleListener(com.google.security.zynamics.binnavi.disassembly.IRawModuleListener) MockDatabase(com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase) CRawModule(com.google.security.zynamics.binnavi.disassembly.CRawModule) Test(org.junit.Test)

Aggregations

MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)1 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)1 CRawModule (com.google.security.zynamics.binnavi.disassembly.CRawModule)1 IRawModuleListener (com.google.security.zynamics.binnavi.disassembly.IRawModuleListener)1 Test (org.junit.Test)1