From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/vm/child-sort.c | 42 ------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 pintos-progos/tests/vm/child-sort.c (limited to 'pintos-progos/tests/vm/child-sort.c') diff --git a/pintos-progos/tests/vm/child-sort.c b/pintos-progos/tests/vm/child-sort.c deleted file mode 100644 index dff2c77..0000000 --- a/pintos-progos/tests/vm/child-sort.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Reads a 128 kB file into static data and "sorts" the bytes in - it, using counting sort, a single-pass algorithm. The sorted - data is written back to the same file in-place. */ - -#include -#include -#include "tests/lib.h" -#include "tests/main.h" - -const char *test_name = "child-sort"; - -unsigned char buf[128 * 1024]; -size_t histogram[256]; - -int -main (int argc UNUSED, char *argv[]) -{ - int handle; - unsigned char *p; - size_t size; - size_t i; - - quiet = true; - - CHECK ((handle = open (argv[1])) > 1, "open \"%s\"", argv[1]); - - size = read (handle, buf, sizeof buf); - for (i = 0; i < size; i++) - histogram[buf[i]]++; - p = buf; - for (i = 0; i < sizeof histogram / sizeof *histogram; i++) - { - size_t j = histogram[i]; - while (j-- > 0) - *p++ = i; - } - seek (handle, 0); - write (handle, buf, size); - close (handle); - - return 123; -} -- cgit v1.2.3