Merge remote-tracking branch 'origin/Ghidra_11.3'

This commit is contained in:
ghidra1 2025-01-28 16:43:03 -05:00
commit 25cda5d8a5
2 changed files with 33 additions and 33 deletions

View file

@ -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.
@ -197,6 +197,7 @@ public class CodeBrowserOptionsTest extends AbstractGhidraHeadedIntegrationTest
assertEquals("Pre-comments Field", groups[idx++]); assertEquals("Pre-comments Field", groups[idx++]);
assertEquals("Register Field", groups[idx++]); assertEquals("Register Field", groups[idx++]);
assertEquals("Selection Colors", groups[idx++]); assertEquals("Selection Colors", groups[idx++]);
assertEquals("Source Maps", groups[idx++]);
assertEquals("Templates", groups[idx++]); assertEquals("Templates", groups[idx++]);
assertEquals("XREFs Field", groups[idx++]); assertEquals("XREFs Field", groups[idx++]);
} }
@ -763,9 +764,8 @@ public class CodeBrowserOptionsTest extends AbstractGhidraHeadedIntegrationTest
assertEquals("Operands Field.Underline References", names.get(14)); assertEquals("Operands Field.Underline References", names.get(14));
assertEquals("Operands Field.Wrap on Semicolons", names.get(15)); assertEquals("Operands Field.Wrap on Semicolons", names.get(15));
NamespaceWrappedOption namespaceOption = NamespaceWrappedOption namespaceOption = (NamespaceWrappedOption) options
(NamespaceWrappedOption) options.getCustomOption(names.get(3), .getCustomOption(names.get(3), new NamespaceWrappedOption());
new NamespaceWrappedOption());
assertTrue(cb.goToField(addr("0x100eee0"), "Address", 0, 0)); assertTrue(cb.goToField(addr("0x100eee0"), "Address", 0, 0));
ListingTextField btf = (ListingTextField) cb.getCurrentField(); ListingTextField btf = (ListingTextField) cb.getCurrentField();

View file

@ -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.
@ -124,7 +124,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
ListingField bf = cb.getCurrentField(); ListingField bf = cb.getCurrentField();
int fieldStart = bf.getStartX(); int fieldStart = bf.getStartX();
int distance = 10; int distance = 10;
int row = 3; int row = 4;
dragFieldEdge(fieldStart, row, distance); dragFieldEdge(fieldStart, row, distance);
waitForSwing(); waitForSwing();
@ -133,8 +133,8 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
} }
private void dragFieldEdge(int fieldStartX, int row, int delta) { private void dragFieldEdge(int fieldStartX, int row, int delta) {
dragMouse(header.getHeaderTab(), BUTTON_ONE, fieldStartX, row(3), fieldStartX + delta, dragMouse(header.getHeaderTab(), BUTTON_ONE, fieldStartX, row(4), fieldStartX + delta,
row(3), NO_MODIFIERS); row(4), NO_MODIFIERS);
} }
private int row(int i) { private int row(int i) {
@ -147,7 +147,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
int startX = bf.getStartX(); int startX = bf.getStartX();
int width = bf.getWidth(); int width = bf.getWidth();
int endX = startX + width; int endX = startX + width;
int row = 3; int row = 4;
int distance = -10; int distance = -10;
dragFieldEdge(endX, row, distance); dragFieldEdge(endX, row, distance);
waitForSwing(); waitForSwing();
@ -166,7 +166,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
int width = bf.getWidth(); int width = bf.getWidth();
int middleFirstFieldX = startX / 2; int middleFirstFieldX = startX / 2;
int pastMiddleSecondFieldX = startX + width / 2 + 1; int pastMiddleSecondFieldX = startX + width / 2 + 1;
int row = 3; int row = 4;
dragField(row, middleFirstFieldX, row, pastMiddleSecondFieldX); dragField(row, middleFirstFieldX, row, pastMiddleSecondFieldX);
waitForSwing(); waitForSwing();
@ -192,7 +192,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
// move the cursor just before the end of the first column, startX has the position // move the cursor just before the end of the first column, startX has the position
// of the start of the second column field. // of the start of the second column field.
moveMouse(header.getHeaderTab(), startX - 1, row(3)); moveMouse(header.getHeaderTab(), startX - 1, row(4));
waitForSwing(); waitForSwing();
@ -200,7 +200,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
assertEquals("East Resize Cursor", cursor.getName()); assertEquals("East Resize Cursor", cursor.getName());
// move the cursor to the middle of the second col // move the cursor to the middle of the second col
moveMouse(header.getHeaderTab(), (startX + endX) / 2, row(3)); moveMouse(header.getHeaderTab(), (startX + endX) / 2, row(4));
waitForSwing(); waitForSwing();
@ -208,7 +208,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
assertEquals("Default Cursor", cursor.getName()); assertEquals("Default Cursor", cursor.getName());
// move the cursor to near the beginning of the second field // move the cursor to near the beginning of the second field
moveMouse(header.getHeaderTab(), startX + 1, row(3)); moveMouse(header.getHeaderTab(), startX + 1, row(4));
waitForSwing(); waitForSwing();
@ -223,8 +223,8 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
int width = bf.getWidth(); int width = bf.getWidth();
int dragX = startX + width / 2; int dragX = startX + width / 2;
int dropX = 200; // any x location int dropX = 200; // any x location
int dragRow = 3; int dragRow = 4;
int dropRow = 8; int dropRow = 9;
dragField(dragRow, dragX, dropRow, dropX); dragField(dragRow, dragX, dropRow, dropX);
waitForSwing(); waitForSwing();
cb.goToField(addr("0x1003522"), "Address", 0, 0); cb.goToField(addr("0x1003522"), "Address", 0, 0);
@ -236,14 +236,14 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
@Test @Test
public void testDragToPastBottomRow() { public void testDragToPastBottomRow() {
FieldFormatModel model = header.getFormatManager().getCodeUnitFormat(); FieldFormatModel model = header.getFormatManager().getCodeUnitFormat();
assertEquals(7, model.getNumRows()); assertEquals(8, model.getNumRows());
ListingField bf = cb.getCurrentField(); ListingField bf = cb.getCurrentField();
int startX = bf.getStartX(); int startX = bf.getStartX();
int width = bf.getWidth(); int width = bf.getWidth();
int dragX = startX + width / 2; int dragX = startX + width / 2;
int dropX = 200; // any x location int dropX = 200; // any x location
int dragRow = 3; int dragRow = 4;
int dropRow = 7; int dropRow = 8;
dragField(dragRow, dragX, dropRow, dropX); dragField(dragRow, dragX, dropRow, dropX);
waitForSwing(); waitForSwing();
@ -251,11 +251,11 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
waitForSwing(); waitForSwing();
bf = cb.getCurrentField(); bf = cb.getCurrentField();
assertEquals(0, bf.getStartX()); assertEquals(0, bf.getStartX());
assertEquals(8, model.getNumRows()); assertEquals(9, model.getNumRows());
// now drag it back up // now drag it back up
dragField(7, width / 2, 0, 0); dragField(8, width / 2, 0, 0);
assertEquals(7, model.getNumRows()); assertEquals(8, model.getNumRows());
} }
@Test @Test
@ -264,7 +264,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
int startX = bf.getStartX(); int startX = bf.getStartX();
int width = bf.getWidth(); int width = bf.getWidth();
int dragX = startX + width / 2; int dragX = startX + width / 2;
int row = 3; int row = 4;
int dropX = 0; int dropX = 0;
dragField(row, dragX, row, dropX); dragField(row, dragX, row, dropX);
bf = cb.getCurrentField(); bf = cb.getCurrentField();
@ -275,16 +275,16 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
public void testInsertDeleteRow() { public void testInsertDeleteRow() {
FieldFormatModel model = header.getHeaderTab().getModel(); FieldFormatModel model = header.getHeaderTab().getModel();
InsertRowAction act = new InsertRowAction("Test", header); InsertRowAction act = new InsertRowAction("Test", header);
act.isEnabledForContext(new DefaultActionContext(cb.getProvider()).setContextObject( act.isEnabledForContext(new DefaultActionContext(cb.getProvider())
new FieldHeaderLocation(model, null, 0, 0))); .setContextObject(new FieldHeaderLocation(model, null, 0, 0)));
performAction(act, true); performAction(act, true);
assertEquals(8, model.getNumRows()); assertEquals(9, model.getNumRows());
assertEquals(0, model.getNumFactorys(0)); assertEquals(0, model.getNumFactorys(0));
RemoveRowAction act2 = new RemoveRowAction("Test", header); RemoveRowAction act2 = new RemoveRowAction("Test", header);
act2.isEnabledForContext(new DefaultActionContext(cb.getProvider()).setContextObject( act2.isEnabledForContext(new DefaultActionContext(cb.getProvider())
new FieldHeaderLocation(model, null, 0, 0))); .setContextObject(new FieldHeaderLocation(model, null, 0, 0)));
performAction(act2, true); performAction(act2, true);
assertEquals(7, model.getNumRows()); assertEquals(8, model.getNumRows());
assertEquals(2, model.getNumFactorys(0)); assertEquals(2, model.getNumFactorys(0));
} }
@ -294,12 +294,12 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
ListingField bf = cb.getCurrentField(); ListingField bf = cb.getCurrentField();
int startX = bf.getStartX(); int startX = bf.getStartX();
InsertRowAction act = new InsertRowAction("Test", header); InsertRowAction act = new InsertRowAction("Test", header);
act.isEnabledForContext(new DefaultActionContext(cb.getProvider()).setContextObject( act.isEnabledForContext(new DefaultActionContext(cb.getProvider())
new FieldHeaderLocation(model, null, 0, 0))); .setContextObject(new FieldHeaderLocation(model, null, 0, 0)));
performAction(act, true); performAction(act, true);
int width = bf.getWidth(); int width = bf.getWidth();
int dragX = startX + width / 2; int dragX = startX + width / 2;
int dragRow = 4; int dragRow = 5;
int dropX = 200; // any x will do int dropX = 200; // any x will do
int dropRow = 0; int dropRow = 0;
dragField(dragRow, dragX, dropRow, dropX); dragField(dragRow, dragX, dropRow, dropX);