mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Test fixes
This commit is contained in:
parent
cc4a4e5ed2
commit
9e9de7c4f5
2 changed files with 14 additions and 13 deletions
|
@ -4,9 +4,9 @@
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -15,13 +15,13 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.codebrowser;
|
package ghidra.app.plugin.core.codebrowser;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
|
|
||||||
import docking.ActionContext;
|
import docking.ActionContext;
|
||||||
import docking.action.DockingActionIf;
|
import docking.action.DockingActionIf;
|
||||||
|
import docking.action.MenuData;
|
||||||
import ghidra.app.context.ProgramLocationActionContext;
|
import ghidra.app.context.ProgramLocationActionContext;
|
||||||
import ghidra.app.services.ProgramManager;
|
import ghidra.app.services.ProgramManager;
|
||||||
import ghidra.app.util.viewer.listingpanel.ListingModel;
|
import ghidra.app.util.viewer.listingpanel.ListingModel;
|
||||||
|
@ -217,13 +217,18 @@ public class ExpandCollapseDataActionsTest extends AbstractGhidraHeadedIntegrati
|
||||||
public void testExpandAllInSelectionEnablement() {
|
public void testExpandAllInSelectionEnablement() {
|
||||||
// Expand All In Selection is enabled whenever there is a selection
|
// Expand All In Selection is enabled whenever there is a selection
|
||||||
ProgramSelection selection = new ProgramSelection(addr(0), addr(10));
|
ProgramSelection selection = new ProgramSelection(addr(0), addr(10));
|
||||||
assertTrue(!expandAll.isEnabledForContext(getContext(addr(0x0), null)));
|
ActionContext context = getContext(addr(0x0), null);
|
||||||
assertEquals("Expand All Data", expandAll.getPopupMenuData().getMenuPath()[0]);
|
assertTrue(!expandAll.isEnabledForContext(context));
|
||||||
|
MenuData menuData = expandAll.getPopupMenuData();
|
||||||
|
String[] menuPath = menuData.getMenuPath();
|
||||||
|
assertArrayEquals(menuPath, new String[] { "Data", "Expand All Data" });
|
||||||
|
|
||||||
assertTrue(
|
context = getContextWithSelection(addr(STRUCT_1), selection);
|
||||||
expandAll.isEnabledForContext(getContextWithSelection(addr(STRUCT_1), selection)));
|
assertTrue(expandAll.isEnabledForContext(context));
|
||||||
// When there is a selection, the pop-up menu changes
|
// When there is a selection, the pop-up menu changes
|
||||||
assertEquals("Expand All Data In Selection", expandAll.getPopupMenuData().getMenuPath()[0]);
|
menuData = expandAll.getPopupMenuData();
|
||||||
|
menuPath = menuData.getMenuPath();
|
||||||
|
assertArrayEquals(menuPath, new String[] { "Data", "Expand All Data In Selection" });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -224,10 +224,6 @@ public class KeyBindingsTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
assertKeyFieldText(ks);
|
assertKeyFieldText(ks);
|
||||||
apply();
|
apply();
|
||||||
assertEquals(ks, getKeyStroke(action1));
|
assertEquals(ks, getKeyStroke(action1));
|
||||||
|
|
||||||
// verify the additional binding for 'Alt Graph'
|
|
||||||
action = (Action) TestUtils.invokeInstanceMethod("getActionForKeyStroke", dwm, keyStroke);
|
|
||||||
assertNotNull(action);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue