From: Ben Pfaff Date: Sun, 8 Jan 2006 18:02:41 +0000 (+0000) Subject: Add explanatory comments to vm tests. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=843dc0b0675db989ffa0c953ca71b211a57eed9c;p=pintos-anon Add explanatory comments to vm tests. --- diff --git a/src/tests/vm/page-linear.c b/src/tests/vm/page-linear.c index 85aeab6..12375a7 100644 --- a/src/tests/vm/page-linear.c +++ b/src/tests/vm/page-linear.c @@ -1,3 +1,6 @@ +/* Encrypts, then decrypts, 1 MB of memory and verifies that the + values are as they should be. */ + #include #include "tests/arc4.h" #include "tests/lib.h" diff --git a/src/tests/vm/page-merge-par.c b/src/tests/vm/page-merge-par.c index 0c2cc7f..d588bb0 100644 --- a/src/tests/vm/page-merge-par.c +++ b/src/tests/vm/page-merge-par.c @@ -1,3 +1,8 @@ +/* Generates about 1 MB of random data that is then divided into + 16 chunks. A separate subprocess sorts each chunk; the + subprocesses run in parallel. Then we merge the chunks and + verify that the result is what it should be. */ + #include #include #include "tests/arc4.h" diff --git a/src/tests/vm/page-merge-seq.c b/src/tests/vm/page-merge-seq.c index f41de2b..12e3880 100644 --- a/src/tests/vm/page-merge-seq.c +++ b/src/tests/vm/page-merge-seq.c @@ -1,3 +1,8 @@ +/* Generates about 1 MB of random data that is then divided into + 16 chunks. A separate subprocess sorts each chunk in + sequence. Then we merge the chunks and verify that the result + is what it should be. */ + #include #include "tests/arc4.h" #include "tests/lib.h" diff --git a/src/tests/vm/page-parallel.c b/src/tests/vm/page-parallel.c index c7dd829..69ec619 100644 --- a/src/tests/vm/page-parallel.c +++ b/src/tests/vm/page-parallel.c @@ -1,3 +1,5 @@ +/* Runs 3 child-linear processes at once. */ + #include #include "tests/lib.h" #include "tests/main.h" diff --git a/src/tests/vm/page-shuffle.c b/src/tests/vm/page-shuffle.c index c0caa57..095a9da 100644 --- a/src/tests/vm/page-shuffle.c +++ b/src/tests/vm/page-shuffle.c @@ -1,3 +1,6 @@ +/* Shuffles a 128 kB data buffer 10 times, printing the checksum + after each time. */ + #include #include "tests/arc4.h" #include "tests/cksum.h" diff --git a/src/tests/vm/pt-bad-addr.c b/src/tests/vm/pt-bad-addr.c index 0487575..3ca4084 100644 --- a/src/tests/vm/pt-bad-addr.c +++ b/src/tests/vm/pt-bad-addr.c @@ -1,3 +1,6 @@ +/* Accesses a bad address. + The process must be terminated with -1 exit code. */ + #include "tests/lib.h" #include "tests/main.h" diff --git a/src/tests/vm/pt-bad-read.c b/src/tests/vm/pt-bad-read.c index 6b7f008..ee791ff 100644 --- a/src/tests/vm/pt-bad-read.c +++ b/src/tests/vm/pt-bad-read.c @@ -1,3 +1,6 @@ +/* Reads from a file into a bad address. + The process must be terminated with -1 exit code. */ + #include #include "tests/lib.h" #include "tests/main.h" diff --git a/src/tests/vm/pt-big-stk-obj.c b/src/tests/vm/pt-big-stk-obj.c index a417a7e..6b630ec 100644 --- a/src/tests/vm/pt-big-stk-obj.c +++ b/src/tests/vm/pt-big-stk-obj.c @@ -1,3 +1,6 @@ +/* Allocates and writes to a 64 kB object on the stack. + This must succeed. */ + #include #include "tests/arc4.h" #include "tests/cksum.h" diff --git a/src/tests/vm/pt-grow-bad.c b/src/tests/vm/pt-grow-bad.c index d83890f..d4beba2 100644 --- a/src/tests/vm/pt-grow-bad.c +++ b/src/tests/vm/pt-grow-bad.c @@ -1,3 +1,6 @@ +/* Read from an address 4,096 bytes below the stack pointer. + The process must be terminated with -1 exit code. */ + #include #include "tests/arc4.h" #include "tests/cksum.h" @@ -7,7 +10,5 @@ void test_main (void) { - /* Read from an address 4,096 bytes below the stack pointer. - Must kill the program. */ asm volatile ("movl -4096(%esp), %eax"); } diff --git a/src/tests/vm/pt-grow-pusha.c b/src/tests/vm/pt-grow-pusha.c index 7596880..b6b165f 100644 --- a/src/tests/vm/pt-grow-pusha.c +++ b/src/tests/vm/pt-grow-pusha.c @@ -1,3 +1,7 @@ +/* Expand the stack by 32 bytes all at once using the PUSHA + instruction. + This must succeed. */ + #include #include "tests/arc4.h" #include "tests/cksum.h" diff --git a/src/tests/vm/pt-grow-stack.c b/src/tests/vm/pt-grow-stack.c index d9b708a..0997a00 100644 --- a/src/tests/vm/pt-grow-stack.c +++ b/src/tests/vm/pt-grow-stack.c @@ -1,3 +1,6 @@ +/* Demonstrate that the stack can grow. + This must succeed. */ + #include #include "tests/arc4.h" #include "tests/cksum.h" diff --git a/src/tests/vm/pt-write-code-2.c b/src/tests/vm/pt-write-code-2.c index 282667a..83bcc2c 100644 --- a/src/tests/vm/pt-write-code-2.c +++ b/src/tests/vm/pt-write-code-2.c @@ -1,3 +1,6 @@ +/* Try to write to the code segment using a system call. + The process must be terminated with -1 exit code. */ + #include "tests/lib.h" #include "tests/main.h" diff --git a/src/tests/vm/pt-write-code.c b/src/tests/vm/pt-write-code.c index 4c580b5..5072cec 100644 --- a/src/tests/vm/pt-write-code.c +++ b/src/tests/vm/pt-write-code.c @@ -1,3 +1,6 @@ +/* Try to write to the code segment. + The process must be terminated with -1 exit code. */ + #include "tests/lib.h" #include "tests/main.h"