]> git.proxmox.com Git - qemu.git/blobdiff - tests/test-mmap.c
configure: Copy test data to build directory
[qemu.git] / tests / test-mmap.c
index 1e85ce85080d5bc011894575f9ed6716b8c20b0b..c67174a260397148938c596fcc232eee98e00795 100644 (file)
@@ -19,9 +19,7 @@
  * GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
- *  MA 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdio.h>
@@ -166,6 +164,7 @@ void check_aligned_anonymous_unfixed_colliding_mmaps(void)
                nlen = pagesize * 8;
                p3 = mmap(NULL, nlen, PROT_READ, 
                          MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+               fail_unless (p3 != MAP_FAILED);
 
                /* Check if the mmaped areas collide.  */
                if (p3 < p2 
@@ -176,7 +175,6 @@ void check_aligned_anonymous_unfixed_colliding_mmaps(void)
 
                /* Make sure we get pages aligned with the pagesize. The
                   target expects this.  */
-               fail_unless (p3 != MAP_FAILED);
                p = (uintptr_t) p3;
                fail_unless ((p & pagemask) == 0);
                munmap (p2, pagesize);
@@ -324,7 +322,7 @@ void check_file_unfixed_eof_mmaps(void)
                fail_unless (p1[(test_fsize & pagemask) / sizeof *p1 - 1]
                             == ((test_fsize - sizeof *p1) / sizeof *p1));
 
-               /* Verify that the end of page is accessable and zeroed.  */
+               /* Verify that the end of page is accessible and zeroed.  */
                cp = (void *) p1;
                fail_unless (cp[pagesize - 4] == 0);
                munmap (p1, pagesize);
@@ -367,7 +365,7 @@ void check_file_fixed_eof_mmaps(void)
                fail_unless (p1[(test_fsize & pagemask) / sizeof *p1 - 1]
                             == ((test_fsize - sizeof *p1) / sizeof *p1));
 
-               /* Verify that the end of page is accessable and zeroed.  */
+               /* Verify that the end of page is accessible and zeroed.  */
                cp = (void *)p1;
                fail_unless (cp[pagesize - 4] == 0);
                munmap (p1, pagesize);