summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2015-10-29 11:50:40 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2015-10-29 11:50:40 +0800
commite43af08b88c21b2f93423426aa9ab76d06cc6ec1 (patch)
tree185218dcc338f602c1bbfec39c42153f57282194
parent2c1e0f9f23e8cdc63f84cd00710b9e5afe473f9b (diff)
downloadlinaro-android-kernel-test-e43af08b88c21b2f93423426aa9ab76d06cc6ec1.tar.gz
ashmemtest-basic: remove the output of testno
so that the result can be collected by LAVA Change-Id: Icbe7e855eb8854910f44b6e1df24a4118d04a777 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--ashmemtest-basic/ashmemtest.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/ashmemtest-basic/ashmemtest.c b/ashmemtest-basic/ashmemtest.c
index 3958217..082e93f 100644
--- a/ashmemtest-basic/ashmemtest.c
+++ b/ashmemtest-basic/ashmemtest.c
@@ -52,7 +52,6 @@ struct ashmem_pin {
#endif
/* current test run */
-int testno = -1;
char testname[32];
/* device name */
@@ -65,14 +64,13 @@ void fatal (int error, const char *fmt, ...)
{
va_list ap;
- fprintf (stderr, "Test %d: ", testno);
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
if (error)
fprintf (stderr, " (error %d [%s])", error, strerror (error));
va_end (ap);
fprintf (stderr, "\n");
- printf ("%d [%s]: test failed\n", testno, testname);
+ printf ("[%s]: test failed\n", testname);
exit (1);
}
@@ -106,7 +104,6 @@ void ashmem_basic (void)
int fd;
struct stat st;
- testno++;
strcpy(testname, __func__);
/* make sure we can open it */
@@ -123,7 +120,7 @@ void ashmem_basic (void)
/* check that close works too */
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_anonymous_region (void)
@@ -132,7 +129,6 @@ void ashmem_anonymous_region (void)
char name[ASHMEM_NAME_LEN];
size_t size;
- testno++;
strcpy(testname, __func__);
/* test max possible size */
@@ -152,7 +148,7 @@ void ashmem_anonymous_region (void)
fatal (0, "expect %s, but got %s for anonymous region name", ASHMEM_NAME_DEF, name);
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_named_region (void)
@@ -160,7 +156,6 @@ void ashmem_named_region (void)
int fd, ret, i;
char name[ASHMEM_NAME_LEN], name2[ASHMEM_NAME_LEN];
- testno++;
strcpy(testname, __func__);
/* test invalid name pointer */
@@ -181,7 +176,7 @@ void ashmem_named_region (void)
fatal (0, "name mismatch: expect '%s', got '%s'", name, name2);
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_pin_unpin (void)
@@ -191,7 +186,6 @@ void ashmem_pin_unpin (void)
void *mem;
struct ashmem_pin pin;
- testno++;
strcpy(testname, __func__);
/* note the memory is pinned by default */
@@ -267,7 +261,7 @@ void ashmem_pin_unpin (void)
fatal (errno, "can't unmap ashmem region");
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_pin_status (void)
@@ -277,7 +271,6 @@ void ashmem_pin_status (void)
struct ashmem_pin pin;
size_t size = pagesize * 4;
- testno++;
strcpy(testname, __func__);
/* get 4-pages region */
@@ -326,14 +319,13 @@ void ashmem_pin_status (void)
fatal (errno, "can't unmap ashmem region\n");
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_size (void)
{
int fd, ret;
- testno++;
strcpy(testname, __func__);
/* check whether set and get sizes match */
@@ -343,7 +335,7 @@ void ashmem_size (void)
fatal (0, "size mismatch: expect %ld, got %d", pagesize, ret);
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_mmap (void)
@@ -353,7 +345,6 @@ void ashmem_mmap (void)
size_t size = pagesize * 4;
char *pattern = alloca (size);
- testno++;
strcpy(testname, __func__);
/* fill the random pattern */
@@ -395,7 +386,7 @@ void ashmem_mmap (void)
fatal (errno, "should not allow read-write map for write-only region");
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_prot (void)
@@ -403,7 +394,6 @@ void ashmem_prot (void)
void *mem;
int fd, ret;
- testno++;
strcpy(testname, __func__);
/* check whether default protection is read/write/exec */
@@ -468,7 +458,7 @@ void ashmem_prot (void)
fatal (errno, "can't unmap ashmem region");
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
void ashmem_purge (void)
@@ -478,7 +468,6 @@ void ashmem_purge (void)
const int count = 16;
int i, fd, ret, size = pagesize * count;
- testno++;
strcpy(testname, __func__);
/* allocate 16 pages */
@@ -502,14 +491,14 @@ void ashmem_purge (void)
else if (ret < count / 2)
fatal (0, "purge %d pages, but expect %d", ret, count / 2);
else
- printf("%d [%s]: warning: purged more pages (%d) than expected (%d), probably somebody else does the same....",
- testno, __func__, ret, count / 2);
+ printf("[%s]: warning: purged more pages (%d) than expected (%d), probably somebody else does the same....",
+ __func__, ret, count / 2);
}
if (munmap (mem, size))
fatal (errno, "can't unmap ashmem region");
test_close (fd);
- printf ("%d [%s]: test passed\n", testno, __func__);
+ printf ("[%s]: test passed\n", __func__);
}
int main(int argc, char *argv[])