Skip to content

Ghidra is a software reverse engineering (SRE) framework

turn off namespace printing for tests

caheckmandc0fcdf2366f
diff --git a/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerClangTest.java b/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerClangTest.java
index 9f466662ea..4e84a4518c 100644
--- a/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerClangTest.java
+++ b/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerClangTest.java
@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
import javax.swing.JButton;
+import org.junit.Before;
import org.junit.Test;
import docking.action.DockingActionIf;
@@ -37,12 +38,25 @@ import docking.widgets.fieldpanel.support.FieldLocation;
import ghidra.app.cmd.comments.SetCommentCmd;
import ghidra.app.decompiler.ClangLine;
import ghidra.app.decompiler.ClangToken;
+import ghidra.app.decompiler.DecompileOptions.NamespaceStrategy;
import ghidra.app.decompiler.component.*;
import ghidra.app.plugin.core.decompile.actions.*;
+import ghidra.framework.options.ToolOptions;
+import ghidra.framework.plugintool.util.OptionsService;
import ghidra.program.model.listing.CodeUnit;
public class DecompilerClangTest extends AbstractDecompilerTest {
+ @Override
+ @Before
+ public void setUp() throws Exception {
+
+ super.setUp();
+ OptionsService service = provider.getTool().getService(OptionsService.class);
+ ToolOptions opt = service.getOptions("Decompiler");
+ opt.setEnum("Display.Display Namespaces", NamespaceStrategy.Never);
+ }
+
@Override
protected String getProgramName() {
return "ghidra/app/extension/datatype/finder/functions_with_structure_usage.gzf";
diff --git a/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerFindReferencesToNestedStructureActionTest.java b/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerFindReferencesToNestedStructureActionTest.java
index e891ba9b47..5a174baa6c 100644
--- a/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerFindReferencesToNestedStructureActionTest.java
+++ b/Ghidra/Features/Decompiler/src/test.slow/java/ghidra/app/plugin/core/decompile/DecompilerFindReferencesToNestedStructureActionTest.java
@@ -15,8 +15,13 @@
*/
package ghidra.app.plugin.core.decompile;
+import org.junit.Before;
import org.junit.Test;
+import ghidra.app.decompiler.DecompileOptions.NamespaceStrategy;
+import ghidra.framework.options.ToolOptions;
+import ghidra.framework.plugintool.util.OptionsService;
+
/**
* This test is very similar in concept to {@link DecompilerFindReferencesToActionTest},
* except that it uses input test data that has more than one level of dereferencing, such as:
@@ -35,6 +40,16 @@ public class DecompilerFindReferencesToNestedStructureActionTest
return "ghidra/app/extension/datatype/finder/functions_with_structure_usage.gzf";
}
+ @Override
+ @Before
+ public void setUp() throws Exception {
+
+ super.setUp();
+ OptionsService service = provider.getTool().getService(OptionsService.class);
+ ToolOptions opt = service.getOptions("Decompiler");
+ opt.setEnum("Display.Display Namespaces", NamespaceStrategy.Never);
+ }
+
@Test
public void testActionEnablementOnNestedStructureField() throws Exception {