diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-11-16 09:56:52 +0200 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-11-16 10:09:54 +0200 |
commit | 7343528e5821c69224000ed7cfd3e8aaf47b7a93 (patch) | |
tree | 8f283ceefef028996c0ce1b5de9bf5214ed8752c /tests/ubi-tests/volrefcnt.c | |
parent | 98ed9f3360bb5cbfb02d2cb82ee3167fce437772 (diff) |
ubi-tests: switch to using common.h from the top level
Sorry, the commit is huge, I just did not have time to split it.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'tests/ubi-tests/volrefcnt.c')
-rw-r--r-- | tests/ubi-tests/volrefcnt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/ubi-tests/volrefcnt.c b/tests/ubi-tests/volrefcnt.c index 1700ab7..591a55a 100644 --- a/tests/ubi-tests/volrefcnt.c +++ b/tests/ubi-tests/volrefcnt.c @@ -29,7 +29,8 @@ #include <fcntl.h> #include <unistd.h> #include "libubi.h" -#define TESTNAME "rmvol" +#define PROGRAM_NAME "rmvol" +#include "common.h" #include "helpers.h" #define SYSFS_FILE "/sys/class/ubi/ubi%d_%d/usable_eb_size" @@ -76,7 +77,7 @@ int main(int argc, char * const argv[]) sprintf(fname, SYSFS_FILE, dev_info.dev_num, req.vol_id); fd = open(fname, O_RDONLY); if (fd == -1) { - errmsg("cannot open %s", fname); + errorm("cannot open %s", fname); failed("open"); goto out_rmvol; } @@ -91,7 +92,7 @@ int main(int argc, char * const argv[]) /* Try to read from the file, this should fail */ ret = read(fd, tmp, 100); if (ret != -1) { - errmsg("read returned %d, expected -1", ret); + errorm("read returned %d, expected -1", ret); failed("read"); goto out_close; } @@ -100,7 +101,7 @@ int main(int argc, char * const argv[]) close(fd); fd = open(fname, O_RDONLY); if (fd != -1) { - errmsg("opened %s again, open returned %d, expected -1", + errorm("opened %s again, open returned %d, expected -1", fname, fd); failed("open"); goto out_libubi; |