mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-30 10:45:37 +08:00
GP-0: Using TaskMonitor.DUMMY instead of deprecated
TaskMonitorAdapter.DUMMY_MONITOR
This commit is contained in:
@@ -37,7 +37,7 @@ import ghidra.program.model.listing.Program;
|
|||||||
import ghidra.program.util.DefaultLanguageService;
|
import ghidra.program.util.DefaultLanguageService;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class FixLangId extends GhidraScript {
|
public class FixLangId extends GhidraScript {
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public class FixLangId extends GhidraScript {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbh.save("Set Language", null, TaskMonitorAdapter.DUMMY_MONITOR);
|
dbh.save("Set Language", null, TaskMonitor.DUMMY);
|
||||||
dbh.close();
|
dbh.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
@@ -14,6 +13,11 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import db.DBConstants;
|
||||||
|
import db.DBHandle;
|
||||||
import ghidra.app.script.GhidraScript;
|
import ghidra.app.script.GhidraScript;
|
||||||
import ghidra.framework.store.db.PackedDatabase;
|
import ghidra.framework.store.db.PackedDatabase;
|
||||||
import ghidra.program.database.ProgramDB;
|
import ghidra.program.database.ProgramDB;
|
||||||
@@ -21,13 +25,7 @@ import ghidra.program.model.lang.LanguageNotFoundException;
|
|||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.exception.VersionException;
|
import ghidra.util.exception.VersionException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import db.DBConstants;
|
|
||||||
import db.DBHandle;
|
|
||||||
|
|
||||||
public class UpgradeTestProgramScript extends GhidraScript {
|
public class UpgradeTestProgramScript extends GhidraScript {
|
||||||
|
|
||||||
@@ -80,7 +78,7 @@ public class UpgradeTestProgramScript extends GhidraScript {
|
|||||||
private boolean upgradeProgramArchive(File gzf) throws IOException, CancelledException,
|
private boolean upgradeProgramArchive(File gzf) throws IOException, CancelledException,
|
||||||
VersionException {
|
VersionException {
|
||||||
|
|
||||||
PackedDatabase db = PackedDatabase.getPackedDatabase(gzf, TaskMonitorAdapter.DUMMY_MONITOR);
|
PackedDatabase db = PackedDatabase.getPackedDatabase(gzf, TaskMonitor.DUMMY);
|
||||||
DBHandle dbh = null;
|
DBHandle dbh = null;
|
||||||
ProgramDB p = null;
|
ProgramDB p = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
+2
-2
@@ -336,7 +336,7 @@ public class FunctionResultStateStackAnalysisCmd extends BackgroundCommand {
|
|||||||
ContextState returnState = results.getContextStates(seq).next();
|
ContextState returnState = results.getContextStates(seq).next();
|
||||||
Varnode varnode =
|
Varnode varnode =
|
||||||
returnState.get(results.getStackPointerVarnode(),
|
returnState.get(results.getStackPointerVarnode(),
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
Varnode zero =
|
Varnode zero =
|
||||||
new Varnode(addrFactory.getConstantSpace().getAddress(0),
|
new Varnode(addrFactory.getConstantSpace().getAddress(0),
|
||||||
stackReg.getMinimumByteSize());
|
stackReg.getMinimumByteSize());
|
||||||
@@ -364,7 +364,7 @@ public class FunctionResultStateStackAnalysisCmd extends BackgroundCommand {
|
|||||||
}
|
}
|
||||||
VarnodeOperation vop = (VarnodeOperation) vn;
|
VarnodeOperation vop = (VarnodeOperation) vn;
|
||||||
return ResultsState.simplify(vop.getPCodeOp(), vop.getInputValues(), addrFactory,
|
return ResultsState.simplify(vop.getPCodeOp(), vop.getInputValues(), addrFactory,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ public abstract class MergeManager implements DomainObjectMergeManager {
|
|||||||
* Convenience method for Junit tests.
|
* Convenience method for Junit tests.
|
||||||
*/
|
*/
|
||||||
public boolean merge() throws CancelledException {
|
public boolean merge() throws CancelledException {
|
||||||
return merge(TaskMonitorAdapter.DUMMY_MONITOR);
|
return merge(TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
-8
@@ -15,15 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.bookmark;
|
package ghidra.app.plugin.core.bookmark;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
import ghidra.framework.model.DomainObject;
|
import ghidra.framework.model.DomainObject;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command to delete some number of bookmarks.
|
* Command to delete some number of bookmarks.
|
||||||
@@ -205,7 +205,7 @@ public class BookmarkDeleteCmd implements Command {
|
|||||||
|
|
||||||
private void deleteBookmarks(BookmarkManager mgr, String theType, String theCategory) {
|
private void deleteBookmarks(BookmarkManager mgr, String theType, String theCategory) {
|
||||||
try {
|
try {
|
||||||
mgr.removeBookmarks(theType, theCategory, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.removeBookmarks(theType, theCategory, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
// can't happen--dummy monitor
|
// can't happen--dummy monitor
|
||||||
@@ -214,7 +214,7 @@ public class BookmarkDeleteCmd implements Command {
|
|||||||
|
|
||||||
private void deleteBookmarks(BookmarkManager mgr, AddressSetView set) {
|
private void deleteBookmarks(BookmarkManager mgr, AddressSetView set) {
|
||||||
try {
|
try {
|
||||||
mgr.removeBookmarks(set, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.removeBookmarks(set, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
// can't happen--dummy monitor
|
// can't happen--dummy monitor
|
||||||
@@ -223,7 +223,7 @@ public class BookmarkDeleteCmd implements Command {
|
|||||||
|
|
||||||
private void deleteBookmarks(BookmarkManager mgr, AddressSetView set, String theType) {
|
private void deleteBookmarks(BookmarkManager mgr, AddressSetView set, String theType) {
|
||||||
try {
|
try {
|
||||||
mgr.removeBookmarks(set, theType, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.removeBookmarks(set, theType, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
// can't happen--dummy monitor
|
// can't happen--dummy monitor
|
||||||
@@ -233,7 +233,7 @@ public class BookmarkDeleteCmd implements Command {
|
|||||||
private void deleteBookmarks(BookmarkManager mgr, AddressSetView set, String theType,
|
private void deleteBookmarks(BookmarkManager mgr, AddressSetView set, String theType,
|
||||||
String theCategory) {
|
String theCategory) {
|
||||||
try {
|
try {
|
||||||
mgr.removeBookmarks(set, theType, theCategory, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.removeBookmarks(set, theType, theCategory, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
// can't happen--dummy monitor
|
// can't happen--dummy monitor
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
|
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program program = (Program) obj;
|
Program program = (Program) obj;
|
||||||
|
|||||||
+1
-1
@@ -244,7 +244,7 @@ public class SelectByFlowPlugin extends Plugin implements OptionsChangeListener
|
|||||||
Program program = context.getProgram();
|
Program program = context.getProgram();
|
||||||
AddressSet selectionAddressSet = null;
|
AddressSet selectionAddressSet = null;
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.setMessage("Computing Selection...");
|
monitor.setMessage("Computing Selection...");
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ public class ClassCategoryNode extends SymbolCategoryNode {
|
|||||||
Namespace parentNamespace = symbol.getParentNamespace();
|
Namespace parentNamespace = symbol.getParentNamespace();
|
||||||
Symbol namespaceSymbol = parentNamespace.getSymbol();
|
Symbol namespaceSymbol = parentNamespace.getSymbol();
|
||||||
SymbolNode key = SymbolNode.createNode(namespaceSymbol, program);
|
SymbolNode key = SymbolNode.createNode(namespaceSymbol, program);
|
||||||
GTreeNode parentNode = findSymbolTreeNode(key, false, TaskMonitorAdapter.DUMMY_MONITOR);
|
GTreeNode parentNode = findSymbolTreeNode(key, false, TaskMonitor.DUMMY);
|
||||||
if (parentNode == null) {
|
if (parentNode == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -173,7 +173,7 @@ public abstract class SymbolCategoryNode extends SymbolTreeNode {
|
|||||||
Namespace parentNamespace = symbol.getParentNamespace();
|
Namespace parentNamespace = symbol.getParentNamespace();
|
||||||
Symbol namespaceSymbol = parentNamespace.getSymbol();
|
Symbol namespaceSymbol = parentNamespace.getSymbol();
|
||||||
SymbolNode key = SymbolNode.createNode(namespaceSymbol, program);
|
SymbolNode key = SymbolNode.createNode(namespaceSymbol, program);
|
||||||
parentNode = findSymbolTreeNode(key, false, TaskMonitorAdapter.DUMMY_MONITOR);
|
parentNode = findSymbolTreeNode(key, false, TaskMonitor.DUMMY);
|
||||||
if (parentNode == null) {
|
if (parentNode == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import ghidra.program.model.data.*;
|
|||||||
import ghidra.util.*;
|
import ghidra.util.*;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.exception.NotYetImplementedException;
|
import ghidra.util.exception.NotYetImplementedException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class to represent the <b><code>IMAGE_NT_HEADERS32</code></b> and
|
* A class to represent the <b><code>IMAGE_NT_HEADERS32</code></b> and
|
||||||
@@ -256,7 +256,7 @@ public class NTHeader implements StructConverter, OffsetValidator {
|
|||||||
fileHeader.processSymbols();
|
fileHeader.processSymbols();
|
||||||
|
|
||||||
if (advancedProcess) {
|
if (advancedProcess) {
|
||||||
optionalHeader.processDataDirectories(TaskMonitorAdapter.DUMMY_MONITOR);
|
optionalHeader.processDataDirectories(TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class OmfLoader extends AbstractProgramWrapperLoader {
|
|||||||
reader.setPointerIndex(0);
|
reader.setPointerIndex(0);
|
||||||
OmfFileHeader scan;
|
OmfFileHeader scan;
|
||||||
try {
|
try {
|
||||||
scan = OmfFileHeader.scan(reader, TaskMonitorAdapter.DUMMY_MONITOR, true);
|
scan = OmfFileHeader.scan(reader, TaskMonitor.DUMMY, true);
|
||||||
}
|
}
|
||||||
catch (OmfException e) {
|
catch (OmfException e) {
|
||||||
throw new IOException("Bad header format: " + e.getMessage());
|
throw new IOException("Bad header format: " + e.getMessage());
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public class FieldHeader extends JTabbedPane implements ChangeListener {
|
|||||||
// try {
|
// try {
|
||||||
// ClassSearcher.setXmlRestoreFile(GenericRunInfo.getUserDataDirPath() +
|
// ClassSearcher.setXmlRestoreFile(GenericRunInfo.getUserDataDirPath() +
|
||||||
// File.separatorChar + "TestClasses.xml");
|
// File.separatorChar + "TestClasses.xml");
|
||||||
// ClassSearcher.search(false, TaskMonitorAdapter.DUMMY_MONITOR);
|
// ClassSearcher.search(false, TaskMonitor.DUMMY);
|
||||||
// }
|
// }
|
||||||
// catch (CancelledException e) {
|
// catch (CancelledException e) {
|
||||||
// // can't happen--dummy monitor
|
// // can't happen--dummy monitor
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ public class GhidraProject {
|
|||||||
throw new DuplicateFileException("File already exists: " + file);
|
throw new DuplicateFileException("File already exists: " + file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
program.saveToPackedFile(file, TaskMonitorAdapter.DUMMY_MONITOR);
|
program.saveToPackedFile(file, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e1) {
|
catch (CancelledException e1) {
|
||||||
throw new IOException("Cancelled");
|
throw new IOException("Cancelled");
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import ghidra.program.model.listing.*;
|
|||||||
import ghidra.program.model.mem.MemoryAccessException;
|
import ghidra.program.model.mem.MemoryAccessException;
|
||||||
import ghidra.program.util.DefaultLanguageService;
|
import ghidra.program.util.DefaultLanguageService;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
import utility.application.ApplicationLayout;
|
import utility.application.ApplicationLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,11 +81,11 @@ public class ProgramExaminer {
|
|||||||
messageLog = new MessageLog();
|
messageLog = new MessageLog();
|
||||||
try {
|
try {
|
||||||
program = AutoImporter.importByUsingBestGuess(provider, null, this, messageLog,
|
program = AutoImporter.importByUsingBestGuess(provider, null, this, messageLog,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
|
|
||||||
if (program == null) {
|
if (program == null) {
|
||||||
program = AutoImporter.importAsBinary(provider, null, defaultLanguage, null, this,
|
program = AutoImporter.importAsBinary(provider, null, defaultLanguage, null, this,
|
||||||
messageLog, TaskMonitorAdapter.DUMMY_MONITOR);
|
messageLog, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
if (program == null) {
|
if (program == null) {
|
||||||
throw new GhidraException(
|
throw new GhidraException(
|
||||||
@@ -172,7 +172,7 @@ public class ProgramExaminer {
|
|||||||
int txID = program.startTransaction("find images");
|
int txID = program.startTransaction("find images");
|
||||||
try {
|
try {
|
||||||
EmbeddedMediaAnalyzer imageAnalyzer = new EmbeddedMediaAnalyzer();
|
EmbeddedMediaAnalyzer imageAnalyzer = new EmbeddedMediaAnalyzer();
|
||||||
imageAnalyzer.added(program, program.getMemory(), TaskMonitorAdapter.DUMMY_MONITOR,
|
imageAnalyzer.added(program, program.getMemory(), TaskMonitor.DUMMY,
|
||||||
messageLog);
|
messageLog);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ public class ProgramMemoryUtil {
|
|||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
|
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Memory memory = program.getMemory();
|
Memory memory = program.getMemory();
|
||||||
@@ -421,7 +421,7 @@ public class ProgramMemoryUtil {
|
|||||||
CodeUnit codeUnit, TaskMonitor monitor) {
|
CodeUnit codeUnit, TaskMonitor monitor) {
|
||||||
|
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddressSet toAddressSet =
|
AddressSet toAddressSet =
|
||||||
@@ -490,7 +490,7 @@ public class ProgramMemoryUtil {
|
|||||||
int alignment, Address toAddress, TaskMonitor monitor) throws CancelledException {
|
int alignment, Address toAddress, TaskMonitor monitor) throws CancelledException {
|
||||||
|
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] addressBytes = getDirectAddressBytes(program, toAddress);
|
byte[] addressBytes = getDirectAddressBytes(program, toAddress);
|
||||||
@@ -634,7 +634,7 @@ public class ProgramMemoryUtil {
|
|||||||
Address toAddress, TaskMonitor monitor) throws CancelledException {
|
Address toAddress, TaskMonitor monitor) throws CancelledException {
|
||||||
|
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Memory memory = program.getMemory();
|
Memory memory = program.getMemory();
|
||||||
|
|||||||
@@ -744,7 +744,7 @@ public class ProgramMerge {
|
|||||||
// Use heavyweight disassembler for delay slotted instruction
|
// Use heavyweight disassembler for delay slotted instruction
|
||||||
AddressSet restrictedSet = new AddressSet(addr);
|
AddressSet restrictedSet = new AddressSet(addr);
|
||||||
Disassembler disassembler =
|
Disassembler disassembler =
|
||||||
Disassembler.getDisassembler(program, TaskMonitorAdapter.DUMMY_MONITOR, null);
|
Disassembler.getDisassembler(program, TaskMonitor.DUMMY, null);
|
||||||
disassembler.disassemble(addr, restrictedSet, false);
|
disassembler.disassemble(addr, restrictedSet, false);
|
||||||
return program.getListing().getInstructionAt(addr);
|
return program.getListing().getInstructionAt(addr);
|
||||||
}
|
}
|
||||||
@@ -3725,7 +3725,7 @@ public class ProgramMerge {
|
|||||||
BookmarkManager bm2 = originProgram.getBookmarkManager();
|
BookmarkManager bm2 = originProgram.getBookmarkManager();
|
||||||
try {
|
try {
|
||||||
bm1.removeBookmarks(new AddressSet(resultAddress, resultAddress),
|
bm1.removeBookmarks(new AddressSet(resultAddress, resultAddress),
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
// DummyAdapter doesn't let cancel occur.
|
// DummyAdapter doesn't let cancel occur.
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ public class ProgramMergeManager {
|
|||||||
AddressSet p1CodeUnitSet = DiffUtility.getCodeUnitSet(p1MergeSet, this.program1);
|
AddressSet p1CodeUnitSet = DiffUtility.getCodeUnitSet(p1MergeSet, this.program1);
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
// Create a "do nothing" task monitor that we can pass along.
|
// Create a "do nothing" task monitor that we can pass along.
|
||||||
monitor = TaskMonitorAdapter.DUMMY_MONITOR;
|
monitor = TaskMonitor.DUMMY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the needed memory addresses are available in the merge program.
|
// Check that the needed memory addresses are available in the merge program.
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ public class ContextState {
|
|||||||
*/
|
*/
|
||||||
public Varnode get(int spaceID, Varnode offsetValue, int size) {
|
public Varnode get(int spaceID, Varnode offsetValue, int size) {
|
||||||
try {
|
try {
|
||||||
return get(spaceID, offsetValue, size, TaskMonitorAdapter.DUMMY_MONITOR);
|
return get(spaceID, offsetValue, size, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
throw new AssertException(e); // unexpected
|
throw new AssertException(e); // unexpected
|
||||||
@@ -585,7 +585,7 @@ public class ContextState {
|
|||||||
*/
|
*/
|
||||||
public Varnode get(Varnode varnode) {
|
public Varnode get(Varnode varnode) {
|
||||||
try {
|
try {
|
||||||
return get(varnode, TaskMonitorAdapter.DUMMY_MONITOR);
|
return get(varnode, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
throw new AssertException(e); // unexpected
|
throw new AssertException(e); // unexpected
|
||||||
|
|||||||
+11
-11
@@ -25,7 +25,7 @@ import ghidra.program.database.ProgramModifierListener;
|
|||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.InvalidNameException;
|
import ghidra.util.InvalidNameException;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the merge data type manager.
|
* Tests for the merge data type manager.
|
||||||
@@ -102,7 +102,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
Structure s =
|
Structure s =
|
||||||
new StructureDataType(miscCat.getCategoryPath(), "My structure", 0);
|
new StructureDataType(miscCat.getCategoryPath(), "My structure", 0);
|
||||||
s.add(new ByteDataType());
|
s.add(new ByteDataType());
|
||||||
@@ -174,7 +174,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(c, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(c, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -531,7 +531,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category miscCat = dtm.getCategory(new CategoryPath("/MISC"));
|
Category miscCat = dtm.getCategory(new CategoryPath("/MISC"));
|
||||||
Category destCat = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category destCat = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -556,7 +556,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -595,7 +595,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category miscCat = dtm.getCategory(new CategoryPath("/MISC"));
|
Category miscCat = dtm.getCategory(new CategoryPath("/MISC"));
|
||||||
Category destCat = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category destCat = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -620,7 +620,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -659,7 +659,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category miscCat = dtm.getCategory(new CategoryPath("/MISC"));
|
Category miscCat = dtm.getCategory(new CategoryPath("/MISC"));
|
||||||
Category destCat = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category destCat = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -684,7 +684,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -732,7 +732,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -777,7 +777,7 @@ public class CategoryMerge1Test extends AbstractDataTypeMergeTest {
|
|||||||
try {
|
try {
|
||||||
dtm.createCategory(path);
|
dtm.createCategory(path);
|
||||||
dtm.getRootCategory().removeCategory("MyCategory",
|
dtm.getRootCategory().removeCategory("MyCategory",
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
|||||||
+22
-22
@@ -25,7 +25,7 @@ import ghidra.program.database.ProgramModifierListener;
|
|||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.InvalidNameException;
|
import ghidra.util.InvalidNameException;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the merge data type manager.
|
* Tests for the merge data type manager.
|
||||||
@@ -57,7 +57,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category3", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category3", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -91,7 +91,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category3", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category3", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -109,7 +109,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category3", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category3", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -141,7 +141,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category4", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category4", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -221,7 +221,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category4", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category4", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -278,7 +278,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category4", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category4", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -312,7 +312,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -334,7 +334,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -373,7 +373,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -395,7 +395,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -432,7 +432,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category destCat =
|
Category destCat =
|
||||||
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
destCat.moveCategory(miscCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
destCat.moveCategory(miscCat, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -454,7 +454,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -514,7 +514,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category2", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category2", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -574,7 +574,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category2", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category2", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -638,7 +638,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("Category1", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("Category1", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -701,7 +701,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("test");
|
int transactionID = program.startTransaction("test");
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1"));
|
||||||
try {
|
try {
|
||||||
c.removeCategory("Category2", TaskMonitorAdapter.DUMMY_MONITOR);
|
c.removeCategory("Category2", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -742,7 +742,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
root.moveCategory(c, TaskMonitorAdapter.DUMMY_MONITOR);
|
root.moveCategory(c, TaskMonitor.DUMMY);
|
||||||
c = root.getCategory(c.getName());
|
c = root.getCategory(c.getName());
|
||||||
c.setName("Other Category3");
|
c.setName("Other Category3");
|
||||||
commit = true;
|
commit = true;
|
||||||
@@ -771,7 +771,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
c.setName("My Category3");
|
c.setName("My Category3");
|
||||||
miscCat.moveCategory(c, TaskMonitorAdapter.DUMMY_MONITOR);
|
miscCat.moveCategory(c, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -821,7 +821,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
root.moveCategory(c, TaskMonitorAdapter.DUMMY_MONITOR);
|
root.moveCategory(c, TaskMonitor.DUMMY);
|
||||||
c = root.getCategory(c.getName());
|
c = root.getCategory(c.getName());
|
||||||
c.setName("Other Category3");
|
c.setName("Other Category3");
|
||||||
commit = true;
|
commit = true;
|
||||||
@@ -850,7 +850,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
c.setName("My Category3");
|
c.setName("My Category3");
|
||||||
miscCat.moveCategory(c, TaskMonitorAdapter.DUMMY_MONITOR);
|
miscCat.moveCategory(c, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -922,7 +922,7 @@ public class CategoryMerge2Test extends AbstractDataTypeMergeTest {
|
|||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
Category c = dtm.getCategory(new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
root.moveCategory(c, TaskMonitorAdapter.DUMMY_MONITOR);
|
root.moveCategory(c, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
|
|||||||
+21
-21
@@ -25,7 +25,7 @@ import ghidra.program.database.ProgramModifierListener;
|
|||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.InvalidNameException;
|
import ghidra.util.InvalidNameException;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test category merge conflicts.
|
* Test category merge conflicts.
|
||||||
@@ -463,7 +463,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DataTypeDependencyException e) {
|
catch (DataTypeDependencyException e) {
|
||||||
@@ -539,7 +539,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DataTypeDependencyException e) {
|
catch (DataTypeDependencyException e) {
|
||||||
@@ -613,7 +613,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DataTypeDependencyException e) {
|
catch (DataTypeDependencyException e) {
|
||||||
@@ -689,7 +689,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DataTypeDependencyException e) {
|
catch (DataTypeDependencyException e) {
|
||||||
@@ -768,7 +768,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
// move Foo to /Category1
|
// move Foo to /Category1
|
||||||
Category c1 = dtm.getCategory(new CategoryPath("/Category1"));
|
Category c1 = dtm.getCategory(new CategoryPath("/Category1"));
|
||||||
c1.moveDataType(foo, DataTypeConflictHandler.DEFAULT_HANDLER);
|
c1.moveDataType(foo, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
@@ -856,7 +856,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
temp.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
// move Foo to /Category1
|
// move Foo to /Category1
|
||||||
Category c1 = dtm.getCategory(new CategoryPath("/Category1"));
|
Category c1 = dtm.getCategory(new CategoryPath("/Category1"));
|
||||||
c1.moveDataType(foo, DataTypeConflictHandler.DEFAULT_HANDLER);
|
c1.moveDataType(foo, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
@@ -915,7 +915,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
newMisc.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
newMisc.moveDataType(dt, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
newMisc.setName("MISC");
|
newMisc.setName("MISC");
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
@@ -993,7 +993,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
DataTypeManager dtm = program.getDataTypeManager();
|
DataTypeManager dtm = program.getDataTypeManager();
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -1094,7 +1094,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
DataTypeManager dtm = program.getDataTypeManager();
|
DataTypeManager dtm = program.getDataTypeManager();
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -1141,7 +1141,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
DataTypeManager dtm = program.getDataTypeManager();
|
DataTypeManager dtm = program.getDataTypeManager();
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -1223,7 +1223,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
DataTypeManager dtm = program.getDataTypeManager();
|
DataTypeManager dtm = program.getDataTypeManager();
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -1319,7 +1319,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
DataTypeManager dtm = program.getDataTypeManager();
|
DataTypeManager dtm = program.getDataTypeManager();
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
try {
|
try {
|
||||||
root.removeCategory("MISC", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("MISC", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -1417,7 +1417,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
Category c2 = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c2 = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
c2.moveCategory(misc, TaskMonitorAdapter.DUMMY_MONITOR);
|
c2.moveCategory(misc, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -1441,7 +1441,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
for (DataType dt : dts) {
|
for (DataType dt : dts) {
|
||||||
misc.remove(dt, TaskMonitorAdapter.DUMMY_MONITOR);
|
misc.remove(dt, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
@@ -1484,7 +1484,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
for (DataType dt : dts) {
|
for (DataType dt : dts) {
|
||||||
misc.remove(dt, TaskMonitorAdapter.DUMMY_MONITOR);
|
misc.remove(dt, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
@@ -1506,7 +1506,7 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
Category c2 = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
Category c2 = dtm.getCategory(new CategoryPath("/Category1/Category2"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
c2.moveCategory(misc, TaskMonitorAdapter.DUMMY_MONITOR);
|
c2.moveCategory(misc, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -1574,10 +1574,10 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
try {
|
try {
|
||||||
Category temp = dtm.createCategory(new CategoryPath("/A_TEMP"));
|
Category temp = dtm.createCategory(new CategoryPath("/A_TEMP"));
|
||||||
for (Category cat : cats) {
|
for (Category cat : cats) {
|
||||||
temp.moveCategory(cat, TaskMonitorAdapter.DUMMY_MONITOR);
|
temp.moveCategory(cat, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("A", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("A", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
@@ -1651,10 +1651,10 @@ public class CategoryMerge4Test extends AbstractDataTypeMergeTest {
|
|||||||
try {
|
try {
|
||||||
Category temp = dtm.createCategory(new CategoryPath("/A_TEMP"));
|
Category temp = dtm.createCategory(new CategoryPath("/A_TEMP"));
|
||||||
for (Category cat : cats) {
|
for (Category cat : cats) {
|
||||||
temp.moveCategory(cat, TaskMonitorAdapter.DUMMY_MONITOR);
|
temp.moveCategory(cat, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
Category root = dtm.getCategory(CategoryPath.ROOT);
|
Category root = dtm.getCategory(CategoryPath.ROOT);
|
||||||
root.removeCategory("A", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("A", TaskMonitor.DUMMY);
|
||||||
temp.setName("MY_A");
|
temp.setName("MY_A");
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-14
@@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.merge.datatypes;
|
package ghidra.app.merge.datatypes;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -26,7 +25,7 @@ import ghidra.program.database.ProgramModifierListener;
|
|||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.InvalidNameException;
|
import ghidra.util.InvalidNameException;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the merge data type manager.
|
* Tests for the merge data type manager.
|
||||||
@@ -59,10 +58,10 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
// new CategoryPath("/Category1/Category2/Category4"));
|
// new CategoryPath("/Category1/Category2/Category4"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("My Misc");
|
miscCat.setName("My Misc");
|
||||||
cat1.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat1.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
DataTypeManager dtm = program.getDataTypeManager();
|
DataTypeManager dtm = program.getDataTypeManager();
|
||||||
dtm.createCategory(new CategoryPath("/newCat"));
|
dtm.createCategory(new CategoryPath("/newCat"));
|
||||||
cat2.removeCategory("Category4", TaskMonitorAdapter.DUMMY_MONITOR);
|
cat2.removeCategory("Category4", TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -91,7 +90,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category4"));
|
new CategoryPath("/Category1/Category2/Category4"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("Some Other Misc");
|
miscCat.setName("Some Other Misc");
|
||||||
cat4.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat4.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -142,7 +141,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category3"));
|
new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("My Misc");
|
miscCat.setName("My Misc");
|
||||||
cat1.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat1.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -171,7 +170,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category4"));
|
new CategoryPath("/Category1/Category2/Category4"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("Some Other Misc");
|
miscCat.setName("Some Other Misc");
|
||||||
cat4.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat4.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -219,7 +218,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category3"));
|
new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("My Misc");
|
miscCat.setName("My Misc");
|
||||||
cat1.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat1.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -248,7 +247,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category4"));
|
new CategoryPath("/Category1/Category2/Category4"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("Some Other Misc");
|
miscCat.setName("Some Other Misc");
|
||||||
cat4.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat4.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -296,7 +295,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category3"));
|
new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("My Misc");
|
miscCat.setName("My Misc");
|
||||||
cat1.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat1.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -325,7 +324,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category4"));
|
new CategoryPath("/Category1/Category2/Category4"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("Some Other Misc");
|
miscCat.setName("Some Other Misc");
|
||||||
cat4.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat4.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -388,7 +387,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category3"));
|
new CategoryPath("/Category1/Category2/Category3"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("My Misc");
|
miscCat.setName("My Misc");
|
||||||
cat1.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat1.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
@@ -417,7 +416,7 @@ public class CategoryMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
new CategoryPath("/Category1/Category2/Category4"));
|
new CategoryPath("/Category1/Category2/Category4"));
|
||||||
try {
|
try {
|
||||||
miscCat.setName("Some Other Misc");
|
miscCat.setName("Some Other Misc");
|
||||||
cat4.moveCategory(cat3, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat4.moveCategory(cat3, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
catch (DuplicateNameException e) {
|
catch (DuplicateNameException e) {
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ import ghidra.framework.main.*;
|
|||||||
import ghidra.program.database.OriginalProgramModifierListener;
|
import ghidra.program.database.OriginalProgramModifierListener;
|
||||||
import ghidra.program.database.ProgramDB;
|
import ghidra.program.database.ProgramDB;
|
||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* More data type merge tests.
|
* More data type merge tests.
|
||||||
@@ -109,7 +109,7 @@ public class DataTypeMerge8Test extends AbstractDataTypeMergeTest {
|
|||||||
transactionID = program.startTransaction("remove XYZ");
|
transactionID = program.startTransaction("remove XYZ");
|
||||||
try {
|
try {
|
||||||
// Remove the XYZ data type.
|
// Remove the XYZ data type.
|
||||||
dtm.remove(xyz, TaskMonitorAdapter.DUMMY_MONITOR);
|
dtm.remove(xyz, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|||||||
+4
-4
@@ -22,7 +22,7 @@ import org.junit.Test;
|
|||||||
import ghidra.program.database.OriginalProgramModifierListener;
|
import ghidra.program.database.OriginalProgramModifierListener;
|
||||||
import ghidra.program.database.ProgramDB;
|
import ghidra.program.database.ProgramDB;
|
||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data type merge tests with fixup for data types added in My program.
|
* Data type merge tests with fixup for data types added in My program.
|
||||||
@@ -85,7 +85,7 @@ public class DataTypeMergeFixupTest extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("delete inner struct");
|
int transactionID = program.startTransaction("delete inner struct");
|
||||||
try {
|
try {
|
||||||
// Remove inner struct
|
// Remove inner struct
|
||||||
dtm.remove(inner, TaskMonitorAdapter.DUMMY_MONITOR);
|
dtm.remove(inner, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -245,7 +245,7 @@ public class DataTypeMergeFixupTest extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("delete inner struct");
|
int transactionID = program.startTransaction("delete inner struct");
|
||||||
try {
|
try {
|
||||||
// Remove inner struct
|
// Remove inner struct
|
||||||
dtm.remove(inner, TaskMonitorAdapter.DUMMY_MONITOR);
|
dtm.remove(inner, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -360,7 +360,7 @@ public class DataTypeMergeFixupTest extends AbstractDataTypeMergeTest {
|
|||||||
int transactionID = program.startTransaction("delete inner struct");
|
int transactionID = program.startTransaction("delete inner struct");
|
||||||
try {
|
try {
|
||||||
// Remove inner struct
|
// Remove inner struct
|
||||||
dtm.remove(inner, TaskMonitorAdapter.DUMMY_MONITOR);
|
dtm.remove(inner, TaskMonitor.DUMMY);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|||||||
+3
-3
@@ -22,7 +22,7 @@ import org.junit.Test;
|
|||||||
import ghidra.program.database.ProgramDB;
|
import ghidra.program.database.ProgramDB;
|
||||||
import ghidra.program.database.ProgramModifierListener;
|
import ghidra.program.database.ProgramModifierListener;
|
||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for merging data types.
|
* Tests for merging data types.
|
||||||
@@ -93,7 +93,7 @@ public class DataTypeMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
intStruct.add(new ByteDataType());// Change data type.
|
intStruct.add(new ByteDataType());// Change data type.
|
||||||
dtm.remove(coolUnion, TaskMonitorAdapter.DUMMY_MONITOR);// Remove the data type.
|
dtm.remove(coolUnion, TaskMonitor.DUMMY);// Remove the data type.
|
||||||
charStruct.add(new FloatDataType());
|
charStruct.add(new FloatDataType());
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ public class DataTypeMergeUseForAllTest extends AbstractDataTypeMergeTest {
|
|||||||
"CharStruct");
|
"CharStruct");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dtm.remove(intStruct, TaskMonitorAdapter.DUMMY_MONITOR);// Remove the data type.
|
dtm.remove(intStruct, TaskMonitor.DUMMY);// Remove the data type.
|
||||||
coolUnion.delete(2);
|
coolUnion.delete(2);
|
||||||
charStruct.add(new CharDataType());
|
charStruct.add(new CharDataType());
|
||||||
commit = true;
|
commit = true;
|
||||||
|
|||||||
+2
-2
@@ -23,7 +23,7 @@ import ghidra.program.database.ProgramDB;
|
|||||||
import ghidra.program.database.ProgramModifierListener;
|
import ghidra.program.database.ProgramModifierListener;
|
||||||
import ghidra.program.model.address.AddressSet;
|
import ghidra.program.model.address.AddressSet;
|
||||||
import ghidra.program.model.data.*;
|
import ghidra.program.model.data.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the merge of the versioned program's code units when bytes
|
* Test the merge of the versioned program's code units when bytes
|
||||||
@@ -1170,7 +1170,7 @@ public class CodeUnitMergeManager4Test extends AbstractListingMergeManagerTest {
|
|||||||
Category cat = dtm.getCategory(catPath);
|
Category cat = dtm.getCategory(catPath);
|
||||||
assertNotNull(cat);
|
assertNotNull(cat);
|
||||||
// Delete category "cat1".
|
// Delete category "cat1".
|
||||||
root.removeCategory("cat1", TaskMonitorAdapter.DUMMY_MONITOR);
|
root.removeCategory("cat1", TaskMonitor.DUMMY);
|
||||||
cat = dtm.getCategory(catPath);
|
cat = dtm.getCategory(catPath);
|
||||||
assertNull(cat);
|
assertNull(cat);
|
||||||
//Add "cat1" category back
|
//Add "cat1" category back
|
||||||
|
|||||||
+39
-39
@@ -31,7 +31,7 @@ import ghidra.program.model.listing.FunctionManager;
|
|||||||
import ghidra.program.model.symbol.SourceType;
|
import ghidra.program.model.symbol.SourceType;
|
||||||
import ghidra.program.util.ProgramDiff;
|
import ghidra.program.util.ProgramDiff;
|
||||||
import ghidra.program.util.ProgramDiffFilter;
|
import ghidra.program.util.ProgramDiffFilter;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the multi-user merge of thunk functions.
|
* Test the multi-user merge of thunk functions.
|
||||||
@@ -171,12 +171,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -231,12 +231,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -332,12 +332,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -437,12 +437,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -524,12 +524,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -610,12 +610,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -697,12 +697,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -785,12 +785,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -899,12 +899,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1013,12 +1013,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1117,12 +1117,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1216,12 +1216,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1315,12 +1315,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1400,7 +1400,7 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1476,7 +1476,7 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1570,12 +1570,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1674,12 +1674,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1784,12 +1784,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
addr(resultProgram, TWO_PARAMS_ENTRY));
|
addr(resultProgram, TWO_PARAMS_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1893,12 +1893,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
addr(resultProgram, TWO_PARAMS_ENTRY));
|
addr(resultProgram, TWO_PARAMS_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1984,12 +1984,12 @@ public class FunctionMergerThunk2Test extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
|
|||||||
+25
-25
@@ -36,7 +36,7 @@ import ghidra.program.model.symbol.ExternalLocation;
|
|||||||
import ghidra.program.model.symbol.SourceType;
|
import ghidra.program.model.symbol.SourceType;
|
||||||
import ghidra.program.util.ProgramDiff;
|
import ghidra.program.util.ProgramDiff;
|
||||||
import ghidra.program.util.ProgramDiffFilter;
|
import ghidra.program.util.ProgramDiffFilter;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the multi-user merge of thunk functions.
|
* Test the multi-user merge of thunk functions.
|
||||||
@@ -122,11 +122,11 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
AddressSet expectedDifferences = new AddressSet();
|
AddressSet expectedDifferences = new AddressSet();
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(latestProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(latestProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,11 +191,11 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
AddressSet expectedDifferences = new AddressSet(entryAddress, entryAddress);
|
AddressSet expectedDifferences = new AddressSet(entryAddress, entryAddress);
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(latestProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(latestProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,12 +338,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -424,12 +424,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -511,12 +511,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -601,12 +601,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -692,12 +692,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
expectedDifferences.add(addr(resultProgram, THUNK_A_ENTRY));
|
expectedDifferences.add(addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -783,12 +783,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
expectedDifferences.add(addr(resultProgram, THUNK_A_ENTRY));
|
expectedDifferences.add(addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1531,12 +1531,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1620,12 +1620,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1714,12 +1714,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
AddressSet expectedDifferences = new AddressSet(addr(resultProgram, THUNK_A_ENTRY));
|
AddressSet expectedDifferences = new AddressSet(addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -1811,12 +1811,12 @@ public class FunctionMergerThunkTest extends AbstractExternalMergerTest {
|
|||||||
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
new AddressSet(addr(resultProgram, THUNK_A_ENTRY), addr(resultProgram, THUNK_A_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
|
|||||||
+9
-9
@@ -31,7 +31,7 @@ import ghidra.program.model.listing.*;
|
|||||||
import ghidra.program.model.symbol.SourceType;
|
import ghidra.program.model.symbol.SourceType;
|
||||||
import ghidra.program.util.ProgramDiff;
|
import ghidra.program.util.ProgramDiff;
|
||||||
import ghidra.program.util.ProgramDiffFilter;
|
import ghidra.program.util.ProgramDiffFilter;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class FunctionMergerUseForAllTest extends AbstractListingMergeManagerTest {
|
public class FunctionMergerUseForAllTest extends AbstractListingMergeManagerTest {
|
||||||
|
|
||||||
@@ -138,12 +138,12 @@ public class FunctionMergerUseForAllTest extends AbstractListingMergeManagerTest
|
|||||||
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -178,12 +178,12 @@ public class FunctionMergerUseForAllTest extends AbstractListingMergeManagerTest
|
|||||||
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -299,12 +299,12 @@ public class FunctionMergerUseForAllTest extends AbstractListingMergeManagerTest
|
|||||||
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
@@ -345,12 +345,12 @@ public class FunctionMergerUseForAllTest extends AbstractListingMergeManagerTest
|
|||||||
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
expectedDifferences.add(addr(resultProgram, THUNK_B_ENTRY));
|
||||||
// Perform the Diff and check the differences.
|
// Perform the Diff and check the differences.
|
||||||
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
ProgramDiff programDiff = new ProgramDiff(resultProgram, myProgram);
|
||||||
AddressSetView differences = programDiff.getDifferences(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSetView differences = programDiff.getDifferences(TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, differences);
|
assertEquals(expectedDifferences, differences);
|
||||||
|
|
||||||
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
ProgramDiffFilter filter = new ProgramDiffFilter(ProgramDiffFilter.FUNCTION_DIFFS);
|
||||||
AddressSetView functionDifferences =
|
AddressSetView functionDifferences =
|
||||||
programDiff.getDifferences(filter, TaskMonitorAdapter.DUMMY_MONITOR);
|
programDiff.getDifferences(filter, TaskMonitor.DUMMY);
|
||||||
assertEquals(expectedDifferences, functionDifferences);
|
assertEquals(expectedDifferences, functionDifferences);
|
||||||
|
|
||||||
executeMerge(ASK_USER);
|
executeMerge(ASK_USER);
|
||||||
|
|||||||
+3
-4
@@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.merge.tree;
|
package ghidra.app.merge.tree;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
|
|
||||||
@@ -25,7 +24,7 @@ import javax.swing.*;
|
|||||||
import ghidra.app.merge.*;
|
import ghidra.app.merge.*;
|
||||||
import ghidra.program.model.listing.ProgramChangeSet;
|
import ghidra.program.model.listing.ProgramChangeSet;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public abstract class AbstractProgramTreeMergeManagerTest extends AbstractMergeTest {
|
public abstract class AbstractProgramTreeMergeManagerTest extends AbstractMergeTest {
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ public abstract class AbstractProgramTreeMergeManagerTest extends AbstractMergeT
|
|||||||
if (option >= 0) {
|
if (option >= 0) {
|
||||||
programTreeMergeManager.setConflictResolution(option);
|
programTreeMergeManager.setConflictResolution(option);
|
||||||
}
|
}
|
||||||
programTreeMergeManager.merge(TaskMonitorAdapter.DUMMY_MONITOR);
|
programTreeMergeManager.merge(TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void merge() throws Exception {
|
protected void merge() throws Exception {
|
||||||
|
|||||||
+4
-4
@@ -134,7 +134,7 @@ public class AutoAnalysisWorkerTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
schedule(mgr, new SetTestPropertyCommand("p1", 500), 10);
|
schedule(mgr, new SetTestPropertyCommand("p1", 500), 10);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mgr.scheduleWorker(worker, null, false, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.scheduleWorker(worker, null, false, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
failWithException("Unexpected exception", e);
|
failWithException("Unexpected exception", e);
|
||||||
@@ -158,7 +158,7 @@ public class AutoAnalysisWorkerTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
schedule(mgr, new SetTestPropertyCommand("p1", 500), 10);
|
schedule(mgr, new SetTestPropertyCommand("p1", 500), 10);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mgr.scheduleWorker(worker, null, true, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.scheduleWorker(worker, null, true, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
failWithException("Unexpected exception", e);
|
failWithException("Unexpected exception", e);
|
||||||
@@ -284,7 +284,7 @@ public class AutoAnalysisWorkerTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
|
|
||||||
Runnable r = () -> {
|
Runnable r = () -> {
|
||||||
try {
|
try {
|
||||||
mgr.scheduleWorker(worker, null, false, TaskMonitorAdapter.DUMMY_MONITOR);
|
mgr.scheduleWorker(worker, null, false, TaskMonitor.DUMMY);
|
||||||
Assert.fail("Expected UnsupportedOperationException");
|
Assert.fail("Expected UnsupportedOperationException");
|
||||||
}
|
}
|
||||||
catch (UnsupportedOperationException e1) {
|
catch (UnsupportedOperationException e1) {
|
||||||
@@ -468,7 +468,7 @@ public class AutoAnalysisWorkerTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager((Program) obj);
|
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager((Program) obj);
|
||||||
try {
|
try {
|
||||||
return mgr.scheduleWorker(worker, null, analyzeChanges,
|
return mgr.scheduleWorker(worker, null, analyzeChanges,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
error = e;
|
error = e;
|
||||||
|
|||||||
+3
-4
@@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.datawindow;
|
package ghidra.app.plugin.core.datawindow;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ import ghidra.framework.plugintool.PluginTool;
|
|||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.listing.Program;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.test.*;
|
import ghidra.test.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class DataWindowPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
public class DataWindowPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
private TestEnv env;
|
private TestEnv env;
|
||||||
@@ -108,7 +107,7 @@ public class DataWindowPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
int id = program.startTransaction(testName.getMethodName());
|
int id = program.startTransaction(testName.getMethodName());
|
||||||
try {
|
try {
|
||||||
program.getListing().clearAll(false, TaskMonitorAdapter.DUMMY_MONITOR);
|
program.getListing().clearAll(false, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
program.endTransaction(id, true);
|
program.endTransaction(id, true);
|
||||||
|
|||||||
+3
-3
@@ -30,7 +30,7 @@ import ghidra.program.util.ProgramSelection;
|
|||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
import ghidra.util.DataConverter;
|
import ghidra.util.DataConverter;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public abstract class AbstractFollowFlowTest extends AbstractGhidraHeadedIntegrationTest {
|
public abstract class AbstractFollowFlowTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public abstract class AbstractFollowFlowTest extends AbstractGhidraHeadedIntegra
|
|||||||
|
|
||||||
AddressSetView getFlowsFrom(AddressSet startSet, FlowType[] excludedFlows) {
|
AddressSetView getFlowsFrom(AddressSet startSet, FlowType[] excludedFlows) {
|
||||||
FollowFlow followFlow = new FollowFlow(program, startSet, excludedFlows);
|
FollowFlow followFlow = new FollowFlow(program, startSet, excludedFlows);
|
||||||
return followFlow.getFlowAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
return followFlow.getFlowAddressSet(TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddressSetView getFlowsTo(int startAddressOffset, FlowType[] excludedFlows) {
|
AddressSetView getFlowsTo(int startAddressOffset, FlowType[] excludedFlows) {
|
||||||
@@ -84,7 +84,7 @@ public abstract class AbstractFollowFlowTest extends AbstractGhidraHeadedIntegra
|
|||||||
|
|
||||||
AddressSetView getFlowsTo(AddressSet startSet, FlowType[] excludedFlows) {
|
AddressSetView getFlowsTo(AddressSet startSet, FlowType[] excludedFlows) {
|
||||||
FollowFlow followFlow = new FollowFlow(program, startSet, excludedFlows);
|
FollowFlow followFlow = new FollowFlow(program, startSet, excludedFlows);
|
||||||
return followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
return followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlowType[] followAllFlows() {
|
FlowType[] followAllFlows() {
|
||||||
|
|||||||
+20
-19
@@ -15,15 +15,16 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.select.flow;
|
package ghidra.app.plugin.core.select.flow;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import org.junit.*;
|
||||||
|
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.address.AddressSet;
|
import ghidra.program.model.address.AddressSet;
|
||||||
import ghidra.program.model.block.FollowFlow;
|
import ghidra.program.model.block.FollowFlow;
|
||||||
import ghidra.program.model.symbol.FlowType;
|
import ghidra.program.model.symbol.FlowType;
|
||||||
import ghidra.test.ToyProgramBuilder;
|
import ghidra.test.ToyProgramBuilder;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
import org.junit.*;
|
|
||||||
|
|
||||||
public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -130,7 +131,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(14), address(17));
|
expectedAddresses.add(address(14), address(17));
|
||||||
@@ -171,7 +172,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -213,7 +214,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(4), address(5));
|
expectedAddresses.add(address(4), address(5));
|
||||||
@@ -255,7 +256,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -292,7 +293,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(13));
|
expectedAddresses.add(address(10), address(13));
|
||||||
@@ -329,7 +330,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -369,7 +370,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -410,7 +411,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -451,7 +452,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(17));
|
expectedAddresses.add(address(10), address(17));
|
||||||
@@ -493,7 +494,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(10), address(15));
|
expectedAddresses.add(address(10), address(15));
|
||||||
@@ -535,7 +536,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FlowType[] flowsNotToFollow = new FlowType[] {};
|
FlowType[] flowsNotToFollow = new FlowType[] {};
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
FollowFlow followFlow = new FollowFlow(program, addressSet, flowsNotToFollow); // FollowAllFlows
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(4), address(5));
|
expectedAddresses.add(address(4), address(5));
|
||||||
@@ -576,7 +577,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
Address addr = address(16);
|
Address addr = address(16);
|
||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, followOnlyPointers());
|
FollowFlow followFlow = new FollowFlow(program, addressSet, followOnlyPointers());
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(16), address(17));
|
expectedAddresses.add(address(16), address(17));
|
||||||
@@ -620,7 +621,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
Address addr = address(16);
|
Address addr = address(16);
|
||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, followAllFlows());
|
FollowFlow followFlow = new FollowFlow(program, addressSet, followAllFlows());
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(4), address(5));
|
expectedAddresses.add(address(4), address(5));
|
||||||
@@ -665,7 +666,7 @@ public class FollowDelaySlotFlowTest extends AbstractFollowFlowTest {
|
|||||||
Address addr = address(16);
|
Address addr = address(16);
|
||||||
AddressSet addressSet = new AddressSet(addr);
|
AddressSet addressSet = new AddressSet(addr);
|
||||||
FollowFlow followFlow = new FollowFlow(program, addressSet, followAllFlows());
|
FollowFlow followFlow = new FollowFlow(program, addressSet, followAllFlows());
|
||||||
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitorAdapter.DUMMY_MONITOR);
|
AddressSet flowAddresses = followFlow.getFlowToAddressSet(TaskMonitor.DUMMY);
|
||||||
|
|
||||||
AddressSet expectedAddresses = new AddressSet();
|
AddressSet expectedAddresses = new AddressSet();
|
||||||
expectedAddresses.add(address(4), address(5));
|
expectedAddresses.add(address(4), address(5));
|
||||||
|
|||||||
+2
-2
@@ -30,7 +30,7 @@ import ghidra.program.model.scalar.Scalar;
|
|||||||
import ghidra.program.model.symbol.*;
|
import ghidra.program.model.symbol.*;
|
||||||
import ghidra.program.util.ProgramLocation;
|
import ghidra.program.util.ProgramLocation;
|
||||||
import ghidra.test.*;
|
import ghidra.test.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class GhidraScriptRealProgramTest extends AbstractGhidraHeadedIntegrationTest {
|
public class GhidraScriptRealProgramTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ public class GhidraScriptRealProgramTest extends AbstractGhidraHeadedIntegration
|
|||||||
// test stub
|
// test stub
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
script.set(state, TaskMonitorAdapter.DUMMY_MONITOR, null);
|
script.set(state, TaskMonitor.DUMMY, null);
|
||||||
return script;
|
return script;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@ import ghidra.framework.protocol.ghidra.GhidraURL;
|
|||||||
import ghidra.program.database.ProgramBuilder;
|
import ghidra.program.database.ProgramBuilder;
|
||||||
import ghidra.program.model.listing.Program;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.test.*;
|
import ghidra.test.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test for creating a new empty tool with the new front end
|
* test for creating a new empty tool with the new front end
|
||||||
@@ -367,7 +367,7 @@ public class CreateDomainObjectTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
|
|
||||||
DomainFolder f = df.createFolder(to);
|
DomainFolder f = df.createFolder(to);
|
||||||
DomainFolder f2 = df.getFolder(from);
|
DomainFolder f2 = df.getFolder(from);
|
||||||
f2.copyTo(f, TaskMonitorAdapter.DUMMY_MONITOR);
|
f2.copyTo(f, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void moveTree(Project proj, String from, String to) throws Exception {
|
private static void moveTree(Project proj, String from, String to) throws Exception {
|
||||||
|
|||||||
+15
-15
@@ -782,7 +782,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testIteratorForComments() throws Exception {
|
public void testIteratorForComments() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
@@ -810,10 +810,10 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testIteratorForCommentType() throws Exception {
|
public void testIteratorForCommentType() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
mem.createInitializedBlock("test2", addr(5000), 100, (byte) 0,
|
mem.createInitializedBlock("test2", addr(5000), 100, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
CodeUnit cu = listing.getCodeUnitAt(addr(i + 10));
|
CodeUnit cu = listing.getCodeUnitAt(addr(i + 10));
|
||||||
@@ -850,7 +850,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testIteratorForCommentsBackwards() throws Exception {
|
public void testIteratorForCommentsBackwards() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
CodeUnit cu = listing.getCodeUnitAt(addr(90));
|
CodeUnit cu = listing.getCodeUnitAt(addr(90));
|
||||||
@@ -891,7 +891,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetPropertyCodeUnitIterator() throws Exception {
|
public void testGetPropertyCodeUnitIterator() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
CodeUnit cu = listing.getCodeUnitAt(addr(i + 10));
|
CodeUnit cu = listing.getCodeUnitAt(addr(i + 10));
|
||||||
@@ -914,7 +914,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetPropertyCuIteratorBackwards() throws Exception {
|
public void testGetPropertyCuIteratorBackwards() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("test", addr(0), 100, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
CodeUnit cu = listing.getCodeUnitAt(addr(i));
|
CodeUnit cu = listing.getCodeUnitAt(addr(i));
|
||||||
@@ -936,7 +936,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetPropertCUIteratorSet() throws Exception {
|
public void testGetPropertCUIteratorSet() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("bk1", addr(0), 200, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("bk1", addr(0), 200, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
// addresses 10-19
|
// addresses 10-19
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
@@ -972,7 +972,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
public void testPropertyCommentIterator() throws Exception {
|
public void testPropertyCommentIterator() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
// mem.createUninitializedBlock("Test", addr(0), 200);
|
// mem.createUninitializedBlock("Test", addr(0), 200);
|
||||||
mem.createInitializedBlock("bk1", addr(0), 200, (byte) 0, TaskMonitorAdapter.DUMMY_MONITOR,
|
mem.createInitializedBlock("bk1", addr(0), 200, (byte) 0, TaskMonitor.DUMMY,
|
||||||
false);
|
false);
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
CodeUnit cu = listing.getCodeUnitAt(addr(i + 10));
|
CodeUnit cu = listing.getCodeUnitAt(addr(i + 10));
|
||||||
@@ -1196,7 +1196,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
public void testGetDataBackwards() throws Exception {
|
public void testGetDataBackwards() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
listing.createData(addr(i), DataType.DEFAULT, 1);
|
listing.createData(addr(i), DataType.DEFAULT, 1);
|
||||||
@@ -1251,7 +1251,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
public void testGetCompositeData() throws Exception {
|
public void testGetCompositeData() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
Structure struct = new StructureDataType("struct_1", 100);
|
Structure struct = new StructureDataType("struct_1", 100);
|
||||||
Structure struct2 = new StructureDataType("struct_2", 0);
|
Structure struct2 = new StructureDataType("struct_2", 0);
|
||||||
@@ -1306,7 +1306,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
public void testGetCompositeDataStartingAt() throws Exception {
|
public void testGetCompositeDataStartingAt() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
Structure struct = new StructureDataType("struct_1", 100);
|
Structure struct = new StructureDataType("struct_1", 100);
|
||||||
Structure struct2 = new StructureDataType("struct_2", 0);
|
Structure struct2 = new StructureDataType("struct_2", 0);
|
||||||
@@ -1360,7 +1360,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
public void testGetCompositeDataInSet() throws Exception {
|
public void testGetCompositeDataInSet() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
Structure struct = new StructureDataType("struct_1", 100);
|
Structure struct = new StructureDataType("struct_1", 100);
|
||||||
Structure struct2 = new StructureDataType("struct_2", 0);
|
Structure struct2 = new StructureDataType("struct_2", 0);
|
||||||
@@ -1418,7 +1418,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
startTransaction();
|
startTransaction();
|
||||||
mem.removeBlock(mem.getBlock(addr(1000)), monitor);
|
mem.removeBlock(mem.getBlock(addr(1000)), monitor);
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
listing.createData(addr(i), new ByteDataType(), 1);
|
listing.createData(addr(i), new ByteDataType(), 1);
|
||||||
@@ -1491,7 +1491,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
startTransaction();
|
startTransaction();
|
||||||
mem.removeBlock(mem.getBlock(addr(1000)), monitor);
|
mem.removeBlock(mem.getBlock(addr(1000)), monitor);
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
listing.createData(addr(i), DataType.DEFAULT, 1);
|
listing.createData(addr(i), DataType.DEFAULT, 1);
|
||||||
@@ -1553,7 +1553,7 @@ public class CodeUnitIteratorTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
public void testGetDefinedDataSetIterator() throws Exception {
|
public void testGetDefinedDataSetIterator() throws Exception {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 1000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
listing.createData(addr(i), new ByteDataType(), 0);
|
listing.createData(addr(i), new ByteDataType(), 0);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import ghidra.program.model.listing.Data;
|
|||||||
import ghidra.program.model.listing.Listing;
|
import ghidra.program.model.listing.Listing;
|
||||||
import ghidra.program.model.mem.Memory;
|
import ghidra.program.model.mem.Memory;
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -117,7 +117,7 @@ public class ArrayTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
listing.getDataAt(addr(0x100));
|
listing.getDataAt(addr(0x100));
|
||||||
CategoryPath path = dt.getCategoryPath();
|
CategoryPath path = dt.getCategoryPath();
|
||||||
assertNotNull(path);
|
assertNotNull(path);
|
||||||
dt.getDataTypeManager().remove(dt, TaskMonitorAdapter.DUMMY_MONITOR);
|
dt.getDataTypeManager().remove(dt, TaskMonitor.DUMMY);
|
||||||
|
|
||||||
assertTrue(array.isDeleted());
|
assertTrue(array.isDeleted());
|
||||||
assertNull(dt.getDataTypeManager().getDataType(path, name));
|
assertNull(dt.getDataTypeManager().getDataType(path, name));
|
||||||
@@ -215,7 +215,7 @@ public class ArrayTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
private void addBlock() throws Exception {
|
private void addBlock() throws Exception {
|
||||||
Memory mem = program.getMemory();
|
Memory mem = program.getMemory();
|
||||||
mem.createInitializedBlock("test", addr(0), 0x1000L, (byte) 0,
|
mem.createInitializedBlock("test", addr(0), 0x1000L, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Address addr(int offset) {
|
private Address addr(int offset) {
|
||||||
|
|||||||
+2
-2
@@ -218,7 +218,7 @@ public class CategoryTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
cat5.addDataType(s2, DataTypeConflictHandler.DEFAULT_HANDLER);
|
cat5.addDataType(s2, DataTypeConflictHandler.DEFAULT_HANDLER);
|
||||||
|
|
||||||
// move c4 to c5
|
// move c4 to c5
|
||||||
cat5.moveCategory(cat4, TaskMonitorAdapter.DUMMY_MONITOR);
|
cat5.moveCategory(cat4, TaskMonitor.DUMMY);
|
||||||
waitForPostedSwingRunnables();
|
waitForPostedSwingRunnables();
|
||||||
|
|
||||||
assertEquals(new CategoryPath("/c1/c2/c5/c4"), cat4.getCategoryPath());
|
assertEquals(new CategoryPath("/c1/c2/c5/c4"), cat4.getCategoryPath());
|
||||||
@@ -243,7 +243,7 @@ public class CategoryTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
Category c1 = root.createCategory("c1");
|
Category c1 = root.createCategory("c1");
|
||||||
Category c2 = c1.createCategory("c2");
|
Category c2 = c1.createCategory("c2");
|
||||||
|
|
||||||
c2.moveCategory(myCat, TaskMonitorAdapter.DUMMY_MONITOR);
|
c2.moveCategory(myCat, TaskMonitor.DUMMY);
|
||||||
|
|
||||||
Category[] cats = c2.getCategories();
|
Category[] cats = c2.getCategories();
|
||||||
assertEquals(1, cats.length);
|
assertEquals(1, cats.length);
|
||||||
|
|||||||
+3
-3
@@ -41,7 +41,7 @@ import ghidra.program.util.ProgramChangeRecord;
|
|||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.exception.InvalidInputException;
|
import ghidra.util.exception.InvalidInputException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -75,7 +75,7 @@ public class FunctionDBTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
transactionID = program.startTransaction("Test");
|
transactionID = program.startTransaction("Test");
|
||||||
program.getMemory()
|
program.getMemory()
|
||||||
.createInitializedBlock("test", addr(100), 500, (byte) 0,
|
.createInitializedBlock("test", addr(100), 500, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
functionManager = program.getFunctionManager();
|
functionManager = program.getFunctionManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1261,7 +1261,7 @@ public class FunctionDBTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
// delete the typedef data type
|
// delete the typedef data type
|
||||||
localTransactionID = program.startTransaction("test");
|
localTransactionID = program.startTransaction("test");
|
||||||
try {
|
try {
|
||||||
program.getDataTypeManager().remove(td, TaskMonitorAdapter.DUMMY_MONITOR);
|
program.getDataTypeManager().remove(td, TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
program.endTransaction(localTransactionID, true);
|
program.endTransaction(localTransactionID, true);
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@ import ghidra.program.model.listing.*;
|
|||||||
import ghidra.program.model.symbol.*;
|
import ghidra.program.model.symbol.*;
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.exception.InvalidInputException;
|
import ghidra.util.exception.InvalidInputException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class FunctionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
public class FunctionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class FunctionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
transactionID = program.startTransaction("Test");
|
transactionID = program.startTransaction("Test");
|
||||||
program.getMemory()
|
program.getMemory()
|
||||||
.createInitializedBlock("temp", addr(0), 10000, (byte) 0,
|
.createInitializedBlock("temp", addr(0), 10000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ import ghidra.program.model.lang.LanguageID;
|
|||||||
import ghidra.program.model.listing.Program;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.mem.Memory;
|
import ghidra.program.model.mem.Memory;
|
||||||
import ghidra.program.model.mem.MemoryConflictException;
|
import ghidra.program.model.mem.MemoryConflictException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class AddressMapDB64BitTest extends AbstractAddressMapDBTestClass {
|
public class AddressMapDB64BitTest extends AbstractAddressMapDBTestClass {
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public class AddressMapDB64BitTest extends AbstractAddressMapDBTestClass {
|
|||||||
// Block3 spans two (2) memory chunks and spans transition between positive and negative offset values
|
// Block3 spans two (2) memory chunks and spans transition between positive and negative offset values
|
||||||
// (base #2(end of block) and #3(start of block) allocated
|
// (base #2(end of block) and #3(start of block) allocated
|
||||||
mem.createInitializedBlock("Block3", space.getAddress(0x7ffffffffff00000L), 0x200000,
|
mem.createInitializedBlock("Block3", space.getAddress(0x7ffffffffff00000L), 0x200000,
|
||||||
(byte) 0, TaskMonitorAdapter.DUMMY_MONITOR, false);
|
(byte) 0, TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -33,7 +33,7 @@ import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
|||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
import ghidra.util.Lock;
|
import ghidra.util.Lock;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class AddressRangeMapDBTest extends AbstractGhidraHeadedIntegrationTest
|
public class AddressRangeMapDBTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
implements ErrorHandler {
|
implements ErrorHandler {
|
||||||
@@ -280,7 +280,7 @@ public class AddressRangeMapDBTest extends AbstractGhidraHeadedIntegrationTest
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
map.moveAddressRange(addr(0x0100000000L), addr(0x0100001000L), 0x1000,
|
map.moveAddressRange(addr(0x0100000000L), addr(0x0100001000L), 0x1000,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
}
|
}
|
||||||
catch (CancelledException e) {
|
catch (CancelledException e) {
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@ import ghidra.program.model.address.AddressSpace;
|
|||||||
import ghidra.program.model.listing.Program;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.mem.*;
|
import ghidra.program.model.mem.*;
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for the BitMemoryBlock for the database implementation.
|
* Test for the BitMemoryBlock for the database implementation.
|
||||||
@@ -60,7 +60,7 @@ public class BitMappedMemoryBlockTest extends AbstractGhidraHeadedIntegrationTes
|
|||||||
transactionID = program.startTransaction("Test");
|
transactionID = program.startTransaction("Test");
|
||||||
|
|
||||||
block = memory.createInitializedBlock("BYTE_BLOCK", byteSpace.getAddress(0), bytes.length,
|
block = memory.createInitializedBlock("BYTE_BLOCK", byteSpace.getAddress(0), bytes.length,
|
||||||
(byte) 0, TaskMonitorAdapter.DUMMY_MONITOR, false);
|
(byte) 0, TaskMonitor.DUMMY, false);
|
||||||
memory.setBytes(block.getStart(), bytes);
|
memory.setBytes(block.getStart(), bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.program.database.module;
|
package ghidra.program.database.module;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ import ghidra.program.model.listing.ProgramModule;
|
|||||||
import ghidra.program.model.mem.Memory;
|
import ghidra.program.model.mem.Memory;
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -82,27 +82,27 @@ public class Fragment20BitTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
Address start = addr("0000:0000");
|
Address start = addr("0000:0000");
|
||||||
mem.createInitializedBlock("stdproc.c", start, 0x5EDA, (byte) 0,
|
mem.createInitializedBlock("stdproc.c", start, 0x5EDA, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
start = addr("05ee:0000");
|
start = addr("05ee:0000");
|
||||||
mem.createInitializedBlock("scada.c", start, 0x5FAA, (byte) 0,
|
mem.createInitializedBlock("scada.c", start, 0x5FAA, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
start = addr("0be9:0000");
|
start = addr("0be9:0000");
|
||||||
mem.createInitializedBlock("cseg03", start, 0x2A6, (byte) 0,
|
mem.createInitializedBlock("cseg03", start, 0x2A6, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
start = addr("0c14:0000");
|
start = addr("0c14:0000");
|
||||||
mem.createInitializedBlock("cseg04", start, 0xF04, (byte) 0,
|
mem.createInitializedBlock("cseg04", start, 0xF04, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
start = addr("0d05:0000");
|
start = addr("0d05:0000");
|
||||||
mem.createInitializedBlock("cseg05", start, 0x3E0, (byte) 0,
|
mem.createInitializedBlock("cseg05", start, 0x3E0, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
start = addr("0d43:0000");
|
start = addr("0d43:0000");
|
||||||
mem.createInitializedBlock("cseg06", start, 0x10E8, (byte) 0,
|
mem.createInitializedBlock("cseg06", start, 0x10E8, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@ import ghidra.program.model.mem.*;
|
|||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.exception.NotFoundException;
|
import ghidra.util.exception.NotFoundException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -460,7 +460,7 @@ public class FragmentTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
try {
|
try {
|
||||||
MemoryBlock block =
|
MemoryBlock block =
|
||||||
memory.createInitializedBlock(name, start, length, (byte) 0,
|
memory.createInitializedBlock(name, start, length, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
return block;
|
return block;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@ import ghidra.program.model.mem.*;
|
|||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
import ghidra.util.exception.*;
|
import ghidra.util.exception.*;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for Module.
|
* Test for Module.
|
||||||
@@ -731,7 +731,7 @@ public class ModuleTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
Address start = addr(offset);
|
Address start = addr(offset);
|
||||||
try {
|
try {
|
||||||
MemoryBlock block = memory.createInitializedBlock(name, start, length, (byte) 0,
|
MemoryBlock block = memory.createInitializedBlock(name, start, length, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
return block;
|
return block;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -30,7 +30,7 @@ import ghidra.program.model.mem.MemoryBlock;
|
|||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
import ghidra.util.exception.DuplicateNameException;
|
import ghidra.util.exception.DuplicateNameException;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the tree manager.
|
* Test the tree manager.
|
||||||
@@ -232,7 +232,7 @@ public class TreeManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
assertEquals(5, r1FragCount);
|
assertEquals(5, r1FragCount);
|
||||||
Address startAddr = b2.getStart();
|
Address startAddr = b2.getStart();
|
||||||
Address endAddr = b2.getEnd();
|
Address endAddr = b2.getEnd();
|
||||||
treeManager.deleteAddressRange(startAddr, endAddr, TaskMonitorAdapter.DUMMY_MONITOR);
|
treeManager.deleteAddressRange(startAddr, endAddr, TaskMonitor.DUMMY);
|
||||||
r1FragCount = root.getChildren().length;
|
r1FragCount = root.getChildren().length;
|
||||||
r2FragCount = r2.getChildren().length;
|
r2FragCount = r2.getChildren().length;
|
||||||
assertEquals(r1FragCount, r2FragCount);
|
assertEquals(r1FragCount, r2FragCount);
|
||||||
@@ -257,7 +257,7 @@ public class TreeManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
// move b2 to 0x2000
|
// move b2 to 0x2000
|
||||||
treeManager.moveAddressRange(b2.getStart(), getAddr(0x2000), b2.getSize(),
|
treeManager.moveAddressRange(b2.getStart(), getAddr(0x2000), b2.getSize(),
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
|
|
||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
root = listing.getRootModule("Test-One");
|
root = listing.getRootModule("Test-One");
|
||||||
@@ -296,7 +296,7 @@ public class TreeManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
// move b1 to 0x5050
|
// move b1 to 0x5050
|
||||||
treeManager.moveAddressRange(b1.getStart(), getAddr(0x5050), b1.getSize(),
|
treeManager.moveAddressRange(b1.getStart(), getAddr(0x5050), b1.getSize(),
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
|
|
||||||
fragB1 = treeManager.getFragment("Test-One", getAddr(0x5050));
|
fragB1 = treeManager.getFragment("Test-One", getAddr(0x5050));
|
||||||
assertNotNull(fragB1);
|
assertNotNull(fragB1);
|
||||||
@@ -319,7 +319,7 @@ public class TreeManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
// move b2 to 0x5600
|
// move b2 to 0x5600
|
||||||
treeManager.moveAddressRange(b2.getStart(), getAddr(0x5600), b2.getSize(),
|
treeManager.moveAddressRange(b2.getStart(), getAddr(0x5600), b2.getSize(),
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
|
|
||||||
fragB2 = treeManager.getFragment("Test-One", getAddr(0x5600));
|
fragB2 = treeManager.getFragment("Test-One", getAddr(0x5600));
|
||||||
assertNotNull(fragB2);
|
assertNotNull(fragB2);
|
||||||
@@ -345,7 +345,7 @@ public class TreeManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
|
|
||||||
// move b1 to 0
|
// move b1 to 0
|
||||||
treeManager.moveAddressRange(b1.getStart(), getAddr(0), b1.getSize(),
|
treeManager.moveAddressRange(b1.getStart(), getAddr(0), b1.getSize(),
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR);
|
TaskMonitor.DUMMY);
|
||||||
|
|
||||||
f2 = program.getListing().getFragment("Test-One", "f2");
|
f2 = program.getListing().getFragment("Test-One", "f2");
|
||||||
assertNotNull(f2);
|
assertNotNull(f2);
|
||||||
@@ -371,7 +371,7 @@ public class TreeManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
Memory memory = program.getMemory();
|
Memory memory = program.getMemory();
|
||||||
Address start = getAddr(offset);
|
Address start = getAddr(offset);
|
||||||
return memory.createInitializedBlock(name, start, length, (byte) 0,
|
return memory.createInitializedBlock(name, start, length, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Address getAddr(long offset) {
|
private Address getAddr(long offset) {
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@ import ghidra.program.model.listing.CodeUnit;
|
|||||||
import ghidra.program.model.listing.Listing;
|
import ghidra.program.model.listing.Listing;
|
||||||
import ghidra.program.model.symbol.*;
|
import ghidra.program.model.symbol.*;
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the reference manager for the database implementation.
|
* Test the reference manager for the database implementation.
|
||||||
@@ -61,7 +61,7 @@ public class ReferenceManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
|||||||
listing = program.getListing();
|
listing = program.getListing();
|
||||||
transactionID = program.startTransaction("Test");
|
transactionID = program.startTransaction("Test");
|
||||||
program.getMemory().createInitializedBlock("code", addr(0), 10000, (byte) 0,
|
program.getMemory().createInitializedBlock("code", addr(0), 10000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ import ghidra.program.model.lang.Register;
|
|||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.symbol.*;
|
import ghidra.program.model.symbol.*;
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.util.task.TaskMonitorAdapter;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
public class RegisterVariableReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
public class RegisterVariableReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public class RegisterVariableReferencesTest extends AbstractGhidraHeadedIntegrat
|
|||||||
functionMgr = program.getFunctionManager();
|
functionMgr = program.getFunctionManager();
|
||||||
transactionID = program.startTransaction("Test");
|
transactionID = program.startTransaction("Test");
|
||||||
program.getMemory().createInitializedBlock("code", addr(0), 10000, (byte) 0,
|
program.getMemory().createInitializedBlock("code", addr(0), 10000, (byte) 0,
|
||||||
TaskMonitorAdapter.DUMMY_MONITOR, false);
|
TaskMonitor.DUMMY, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user