Search in sources :

Example 91 with MockModule

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

the class CCodeBookmarkTableModelTest method test7removeBookmarkWorking.

@Test
public void test7removeBookmarkWorking() {
    final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
    final CCodeBookmarkTableModel tableModel = new CCodeBookmarkTableModel(bookmarkManager);
    final CCodeBookmark bookmark = new CCodeBookmark(new MockModule(), new MockAddress(), "burzel");
    bookmarkManager.addBookmark(bookmark);
    assertEquals("burzel", tableModel.getValueAt(0, 2));
    tableModel.setValueAt("working", 0, 2);
    assertEquals(1, tableModel.getRowCount());
    assertEquals("working", tableModel.getValueAt(0, 2));
    bookmarkManager.removeBookmark(bookmark);
    assertEquals(0, tableModel.getRowCount());
}
Also used : CCodeBookmark(com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmark) CCodeBookmarkTableModel(com.google.security.zynamics.binnavi.Gui.CodeBookmarks.CCodeBookmarkTableModel) CCodeBookmarkManager(com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) MockAddress(com.google.security.zynamics.zylib.disassembly.MockAddress) Test(org.junit.Test)

Example 92 with MockModule

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

the class CBookmarkFunctionsTest method test1AddBookmark.

@Test
public void test1AddBookmark() {
    final CCodeBookmarkManager bookmarkManager = new CCodeBookmarkManager();
    final MockAddress mockAddress = new MockAddress();
    final MockModule mockModule = new MockModule();
    assertEquals(0, bookmarkManager.size());
    CBookmarkFunctions.addBookmark(bookmarkManager, mockModule, mockAddress);
    assertEquals(1, bookmarkManager.size());
}
Also used : CCodeBookmarkManager(com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) MockAddress(com.google.security.zynamics.zylib.disassembly.MockAddress) Test(org.junit.Test)

Example 93 with MockModule

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

the class ZyGraphTest method setUp.

@Before
public void setUp() throws IllegalStateException, FileReadException, LoadCancelledException {
    ConfigManager.instance().read();
    final ZyGraphViewSettings settings = ConfigManager.instance().getDefaultFlowGraphSettings();
    settings.getProximitySettings().setProximityBrowsingActivationThreshold(50);
    settings.getProximitySettings().setProximityBrowsingChildren(2);
    settings.getProximitySettings().setProximityBrowsingParents(2);
    ConfigManager.instance().updateFlowgraphSettings(settings);
    m_provider = new MockSqlProvider();
    m_module = new MockModule(m_provider);
    m_function = new MockFunction(m_provider);
    m_view = MockViewGenerator.generate(m_provider, m_module, m_function);
    m_graph = CGraphBuilder.buildGraph(m_view);
}
Also used : MockFunction(com.google.security.zynamics.binnavi.disassembly.MockFunction) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) Before(org.junit.Before)

Example 94 with MockModule

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

the class ZyProximityBrowserTest method setUp.

@Before
public void setUp() throws IllegalStateException, FileReadException, LoadCancelledException {
    ConfigManager.instance().read();
    final ZyGraphViewSettings settings = ConfigManager.instance().getDefaultFlowGraphSettings();
    settings.getProximitySettings().setProximityBrowsingActivationThreshold(50);
    settings.getProximitySettings().setProximityBrowsingChildren(2);
    settings.getProximitySettings().setProximityBrowsingParents(2);
    ConfigManager.instance().updateFlowgraphSettings(settings);
    m_provider = new MockSqlProvider();
    final INaviModule module = new MockModule(m_provider);
    final MockFunction function = new MockFunction(m_provider);
    m_view = MockViewGenerator.generate(m_provider, module, function);
    m_graph = CGraphBuilder.buildGraph(m_view);
}
Also used : MockFunction(com.google.security.zynamics.binnavi.disassembly.MockFunction) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) Before(org.junit.Before)

Example 95 with MockModule

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

the class CFunctionTest method setUp.

@Before
public void setUp() {
    provider = new MockSqlProvider();
    module = new MockModule(provider);
    view = new MockView(provider);
    address = new CAddress(0x12345678L);
}
Also used : MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) MockSqlProvider(com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) Before(org.junit.Before)

Aggregations

MockModule (com.google.security.zynamics.binnavi.disassembly.Modules.MockModule)98 Test (org.junit.Test)90 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)45 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)32 CommentNotification (com.google.security.zynamics.binnavi.Database.PostgreSQL.Notifications.interfaces.CommentNotification)26 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)24 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)14 MockView (com.google.security.zynamics.binnavi.disassembly.MockView)14 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)13 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)13 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)12 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)12 CCodeBookmarkManager (com.google.security.zynamics.binnavi.models.Bookmarks.code.CCodeBookmarkManager)12 MockAddress (com.google.security.zynamics.zylib.disassembly.MockAddress)12 DebugTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.DebugTargetSettings)11 DebuggerProvider (com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider)11 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)10 MockTagManager (com.google.security.zynamics.binnavi.Tagging.MockTagManager)10 CCodeNode (com.google.security.zynamics.binnavi.disassembly.CCodeNode)10 CFunction (com.google.security.zynamics.binnavi.disassembly.CFunction)9