Skip to content

Ghidra is a software reverse engineering (SRE) framework

Test fixes

dragonmacher27136f2f50cd
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/RootNode.java b/Ghidra/Framework/Docking/src/main/java/docking/RootNode.java
index 42e58839f5..67173151e6 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/RootNode.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/RootNode.java
@@ -448,13 +448,24 @@ class RootNode extends WindowNode {
private Rectangle getSaveableBounds() {
+ //
+ // The goal of this method is to get the correct window bounds to save. When not maximized,
+ // this is simply the window's bounds. However, when maximized, we wish to save the last
+ // non-maximized bounds so that toggle in and out of the maximized state will use the
+ // correct non-maximized bounds.
+ //
+ JFrame frame = windowWrapper.getParentFrame();
+ int state = frame.getExtendedState();
+ if (state != Frame.MAXIMIZED_BOTH) {
+ return frame.getBounds();
+ }
+
Rectangle bounds = windowWrapper.getLastBounds();
if (bounds != null) {
return bounds;
}
// This implies the user has never maximized the window; just use the window bounds.
- JFrame frame = windowWrapper.getParentFrame();
return frame.getBounds();
}
@@ -673,7 +684,6 @@ class RootNode extends WindowNode {
// wish to save the non-maximized bounds.
return;
}
-
this.lastBounds = bounds;
}
diff --git a/Ghidra/Framework/Emulation/src/test/java/ghidra/pcode/exec/SleighProgramCompilerTest.java b/Ghidra/Framework/Emulation/src/test/java/ghidra/pcode/exec/SleighProgramCompilerTest.java
index a0c9b6124d..149bbecfe5 100644
--- a/Ghidra/Framework/Emulation/src/test/java/ghidra/pcode/exec/SleighProgramCompilerTest.java
+++ b/Ghidra/Framework/Emulation/src/test/java/ghidra/pcode/exec/SleighProgramCompilerTest.java
@@ -15,8 +15,7 @@
*/
package ghidra.pcode.exec;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
@@ -79,9 +78,7 @@ public class SleighProgramCompilerTest extends AbstractGTest {
Location loc = entry.loc();
assertEquals("test", loc.filename);
assertEquals(1, loc.lineno);
- assertEquals(
- "unknown start, end, next2, operand, epsilon, or varnode 'noreg' in varnode reference",
- entry.msg());
+ assertEquals("unknown varnode or bitrange symbol 'noreg' in expression", entry.msg());
}
@Test
@@ -97,8 +94,6 @@ public class SleighProgramCompilerTest extends AbstractGTest {
Location loc = entry.loc();
assertEquals("expression", loc.filename);
assertEquals(1, loc.lineno);
- assertEquals(
- "unknown start, end, next2, operand, epsilon, or varnode 'noreg' in varnode reference",
- entry.msg());
+ assertEquals("unknown varnode or bitrange symbol 'noreg' in expression", entry.msg());
}
}