diff options
author | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-05-03 15:55:42 +0000 |
---|---|---|
committer | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-05-03 15:55:42 +0000 |
commit | 7dd7c987a844fbea929b95b514e3f8d06fe7bc47 (patch) | |
tree | a9a1064b1bad0ee150c26b489c0c29343bc3aeb1 /tests | |
parent | 5b2808bfc06279db6a56942f3f6119c23ae07f42 (diff) | |
download | qemu-7dd7c987a844fbea929b95b514e3f8d06fe7bc47.tar.gz qemu-7dd7c987a844fbea929b95b514e3f8d06fe7bc47.tar.bz2 qemu-7dd7c987a844fbea929b95b514e3f8d06fe7bc47.zip |
Correct broken test for fixed file mmaps.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4308 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-mmap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test-mmap.c b/tests/test-mmap.c index 2c435bf038..ced483fddc 100644 --- a/tests/test-mmap.c +++ b/tests/test-mmap.c @@ -377,12 +377,12 @@ void check_file_fixed_eof_mmaps(void) void check_file_fixed_mmaps(void) { - unsigned int *addr; + unsigned char *addr; unsigned int *p1, *p2, *p3, *p4; int i; /* Find a suitable address to start with. */ - addr = mmap(NULL, pagesize * 44 * 3, PROT_READ, + addr = mmap(NULL, pagesize * 40 * 4, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); fprintf (stderr, "%s addr=%p", __func__, (void *)addr); @@ -405,10 +405,10 @@ void check_file_fixed_mmaps(void) /* Make sure we get pages aligned with the pagesize. The target expects this. */ - fail_unless (p1 == addr); - fail_unless (p2 == addr + pagesize); - fail_unless (p3 == addr + pagesize * 2); - fail_unless (p4 == addr + pagesize * 3); + fail_unless (p1 == (void *)addr); + fail_unless (p2 == (void *)addr + pagesize); + fail_unless (p3 == (void *)addr + pagesize * 2); + fail_unless (p4 == (void *)addr + pagesize * 3); /* Verify that the file maps was made correctly. */ fail_unless (*p1 == 0); @@ -425,7 +425,7 @@ void check_file_fixed_mmaps(void) munmap (p2, pagesize); munmap (p3, pagesize); munmap (p4, pagesize); - addr += pagesize * 3; + addr += pagesize * 4; } fprintf (stderr, " passed\n"); } |