Tests: abort dwarf test on open() failure
[babeltrace.git] / tests / lib / test_dwarf.c
index cee2d4463ebfec36309ac15bcd401dbb45fd54ca..95fd9e117ad8dbcede3282966ff2c87294016e01 100644 (file)
@@ -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);
This page took 0.024501 seconds and 4 git commands to generate.