qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4308] Correct broken test for fixed file mmaps.
Date: Sat, 03 May 2008 15:55:43 +0000	[thread overview]
Message-ID: <E1JsK5P-0007RL-IY@cvs.savannah.gnu.org> (raw)

Revision: 4308
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4308
Author:   edgar_igl
Date:     2008-05-03 15:55:42 +0000 (Sat, 03 May 2008)

Log Message:
-----------
Correct broken test for fixed file mmaps.

Modified Paths:
--------------
    trunk/tests/test-mmap.c

Modified: trunk/tests/test-mmap.c
===================================================================
--- trunk/tests/test-mmap.c	2008-05-03 11:06:59 UTC (rev 4307)
+++ trunk/tests/test-mmap.c	2008-05-03 15:55:42 UTC (rev 4308)
@@ -377,12 +377,12 @@
 
 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 @@
 
 		/* 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 @@
 		munmap (p2, pagesize);
 		munmap (p3, pagesize);
 		munmap (p4, pagesize);
-		addr += pagesize * 3;
+		addr += pagesize * 4;
 	}
 	fprintf (stderr, " passed\n");
 }

                 reply	other threads:[~2008-05-03 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JsK5P-0007RL-IY@cvs.savannah.gnu.org \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).