mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Test fixes
This commit is contained in:
parent
c88a8a7040
commit
c80297eaac
2 changed files with 80 additions and 102 deletions
|
@ -65,7 +65,6 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
private AddressSet destinationSelection;
|
||||
|
||||
public VTAddToSessionTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Before
|
||||
|
@ -129,8 +128,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -146,12 +144,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" +
|
||||
"Entire Destination Program<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -185,8 +183,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -208,12 +205,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" +
|
||||
"Entire Destination Program<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -247,8 +244,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -270,12 +266,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" +
|
||||
"Manually Defined<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -309,8 +305,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -345,12 +340,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" +
|
||||
"Manually Defined<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -386,8 +381,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -409,12 +403,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" +
|
||||
"Entire Destination Program<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -450,8 +444,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -473,12 +466,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>No<br>Source Tool Selection<br>" +
|
||||
"Destination Tool Selection<br></html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -514,8 +507,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -550,12 +542,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" +
|
||||
"Manually Defined<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -591,8 +583,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -626,12 +617,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel and then begin going back through wizard panels.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Exact Function Instructions Match<br>" + "Yes<br>" + "Manually Defined<br>" +
|
||||
"Manually Defined<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.BACK);
|
||||
|
@ -693,8 +684,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
createWizardManager();
|
||||
|
||||
runSwingLater(
|
||||
() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
|
||||
|
||||
waitForDialogComponent(WizardManager.class);
|
||||
|
||||
|
@ -710,12 +700,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName +
|
||||
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
|
||||
TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
|
||||
"Data Reference Match<br>" + "No<br>" + "Entire Source Program<br>" +
|
||||
"Entire Destination Program<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
|
||||
|
@ -790,7 +780,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
// options.putString(testOptionKey, firstNewOptionValue);
|
||||
// assertEquals(firstNewOptionValue, options.getString(testOptionKey, null));
|
||||
// correlator.setOptions(LCSAddressCorrelator.class, options);
|
||||
// // save the options
|
||||
// // save the options
|
||||
// SaveState saveState = new SaveState();
|
||||
// controller.writeConfigState(saveState);
|
||||
//
|
||||
|
@ -800,7 +790,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
// correlator.setOptions(LCSAddressCorrelator.class, options);
|
||||
//
|
||||
// // pull the values again and make sure they are still correct (that writing the config
|
||||
// // state did not change the cached controller and options)
|
||||
// // state did not change the cached controller and options)
|
||||
// correlator = controller.getCorrelator();
|
||||
// options = correlator.getOptions(LCSAddressCorrelator.class);
|
||||
// assertEquals(secondNewValue, options.getString(testOptionKey, null));
|
||||
|
@ -820,9 +810,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(excludeCheckbox);
|
||||
|
||||
JCheckBox showAddressSetPanelsCheckbox =
|
||||
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox",
|
||||
addressSetOptionsPanel);
|
||||
JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
|
||||
.getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(showAddressSetPanelsCheckbox);
|
||||
|
||||
assertEquals("Exclude Accepted Matches checkbox", excludeAccepted,
|
||||
|
@ -844,9 +833,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(excludeCheckbox);
|
||||
|
||||
JCheckBox showAddressSetPanelsCheckbox =
|
||||
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox",
|
||||
addressSetOptionsPanel);
|
||||
JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
|
||||
.getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(showAddressSetPanelsCheckbox);
|
||||
|
||||
if (excludeCheckbox.isSelected() != excludeAccepted) {
|
||||
|
@ -908,9 +896,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
AddressSetView panelSourceSet =
|
||||
(AddressSetView) TestUtils.invokeInstanceMethod("getAddressSetView", sourceSetPanel);
|
||||
AddressSetView panelDestinationSet =
|
||||
(AddressSetView) TestUtils.invokeInstanceMethod("getAddressSetView",
|
||||
destinationSetPanel);
|
||||
AddressSetView panelDestinationSet = (AddressSetView) TestUtils
|
||||
.invokeInstanceMethod("getAddressSetView", destinationSetPanel);
|
||||
assertEquals("Source Address Set", desiredSourceSet, panelSourceSet);
|
||||
assertEquals("Destination Address Set", desiredDestinationSet, panelDestinationSet);
|
||||
}
|
||||
|
@ -1003,8 +990,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
(ChooseAddressSetEditorPanel) TestUtils.getInstanceField("panel", addressSetPanel);
|
||||
assertNotNull(panel);
|
||||
|
||||
JButton addRangeButton =
|
||||
(JButton) TestUtils.getInstanceField("addRangeButton", panel);
|
||||
JButton addRangeButton = (JButton) TestUtils.getInstanceField("addRangeButton", panel);
|
||||
assertNotNull("Couldn't get button for adding address range.", addRangeButton);
|
||||
JButton listRemoveRangeButton =
|
||||
(JButton) TestUtils.getInstanceField("removeRangeButton", panel);
|
||||
|
@ -1034,8 +1020,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
(ChooseAddressSetEditorPanel) TestUtils.getInstanceField("panel", addressSetPanel);
|
||||
assertNotNull(panel);
|
||||
|
||||
JButton addRangeButton =
|
||||
(JButton) TestUtils.getInstanceField("addRangeButton", panel);
|
||||
JButton addRangeButton = (JButton) TestUtils.getInstanceField("addRangeButton", panel);
|
||||
JButton subtractRangeButton =
|
||||
(JButton) TestUtils.getInstanceField("subtractRangeButton", panel);
|
||||
|
||||
|
@ -1051,8 +1036,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
}
|
||||
}
|
||||
|
||||
private void enterAddressRange(boolean isSource, String buttonText,
|
||||
String minAddress, String maxAddress) {
|
||||
private void enterAddressRange(boolean isSource, String buttonText, String minAddress,
|
||||
String maxAddress) {
|
||||
|
||||
AddRemoveAddressRangeDialog addRemoveDialog =
|
||||
waitForDialogComponent(AddRemoveAddressRangeDialog.class);
|
||||
|
@ -1087,8 +1072,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertTrue("Dialog not closed after pressing: " + buttonText, !addRemoveDialog.isShowing());
|
||||
}
|
||||
|
||||
private void enterAddressRange(boolean isSource, String buttonText,
|
||||
Address minAddress, Address maxAddress) {
|
||||
private void enterAddressRange(boolean isSource, String buttonText, Address minAddress,
|
||||
Address maxAddress) {
|
||||
|
||||
AddRemoveAddressRangeDialog addRemoveDialog =
|
||||
waitForDialogComponent(AddRemoveAddressRangeDialog.class);
|
||||
|
|
|
@ -51,7 +51,6 @@ import ghidra.program.model.listing.Library;
|
|||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.model.symbol.*;
|
||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import ghidra.util.task.Task;
|
||||
|
@ -75,7 +74,6 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
|
|||
protected WizardManager wizardManager;
|
||||
|
||||
public AbstractVTCorrelatorTest(String sourceProgLoc, String destProgLoc) {
|
||||
super();
|
||||
this.sourceProgLoc = sourceProgLoc;
|
||||
this.destProgLoc = destProgLoc;
|
||||
}
|
||||
|
@ -132,16 +130,14 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
|
|||
|
||||
// Check the summary panel.
|
||||
checkWizardButtonEnablement(true, false, true, true);
|
||||
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" +
|
||||
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
|
||||
"Destination Program:<br>" + "Program Correlator:<br>" +
|
||||
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
|
||||
"Destination Address Set:<br>" + "</html>";
|
||||
String summaryString = "<html>" + "Add to Version Tracking Session<br>" +
|
||||
session.getName() + "<br>" + srcProg.getName() + "<br>" + destProg.getName() + "<br>" +
|
||||
correlatorName + "<br>" + "No<br>" + "Entire Source Program<br>" +
|
||||
"Entire Destination Program<br>" + "</html>";
|
||||
checkSummaryPanel(HTMLUtilities.toHTML(labelString), HTMLUtilities.toHTML(summaryString),
|
||||
wizardManager::finish);
|
||||
String summaryString = "Add to Version Tracking Session<br>" + session.getName() + "<br>" +
|
||||
srcProg.getName() + "<br>" + destProg.getName() + "<br>" + correlatorName + "<br>" +
|
||||
"No<br>" + "Entire Source Program<br>" + "Entire Destination Program<br>" + "</html>";
|
||||
checkSummaryPanel(labelString, summaryString, wizardManager::finish);
|
||||
}
|
||||
|
||||
public void runTestCorrelator(String correlatorName) {
|
||||
|
@ -377,7 +373,7 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
|
|||
/**
|
||||
* Run Dummy Task Monitor, flush events and wait for Swing.
|
||||
* @param task
|
||||
* @throws Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void runTask(Task task) throws Exception {
|
||||
|
||||
|
@ -462,33 +458,32 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
|
|||
OptionsEditorPanel correlatorOptionsPanel = getCorrelatorOptionsPanel(correlatorName);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<EditorState> editorInfoList =
|
||||
(List<EditorState>) TestUtils.getInstanceField("editorInfoList",
|
||||
correlatorOptionsPanel);
|
||||
List<EditorState> editorInfoList = (List<EditorState>) TestUtils
|
||||
.getInstanceField("editorInfoList", correlatorOptionsPanel);
|
||||
for (EditorState editorState : editorInfoList) {
|
||||
String optionName = editorState.getTitle();
|
||||
Component editorComponent = editorState.getEditorComponent();
|
||||
|
||||
if (optionName.equals(
|
||||
VTAbstractReferenceProgramCorrelatorFactory.CONFIDENCE_THRESHOLD)) {
|
||||
if (optionName
|
||||
.equals(VTAbstractReferenceProgramCorrelatorFactory.CONFIDENCE_THRESHOLD)) {
|
||||
PropertyText fieldText = (PropertyText) editorComponent;
|
||||
fieldText.setText(String.format("%f", confidence));
|
||||
fieldText.repaint();
|
||||
}
|
||||
else if (optionName.equals(
|
||||
VTAbstractReferenceProgramCorrelatorFactory.MEMORY_MODEL)) {
|
||||
else if (optionName
|
||||
.equals(VTAbstractReferenceProgramCorrelatorFactory.MEMORY_MODEL)) {
|
||||
PropertySelector selector = (PropertySelector) editorComponent;
|
||||
selector.setSelectedItem(memoryModel);
|
||||
selector.repaint();
|
||||
}
|
||||
else if (optionName.equals(
|
||||
VTAbstractReferenceProgramCorrelatorFactory.SIMILARITY_THRESHOLD)) {
|
||||
else if (optionName
|
||||
.equals(VTAbstractReferenceProgramCorrelatorFactory.SIMILARITY_THRESHOLD)) {
|
||||
PropertyText fieldText = (PropertyText) editorComponent;
|
||||
fieldText.setText(String.format("%f", score));
|
||||
fieldText.repaint();
|
||||
}
|
||||
else if (optionName.equals(
|
||||
VTAbstractReferenceProgramCorrelatorFactory.REFINE_RESULTS)) {
|
||||
else if (optionName
|
||||
.equals(VTAbstractReferenceProgramCorrelatorFactory.REFINE_RESULTS)) {
|
||||
PropertyBoolean checkBox = (PropertyBoolean) editorComponent;
|
||||
checkBox.setSelected(refineResults);
|
||||
checkBox.repaint();
|
||||
|
@ -537,9 +532,8 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
|
|||
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(excludeCheckbox);
|
||||
|
||||
JCheckBox showAddressSetPanelsCheckbox =
|
||||
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox",
|
||||
addressSetOptionsPanel);
|
||||
JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
|
||||
.getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(showAddressSetPanelsCheckbox);
|
||||
|
||||
assertEquals("Exclude Accepted Matches checkbox", excludeAccepted,
|
||||
|
@ -561,9 +555,8 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
|
|||
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(excludeCheckbox);
|
||||
|
||||
JCheckBox showAddressSetPanelsCheckbox =
|
||||
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox",
|
||||
addressSetOptionsPanel);
|
||||
JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
|
||||
.getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
|
||||
assertNotNull(showAddressSetPanelsCheckbox);
|
||||
|
||||
if (excludeCheckbox.isSelected() != excludeAccepted) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue