From 7343528e5821c69224000ed7cfd3e8aaf47b7a93 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 16 Nov 2012 09:56:52 +0200 Subject: 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 --- tests/ubi-tests/rsvol.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/ubi-tests/rsvol.c') diff --git a/tests/ubi-tests/rsvol.c b/tests/ubi-tests/rsvol.c index 50d6429..60badb0 100644 --- a/tests/ubi-tests/rsvol.c +++ b/tests/ubi-tests/rsvol.c @@ -29,7 +29,8 @@ #include #include #include "libubi.h" -#define TESTNAME "rsvol" +#define PROGRAM_NAME "rsvol" +#include "common.h" #include "helpers.h" static libubi_t libubi; @@ -46,7 +47,7 @@ const char *node; static int test_basic(int type) { struct ubi_mkvol_request req; - const char *name = TESTNAME ":test_basic()"; + const char *name = PROGRAM_NAME ":test_basic()"; req.vol_id = UBI_VOL_NUM_AUTO; req.alignment = 1; @@ -123,13 +124,13 @@ static int test_rsvol1(struct ubi_vol_info *vol_info) } if (vol_info1.rsvd_bytes != bytes) { - errmsg("rsvd_bytes %lld, must be %lld", + errorm("rsvd_bytes %lld, must be %lld", vol_info1.rsvd_bytes, bytes); return -1; } if (vol_info1.rsvd_lebs != vol_info->rsvd_lebs - 1) { - errmsg("rsvd_lebs %d, must be %d", + errorm("rsvd_lebs %d, must be %d", vol_info1.rsvd_lebs, vol_info->rsvd_lebs - 1); return -1; } @@ -141,7 +142,7 @@ static int test_rsvol1(struct ubi_vol_info *vol_info) fd = open(vol_node, O_RDWR); if (fd == -1) { failed("open"); - errmsg("cannot open \"%s\"\n", vol_node); + errorm("cannot open \"%s\"\n", vol_node); return -1; } @@ -176,7 +177,7 @@ static int test_rsvol1(struct ubi_vol_info *vol_info) fd = open(vol_node, O_RDWR); if (fd == -1) { failed("open"); - errmsg("cannot open \"%s\"\n", vol_node); + errorm("cannot open \"%s\"\n", vol_node); return -1; } @@ -194,7 +195,7 @@ static int test_rsvol1(struct ubi_vol_info *vol_info) for (i = 0; i < bytes; i++) { if (buf[i] != (unsigned char)i) { - errmsg("bad data"); + errorm("bad data"); goto close; } } @@ -216,7 +217,7 @@ close: */ static int test_rsvol(int type) { - const char *name = TESTNAME "test_rsvol:()"; + const char *name = PROGRAM_NAME "test_rsvol:()"; int alignments[] = ALIGNMENTS(dev_info.leb_size); char vol_node[strlen(UBI_VOLUME_PATTERN) + 100]; struct ubi_mkvol_request req; @@ -252,7 +253,7 @@ static int test_rsvol(int type) } if (test_rsvol1(&vol_info)) { - errmsg("alignment = %d", req.alignment); + errorm("alignment = %d", req.alignment); goto remove; } -- cgit v1.2.3