Test fixes

This commit is contained in:
dragonmacher 2025-09-29 10:33:10 -04:00
parent a3b327c411
commit 5c5f577560

View file

@ -129,30 +129,6 @@ public class ToolPluginOptionsTest extends AbstractGhidraHeadedIntegrationTest {
}
}
@Test
public void testOptionsWithoutRegisteredOwnerGoAway() {
//
// Test that an option value that is not set or read will disappear after saving the
// owning tool.
//
Options options = loadSearchOptions();
Pair<String, String> changedOption = changeStringTestOption(options);
//
// See if the options are there again after saving and reloading. They should be there,
// since the previous operation set the value. We are careful here to simply check
// for the options existence, but not to retrieve it, as doing so would trigger the
// option to be stored again.
//
options = saveAndLoadOptions();
verifyStringOptionStillChanged_WithoutUsingOptionsAPI(options, changedOption.first);
options = saveAndLoadOptions();
verifyUnusedOptionNoLongerHasEntry(options, changedOption.first);
}
@Test
public void testSaveOnlyNonDefaultOptions() {
ToolOptions options = loadSearchOptions();
@ -177,6 +153,8 @@ public class ToolPluginOptionsTest extends AbstractGhidraHeadedIntegrationTest {
// Repeatedly save/load options, accessing them each time, and make sure that they
// re-appear each load.
//
// Note: options removal is now controlled through use of an age-off mechanism
//
Options options = loadSearchOptions();
@ -194,11 +172,11 @@ public class ToolPluginOptionsTest extends AbstractGhidraHeadedIntegrationTest {
verifyStringOptionsStillChanged_UsingTheOptionsAPI(options, changedOption);
//
// now save twice in a row without accessing and the untouched option should be gone
// now save twice in a row without accessing and the untouched option should *not* be gone
//
options = saveAndLoadOptions();
options = saveAndLoadOptions();
verifyUnusedOptionNoLongerHasEntry(options, changedOption.first);
verifyStringOptionsStillChanged_UsingTheOptionsAPI(options, changedOption);
}
@Test