X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=tests%2Flib%2Ftest_dwarf.c;h=90c1441e3fe6929bae72e5833914780707cdad31;hp=cee2d4463ebfec36309ac15bcd401dbb45fd54ca;hb=285fd56cebb6b02bb252bdce247efe3ba01bb2be;hpb=c3a1997ea20bfa7023fa5034530b9bd7965a6561 diff --git a/tests/lib/test_dwarf.c b/tests/lib/test_dwarf.c index cee2d446..90c1441e 100644 --- a/tests/lib/test_dwarf.c +++ b/tests/lib/test_dwarf.c @@ -40,10 +40,13 @@ void test_bt_dwarf(const char *data_dir) struct bt_dwarf_die *die = NULL; Dwarf *dwarf_info = NULL; - snprintf(path, PATH_MAX, "%s/libhello.so", data_dir); + snprintf(path, PATH_MAX, "%s/libhello_so", data_dir); fd = open(path, O_RDONLY); ok(fd >= 0, "Open DWARF file %s", path); + if (fd < 0) { + exit(EXIT_FAILURE); + } dwarf_info = dwarf_begin(fd, DWARF_C_READ); ok(dwarf_info != NULL, "dwarf_begin successful"); cu = bt_dwarf_cu_create(dwarf_info); @@ -52,6 +55,9 @@ void test_bt_dwarf(const char *data_dir) ok(ret == 0, "bt_dwarf_cu_next successful"); die = bt_dwarf_die_create(cu); ok(die != NULL, "bt_dwarf_die_create successful"); + if (!die) { + exit(EXIT_FAILURE); + } /* * Test bt_dwarf_die_next twice, as the code path is different * for DIEs at depth 0 (just created) and other depths. @@ -69,6 +75,10 @@ void test_bt_dwarf(const char *data_dir) /* Reset DIE to test dwarf_child */ bt_dwarf_die_destroy(die); die = bt_dwarf_die_create(cu); + if (!die) { + diag("Failed to create bt_dwarf_die"); + exit(EXIT_FAILURE); + } ret = bt_dwarf_die_child(die); ok(ret == 0, "bt_dwarf_die_child successful");