Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/sys/uvm/mmap Add a few more tests.



details:   https://anonhg.NetBSD.org/src/rev/e6576c10d648
branches:  trunk
changeset: 474467:e6576c10d648
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jul 07 22:00:31 1999 +0000

description:
Add a few more tests.

diffstat:

 regress/sys/uvm/mmap/mmap.c |  42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diffs (56 lines):

diff -r 88d51d0da8b5 -r e6576c10d648 regress/sys/uvm/mmap/mmap.c
--- a/regress/sys/uvm/mmap/mmap.c       Wed Jul 07 21:51:35 1999 +0000
+++ b/regress/sys/uvm/mmap/mmap.c       Wed Jul 07 22:00:31 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mmap.c,v 1.1 1999/06/19 00:53:32 thorpej Exp $ */
+/*     $NetBSD: mmap.c,v 1.2 1999/07/07 22:00:31 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -183,6 +183,46 @@
 
        (void) munlockall();
 
+       printf(">>> MADV_FREE'ING SECOND ANONYMOUS REGION <<<\n");
+
+       if (madvise(addr2, npgs * pgsize, MADV_FREE) == -1)
+               err(1, "madvise");
+
+       printf("    CHECKING RESIDENCY\n");
+
+       if (check_residency(addr2, npgs) != 0) {
+               printf("    RESIDENCY CHECK FAILED!\n");
+               ecode = 1;
+       }
+
+       printf(">>> MADV_FREE'ING FIRST ANONYMOUS REGION <<<\n");
+
+       if (madvise(addr, npgs * pgsize, MADV_FREE) == -1)
+               err(1, "madvise");
+
+       printf("    CHECKING RESIDENCY\n");
+
+       if (check_residency(addr, npgs) != 0) {
+               printf("    RESIDENCY CHECK FAILED!\n");
+               ecode = 1;
+       }
+
+       printf(">>> ZEROING FIRST ANONYMOUS REGION <<<\n");
+
+       memset(addr, 0, npgs * pgsize);
+
+       printf(">>> MADV_FREE'ING FIRST ANYMOUS REGION AGAIN <<<\n");
+
+       if (madvise(addr, npgs * pgsize, MADV_FREE) == -1)
+               err(1, "madvise");
+
+       printf("    CHECKING RESIDENCY\n");
+
+       if (check_residency(addr2, npgs) != 0) {
+               printf("    RESIDENCY CHECK FAILED!\n");
+               ecode = 1;
+       }
+
        exit(ecode);
 }
 



Home | Main Index | Thread Index | Old Index