diff options
| author | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
| commit | 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b (patch) | |
| tree | 868c52e06f207b5ec8a3cc141f4b8b2bdfcc165c /pintos-progos/tests/vm/pt-grow-stk-sc.c | |
| parent | eae0bd57f0a26314a94785061888d193d186944a (diff) | |
| download | progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.gz progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.bz2 progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.zip | |
reorganize file structure to match the upstream requirements
Diffstat (limited to 'pintos-progos/tests/vm/pt-grow-stk-sc.c')
| -rw-r--r-- | pintos-progos/tests/vm/pt-grow-stk-sc.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/pintos-progos/tests/vm/pt-grow-stk-sc.c b/pintos-progos/tests/vm/pt-grow-stk-sc.c deleted file mode 100644 index 3efbb5f..0000000 --- a/pintos-progos/tests/vm/pt-grow-stk-sc.c +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | /* This test checks that the stack is properly extended even if | ||
| 2 | the first access to a stack location occurs inside a system | ||
| 3 | call. | ||
| 4 | |||
| 5 | From Godmar Back. */ | ||
| 6 | |||
| 7 | #include <string.h> | ||
| 8 | #include <syscall.h> | ||
| 9 | #include "tests/vm/sample.inc" | ||
| 10 | #include "tests/lib.h" | ||
| 11 | #include "tests/main.h" | ||
| 12 | |||
| 13 | void | ||
| 14 | test_main (void) | ||
| 15 | { | ||
| 16 | int handle; | ||
| 17 | int slen = strlen (sample); | ||
| 18 | char buf2[65536]; | ||
| 19 | |||
| 20 | /* Write file via write(). */ | ||
| 21 | CHECK (create ("sample.txt", slen), "create \"sample.txt\""); | ||
| 22 | CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\""); | ||
| 23 | CHECK (write (handle, sample, slen) == slen, "write \"sample.txt\""); | ||
| 24 | close (handle); | ||
| 25 | |||
| 26 | /* Read back via read(). */ | ||
| 27 | CHECK ((handle = open ("sample.txt")) > 1, "2nd open \"sample.txt\""); | ||
| 28 | CHECK (read (handle, buf2 + 32768, slen) == slen, "read \"sample.txt\""); | ||
| 29 | |||
| 30 | CHECK (!memcmp (sample, buf2 + 32768, slen), "compare written data against read data"); | ||
| 31 | close (handle); | ||
| 32 | } | ||
