mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-0 fixed test related to GP-2950, GhidraComboBox changes
This commit is contained in:
parent
f65b3c4a05
commit
ca184bd30c
1 changed files with 15 additions and 24 deletions
|
@ -19,7 +19,6 @@ import static org.junit.Assert.*;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
@ -216,31 +215,29 @@ public class SearchTextPlugin3Test extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
goToService.goTo(new ProgramLocation(program, getAddr(0x01002c92)));
|
goToService.goTo(new ProgramLocation(program, getAddr(0x01002c92)));
|
||||||
|
|
||||||
ActionListener listener = tf.getActionListeners()[0];
|
triggerText(tf, "eax");
|
||||||
runSwing(() -> {
|
triggerEnter(tf);
|
||||||
tf.setText("eax");
|
|
||||||
listener.actionPerformed(null);
|
|
||||||
});
|
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
|
|
||||||
ProgramLocation loc = cbPlugin.getCurrentLocation();
|
ProgramLocation loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof CommentFieldLocation);
|
assertTrue(loc instanceof CommentFieldLocation);
|
||||||
assertEquals(CodeUnit.PLATE_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
assertEquals(CodeUnit.PLATE_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
||||||
assertEquals(cu.getMinAddress(), loc.getAddress());
|
assertEquals(cu.getMinAddress(), loc.getAddress());
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(tf);
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
|
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof CommentFieldLocation);
|
assertTrue(loc instanceof CommentFieldLocation);
|
||||||
assertEquals(CodeUnit.PRE_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
assertEquals(CodeUnit.PRE_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(tf);
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof LabelFieldLocation);
|
assertTrue(loc instanceof LabelFieldLocation);
|
||||||
assertEquals(3, ((LabelFieldLocation) loc).getCharOffset());
|
assertEquals(3, ((LabelFieldLocation) loc).getCharOffset());
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(tf);
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
|
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
|
@ -248,14 +245,14 @@ public class SearchTextPlugin3Test extends AbstractGhidraHeadedIntegrationTest {
|
||||||
assertEquals(0, ((OperandFieldLocation) loc).getOperandIndex());
|
assertEquals(0, ((OperandFieldLocation) loc).getOperandIndex());
|
||||||
assertEquals(cu.getMinAddress(), loc.getAddress());
|
assertEquals(cu.getMinAddress(), loc.getAddress());
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(tf);
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof CommentFieldLocation);
|
assertTrue(loc instanceof CommentFieldLocation);
|
||||||
assertEquals(CodeUnit.EOL_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
assertEquals(CodeUnit.EOL_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
||||||
assertEquals(cu.getMinAddress(), loc.getAddress());
|
assertEquals(cu.getMinAddress(), loc.getAddress());
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(tf);
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof CommentFieldLocation);
|
assertTrue(loc instanceof CommentFieldLocation);
|
||||||
|
@ -286,10 +283,8 @@ public class SearchTextPlugin3Test extends AbstractGhidraHeadedIntegrationTest {
|
||||||
JCheckBox cb = (JCheckBox) findAbstractButtonByText(container, "Functions");
|
JCheckBox cb = (JCheckBox) findAbstractButtonByText(container, "Functions");
|
||||||
setToggleButtonSelected(cb, true);
|
setToggleButtonSelected(cb, true);
|
||||||
|
|
||||||
runSwing(() -> {
|
triggerText(tf, "sscanf");
|
||||||
tf.setText("sscanf");
|
triggerEnter(searchButton);
|
||||||
searchButton.getActionListeners()[0].actionPerformed(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
|
|
||||||
|
@ -297,20 +292,19 @@ public class SearchTextPlugin3Test extends AbstractGhidraHeadedIntegrationTest {
|
||||||
assertTrue(loc instanceof CommentFieldLocation);
|
assertTrue(loc instanceof CommentFieldLocation);
|
||||||
assertEquals(CodeUnit.PLATE_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
assertEquals(CodeUnit.PLATE_COMMENT, ((CommentFieldLocation) loc).getCommentType());
|
||||||
|
|
||||||
ActionListener listener = searchButton.getActionListeners()[0];
|
triggerEnter(searchButton);
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
|
||||||
|
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof FunctionSignatureFieldLocation);
|
assertTrue(loc instanceof FunctionSignatureFieldLocation);
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(searchButton);
|
||||||
|
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
assertTrue(loc instanceof VariableCommentFieldLocation);
|
assertTrue(loc instanceof VariableCommentFieldLocation);
|
||||||
|
|
||||||
runSwing(() -> listener.actionPerformed(null));
|
triggerEnter(searchButton);
|
||||||
|
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
loc = cbPlugin.getCurrentLocation();
|
loc = cbPlugin.getCurrentLocation();
|
||||||
|
@ -505,11 +499,8 @@ public class SearchTextPlugin3Test extends AbstractGhidraHeadedIntegrationTest {
|
||||||
setToggleButtonSelected(cb, true);
|
setToggleButtonSelected(cb, true);
|
||||||
|
|
||||||
String searchText = "param_";
|
String searchText = "param_";
|
||||||
runSwing(() -> {
|
triggerText(tf, searchText);
|
||||||
tf.setText(searchText);
|
triggerEnter(tf);
|
||||||
ActionListener[] listeners = tf.getActionListeners();
|
|
||||||
listeners[0].actionPerformed(null);
|
|
||||||
});
|
|
||||||
waitForSearchTasks(dialog);
|
waitForSearchTasks(dialog);
|
||||||
|
|
||||||
ProgramLocation loc = plugin.getNavigatable().getLocation();
|
ProgramLocation loc = plugin.getNavigatable().getLocation();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue