Tests: abort dwarf test on open() failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 Jun 2016 11:17:42 +0000 (07:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 Jun 2016 11:17:42 +0000 (07:17 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/lib/test_dwarf.c

index 61b102ebfe991778238262226a182d6f3f60e4b0..95fd9e117ad8dbcede3282966ff2c87294016e01 100644 (file)
@@ -44,6 +44,9 @@ void test_bt_dwarf(const char *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.024378 seconds and 4 git commands to generate.