Skip to content

Commit

Permalink
Fixed reduced code coverage due to formatting adding lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed Sep 14, 2023
1 parent ab82e2b commit 2427247
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/gotcha.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ long lookup_exported_symbol(const char *name, const struct link_map *lib,
debug_printf(2, "Searching for exported symbols in %s\n", LIB_NAME(lib));
INIT_DYNAMIC(lib);

if (!gnu_hash && !elf_hash) {
if (!gnu_hash && !elf_hash) { // GCOVR_EXCL_START
debug_printf(3, "Library %s does not export or import symbols\n",
LIB_NAME(lib)); // GCOVR_EXCL_START
return -1; // GCOVR_EXCL_START
}
LIB_NAME(lib));
return -1;
} // GCOVR_EXCL_STOP
result = -1;
if (gnu_hash) {
debug_printf(3, "Checking GNU hash for %s in %s\n", name, LIB_NAME(lib));
Expand Down
9 changes: 4 additions & 5 deletions src/gotcha_dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ static struct link_map *gotchas_dlsym_rtld_next_lookup(const char *name,
addrs.found = 0;
void *symbol;
dl_iterate_phdr(lib_header_callback, &addrs);
if (!addrs.found) {
error_printf(
"RTLD_NEXT used in code not dynamically loaded"); // GCOVR_EXCL_LINE
exit(127); // GCOVR_EXCL_LINE
}
if (!addrs.found) { // GCOVR_EXCL_START
error_printf("RTLD_NEXT used in code not dynamically loaded");
exit(127);
} // GCOVR_EXCL_STOP
struct link_map *handle = addrs.lmap->l_next;
while (handle) {
/* lookup symbol on the next-to-next lib which has symbol
Expand Down
15 changes: 6 additions & 9 deletions src/tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,18 @@ binding_t *add_binding_to_tool(tool_t *tool,
newbinding->internal_bindings_size = user_binding_size;
result = create_hashtable(&newbinding->binding_hash, user_binding_size * 2,
(hash_func_t)strhash, (hash_cmp_t)gotcha_strcmp);
if (result != 0) {
error_printf("Could not create hash table for %s\n",
tool->tool_name); // GCOVR_EXCL_LINE
if (result != 0) { // GCOVR_EXCL_START
error_printf("Could not create hash table for %s\n", tool->tool_name);
goto error; // error is a label which frees allocated resources and returns
// NULL GCOVR_EXCL_LINE
}
} // GCOVR_EXCL_STOP

for (i = 0; i < user_binding_size; i++) {
result =
addto_hashtable(&newbinding->binding_hash, (void *)user_binding[i].name,
(void *)(internal_bindings + i));
if (result != 0) {
error_printf(
"Could not add hash entry for %s to table for tool %s\n", // GCOVR_EXCL_START
user_binding[i].name, tool->tool_name);
if (result != 0) { // GCOVR_EXCL_START
error_printf("Could not add hash entry for %s to table for tool %s\n",
user_binding[i].name, tool->tool_name);
goto error; // error is a label which frees allocated resources and
// returns NULL
} // GCOVR_EXCL_STOP
Expand Down

0 comments on commit 2427247

Please sign in to comment.