use of com.google.security.zynamics.binnavi.Gui.Debug.MemoryPanel.Implementations.CDumpAllWaiter in project binnavi by google.
the class CDumpAllWaiterTest method testCloseRequested.
@Test
public void testCloseRequested() throws Exception {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.connect();
final CDumpAllWaiter waiter = new CDumpAllWaiter(debugger, new CAddress(0x300), 0x100);
waiter.start();
new Thread() {
@Override
public void run() {
try {
waiter.runExpensiveCommand();
} catch (final Exception e) {
}
}
}.start();
Thread.sleep(250);
waiter.closeRequested();
Thread.sleep(250);
debugger.close();
assertFalse(waiter.isAlive());
assertTrue(waiter.success());
}
use of com.google.security.zynamics.binnavi.Gui.Debug.MemoryPanel.Implementations.CDumpAllWaiter in project binnavi by google.
the class CDumpAllWaiterTest method testSuccess.
@Test
public void testSuccess() throws Exception {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.connect();
final CDumpAllWaiter waiter = new CDumpAllWaiter(debugger, new CAddress(0x300), 0x100);
waiter.start();
new Thread() {
@Override
public void run() {
try {
waiter.runExpensiveCommand();
} catch (final Exception e) {
}
}
}.start();
Thread.sleep(250);
debugger.connection.m_synchronizer.receivedEvent(new ReadMemoryReply(0, 0, new CAddress(0x300), new byte[] { 0x50, 0x50, 0x50, 0x50 }));
Thread.sleep(250);
assertFalse(waiter.isAlive());
assertTrue(waiter.success());
debugger.close();
}
use of com.google.security.zynamics.binnavi.Gui.Debug.MemoryPanel.Implementations.CDumpAllWaiter in project binnavi by google.
the class CDumpAllWaiterTest method testDetach.
@Test
public void testDetach() throws Exception {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.connect();
final CDumpAllWaiter waiter = new CDumpAllWaiter(debugger, new CAddress(0x300), 0x100);
waiter.start();
new Thread() {
@Override
public void run() {
try {
waiter.runExpensiveCommand();
} catch (final Exception e) {
}
}
}.start();
Thread.sleep(250);
debugger.connection.m_synchronizer.receivedEvent(new DetachReply(0, 0));
Thread.sleep(250);
assertFalse(waiter.isAlive());
assertTrue(waiter.success());
debugger.close();
}
use of com.google.security.zynamics.binnavi.Gui.Debug.MemoryPanel.Implementations.CDumpAllWaiter in project binnavi by google.
the class CDumpAllWaiterTest method testFailure.
@Test
public void testFailure() throws Exception {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.connect();
final CDumpAllWaiter waiter = new CDumpAllWaiter(debugger, new CAddress(0x300), 0x100);
waiter.start();
new Thread() {
@Override
public void run() {
try {
waiter.runExpensiveCommand();
} catch (final Exception e) {
}
}
}.start();
Thread.sleep(250);
debugger.connection.m_synchronizer.receivedEvent(new ReadMemoryReply(0, 3, null, null));
Thread.sleep(250);
assertFalse(waiter.isAlive());
assertFalse(waiter.success());
debugger.close();
}
Aggregations