Skip to content

Commit

Permalink
Use new Symtab Module interface in test_module (#234)
Browse files Browse the repository at this point in the history
* Remove check for fullname

The two names are now the same.

* Use updated findModuleByOffset

* Use Symtab::findModulesByName
  • Loading branch information
hainest authored Oct 5, 2023
1 parent f54c166 commit e897b87
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/symtab/test_module.C
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,18 @@ test_results_t test_module_Mutator::executeTest()
return FAILED;
}

SymtabAPI::Module *test_mod = NULL;
result = symtab->findModuleByName(test_mod, modname);
auto mods_by_name = symtab->findModulesByName(modname);

if (!result || !test_mod)
if (mods_by_name.empty())
{
failure_info << " could not be found by filename " << modname << std::endl;
failure_info << " could not be found by name " << modname << std::endl;
logerror(failure_info.str().c_str());
return FAILED;
}

test_mod = NULL;
result = symtab->findModuleByName(test_mod, modfullname);
auto *test_mod = symtab->findModuleByOffset(offset);

if (!result || !test_mod)
{
failure_info << " could not be found by full name " << modfullname << std::endl;
logerror(failure_info.str().c_str());
return FAILED;
}

test_mod = NULL;
result = symtab->findModuleByOffset(test_mod, offset);

if (!result || !test_mod)
if (!test_mod)
{
failure_info << " could not be found by offset " << offset << std::endl;
failure_info << "Result was " << (result ? "TRUE" : "FALSE") << ", mod was " << std::hex << test_mod << std::dec << std::endl;
Expand Down

0 comments on commit e897b87

Please sign in to comment.