Commit 7dd7c987a844fbea929b95b514e3f8d06fe7bc47

Authored by edgar_igl
1 parent 5b2808bf

Correct broken test for fixed file mmaps.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4308 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 7 additions and 7 deletions
tests/test-mmap.c
@@ -377,12 +377,12 @@ void check_file_fixed_eof_mmaps(void) @@ -377,12 +377,12 @@ void check_file_fixed_eof_mmaps(void)
377 377
378 void check_file_fixed_mmaps(void) 378 void check_file_fixed_mmaps(void)
379 { 379 {
380 - unsigned int *addr; 380 + unsigned char *addr;
381 unsigned int *p1, *p2, *p3, *p4; 381 unsigned int *p1, *p2, *p3, *p4;
382 int i; 382 int i;
383 383
384 /* Find a suitable address to start with. */ 384 /* Find a suitable address to start with. */
385 - addr = mmap(NULL, pagesize * 44 * 3, PROT_READ, 385 + addr = mmap(NULL, pagesize * 40 * 4, PROT_READ,
386 MAP_PRIVATE | MAP_ANONYMOUS, 386 MAP_PRIVATE | MAP_ANONYMOUS,
387 -1, 0); 387 -1, 0);
388 fprintf (stderr, "%s addr=%p", __func__, (void *)addr); 388 fprintf (stderr, "%s addr=%p", __func__, (void *)addr);
@@ -405,10 +405,10 @@ void check_file_fixed_mmaps(void) @@ -405,10 +405,10 @@ void check_file_fixed_mmaps(void)
405 405
406 /* Make sure we get pages aligned with the pagesize. 406 /* Make sure we get pages aligned with the pagesize.
407 The target expects this. */ 407 The target expects this. */
408 - fail_unless (p1 == addr);  
409 - fail_unless (p2 == addr + pagesize);  
410 - fail_unless (p3 == addr + pagesize * 2);  
411 - fail_unless (p4 == addr + pagesize * 3); 408 + fail_unless (p1 == (void *)addr);
  409 + fail_unless (p2 == (void *)addr + pagesize);
  410 + fail_unless (p3 == (void *)addr + pagesize * 2);
  411 + fail_unless (p4 == (void *)addr + pagesize * 3);
412 412
413 /* Verify that the file maps was made correctly. */ 413 /* Verify that the file maps was made correctly. */
414 fail_unless (*p1 == 0); 414 fail_unless (*p1 == 0);
@@ -425,7 +425,7 @@ void check_file_fixed_mmaps(void) @@ -425,7 +425,7 @@ void check_file_fixed_mmaps(void)
425 munmap (p2, pagesize); 425 munmap (p2, pagesize);
426 munmap (p3, pagesize); 426 munmap (p3, pagesize);
427 munmap (p4, pagesize); 427 munmap (p4, pagesize);
428 - addr += pagesize * 3; 428 + addr += pagesize * 4;
429 } 429 }
430 fprintf (stderr, " passed\n"); 430 fprintf (stderr, " passed\n");
431 } 431 }