summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Fagerstedt <axel.fagerstdt@linaro.org>2013-01-15 13:11:39 +0000
committerDmitry Antipov <dmitry.antipov@linaro.org>2013-01-15 18:49:44 +0400
commitb9f6a1cc0bf67c0dd60a006b50232ce25e4c5f93 (patch)
tree4d133ab291ceb64f78c682e048129e691d6441b8
parent88a686779f7d6a20e49e7604696ccf8267dbcd61 (diff)
downloadlinaro-android-kernel-test-b9f6a1cc0bf67c0dd60a006b50232ce25e4c5f93.tar.gz
Add easy to parse error prints
Add failure printouts wit a syntax similar to success printouts to simplify lava parsing.
-rw-r--r--ashmemtest-basic/ashmemtest.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ashmemtest-basic/ashmemtest.c b/ashmemtest-basic/ashmemtest.c
index b95909d..0b20952 100644
--- a/ashmemtest-basic/ashmemtest.c
+++ b/ashmemtest-basic/ashmemtest.c
@@ -40,6 +40,7 @@ struct ashmem_pin {
/* current test run */
int testno = -1;
+char testname[32];
/* device name */
char ashmemdev[64];
@@ -58,6 +59,7 @@ void fatal (int error, const char *fmt, ...)
fprintf (stderr, " (error %d [%s])", error, strerror (error));
va_end (ap);
fprintf (stderr, "\n");
+ printf ("%d [%s]: test failed\n", testno, testname);
exit (1);
}
@@ -92,6 +94,7 @@ void ashmem_basic (void)
struct stat st;
testno++;
+ strcpy(testname, __func__);
/* make sure we can open it */
fd = test_open (ashmemdev, O_RDWR);
@@ -117,6 +120,7 @@ void ashmem_anonymous_region (void)
size_t size;
testno++;
+ strcpy(testname, __func__);
/* test max possible size */
fd = test_open (ashmemdev, O_RDWR);
@@ -144,6 +148,7 @@ void ashmem_named_region (void)
char name[ASHMEM_NAME_LEN], name2[ASHMEM_NAME_LEN];
testno++;
+ strcpy(testname, __func__);
/* test invalid name pointer */
fd = test_open (ashmemdev, O_RDWR);
@@ -174,6 +179,7 @@ void ashmem_pin_unpin (void)
struct ashmem_pin pin;
testno++;
+ strcpy(testname, __func__);
/* note the memory is pinned by default */
@@ -259,6 +265,7 @@ void ashmem_pin_status (void)
size_t size = pagesize * 4;
testno++;
+ strcpy(testname, __func__);
/* get 4-pages region */
fd = test_open_and_set_size (ashmemdev, O_RDWR, size);
@@ -314,6 +321,7 @@ void ashmem_size (void)
int fd, ret;
testno++;
+ strcpy(testname, __func__);
/* check whether set and get sizes match */
fd = test_open_and_set_size (ashmemdev, O_RDWR, pagesize);
@@ -333,6 +341,7 @@ void ashmem_mmap (void)
char *pattern = alloca (size);
testno++;
+ strcpy(testname, __func__);
/* fill the random pattern */
for (i = 0; i < size; i++)
@@ -382,6 +391,7 @@ void ashmem_prot (void)
int fd, ret;
testno++;
+ strcpy(testname, __func__);
/* check whether default protection is read/write/exec */
fd = test_open_and_set_size (ashmemdev, O_RDWR, pagesize);
@@ -455,6 +465,7 @@ void ashmem_purge (void)
int i, fd, ret, size = pagesize * 16;
testno++;
+ strcpy(testname, __func__);
/* allocate 16 pages */
fd = test_open_and_set_size (ashmemdev, O_RDWR, size);