code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected ([<<'EOF']);
(priority-donate-sema) begin
(priority-donate-sema) Thread L acquired lock.
(priority-donate-sema) Thread L downed semaphore.
(priority-donate-sema) Thread H acquired lock.
(priority-donate-sema) Thread H finished.
(priority-donate-s... | 10cm | trunk/10cm/pintos/src/tests/threads/priority-donate-sema.ck | Perl | oos | 468 |
/* Checks that when the alarm clock wakes up threads, the
higher-priority threads run first. */
#include <stdio.h>
#include "tests/threads/tests.h"
#include "threads/init.h"
#include "threads/malloc.h"
#include "threads/synch.h"
#include "threads/thread.h"
#include "devices/timer.h"
static thread_func alarm_priori... | 10cm | trunk/10cm/pintos/src/tests/threads/alarm-priority.c | C | oos | 1,468 |
/* The main thread acquires a lock. Then it creates two
higher-priority threads that block acquiring the lock, causing
them to donate their priorities to the main thread. When the
main thread releases the lock, the other threads should
acquire it in priority order.
Based on a test originally submitted... | 10cm | trunk/10cm/pintos/src/tests/threads/priority-donate-one.c | C | oos | 1,944 |
/* The main thread acquires a lock. Then it creates a
higher-priority thread that blocks acquiring the lock, causing
it to donate their priorities to the main thread. The main
thread attempts to lower its priority, which should not take
effect until the donation is released. */
#include <stdio.h>
#includ... | 10cm | trunk/10cm/pintos/src/tests/threads/priority-donate-lower.c | C | oos | 1,521 |
/* Tests timer_sleep(-100). Only requirement is that it not crash. */
#include <stdio.h>
#include "tests/threads/tests.h"
#include "threads/malloc.h"
#include "threads/synch.h"
#include "threads/thread.h"
#include "devices/timer.h"
void
test_alarm_negative (void)
{
timer_sleep (-100);
pass ();
}
| 10cm | trunk/10cm/pintos/src/tests/threads/alarm-negative.c | C | oos | 305 |
# -*- perl -*-
use tests::tests;
use tests::threads::alarm;
check_alarm (7);
| 10cm | trunk/10cm/pintos/src/tests/threads/alarm-multiple.ck | Perl | oos | 77 |
/* Tests that the highest-priority thread waiting on a semaphore
is the first to wake up. */
#include <stdio.h>
#include "tests/threads/tests.h"
#include "threads/init.h"
#include "threads/malloc.h"
#include "threads/synch.h"
#include "threads/thread.h"
#include "devices/timer.h"
static thread_func priority_sema_t... | 10cm | trunk/10cm/pintos/src/tests/threads/priority-sema.c | C | oos | 1,005 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::threads::mlfqs;
our ($test);
my (@output) = read_text_file ("$test.output");
common_checks ("run", @output);
@output = get_core_output ("run", @output);
# Get actual values.
local ($_);
my (@actual);
foreach (@output) {
my ($t, $load_avg) = /A... | 10cm | trunk/10cm/pintos/src/tests/threads/mlfqs-load-60.ck | Perl | oos | 861 |
sub check_alarm {
my ($iterations) = @_;
our ($test);
@output = read_text_file ("$test.output");
common_checks ("run", @output);
my (@products);
for (my ($i) = 0; $i < $iterations; $i++) {
for (my ($t) = 0; $t < 5; $t++) {
push (@products, ($i + 1) * ($t + 1) * 10);
}
}
@product... | 10cm | trunk/10cm/pintos/src/tests/threads/alarm.pm | Raku | oos | 725 |
/* Measures the correctness of the "nice" implementation.
The "fair" tests run either 2 or 20 threads all niced to 0.
The threads should all receive approximately the same number
of ticks. Each test runs for 30 seconds, so the ticks should
also sum to approximately 30 * 100 == 3000 ticks.
The mlfqs-ni... | 10cm | trunk/10cm/pintos/src/tests/threads/mlfqs-fair.c | C | oos | 2,993 |
/* The main thread acquires locks A and B, then it creates three
higher-priority threads. The first two of these threads block
acquiring one of the locks and thus donate their priority to
the main thread. The main thread releases the locks in turn
and relinquishes its donated priorities, allowing the thir... | 10cm | trunk/10cm/pintos/src/tests/threads/priority-donate-multiple2.c | C | oos | 2,520 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::threads::mlfqs;
our ($test);
my (@output) = read_text_file ("$test.output");
common_checks ("run", @output);
@output = get_core_output ("run", @output);
# Get actual values.
local ($_);
my (@actual);
foreach (@output) {
my ($t, $recent_cpu) = /... | 10cm | trunk/10cm/pintos/src/tests/threads/mlfqs-recent-1.ck | Perl | oos | 826 |
# -*- perl -*-
use strict;
use warnings;
sub mlfqs_expected_load {
my ($ready, $recent_delta) = @_;
my (@load_avg) = 0;
my (@recent_cpu) = 0;
my ($load_avg) = 0;
my ($recent_cpu) = 0;
for my $i (0...$#$ready) {
$load_avg = (59/60) * $load_avg + (1/60) * $ready->[$i];
push (@load_avg, $load_av... | 10cm | trunk/10cm/pintos/src/tests/threads/mlfqs.pm | Perl | oos | 3,921 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected ([<<'EOF']);
(alarm-priority) begin
(alarm-priority) Thread priority 30 woke up.
(alarm-priority) Thread priority 29 woke up.
(alarm-priority) Thread priority 28 woke up.
(alarm-priority) Thread priority 27 woke up.
(alarm-priority) Thread priori... | 10cm | trunk/10cm/pintos/src/tests/threads/alarm-priority.ck | Perl | oos | 591 |
#ifndef TESTS_THREADS_TESTS_H
#define TESTS_THREADS_TESTS_H
void run_test (const char *);
typedef void test_func (void);
extern test_func test_alarm_single;
extern test_func test_alarm_multiple;
extern test_func test_alarm_simultaneous;
extern test_func test_alarm_priority;
extern test_func test_alarm_zero;
extern t... | 10cm | trunk/10cm/pintos/src/tests/threads/tests.h | C | oos | 1,308 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::threads::mlfqs;
check_mlfqs_fair ([0, 5], 50);
| 10cm | trunk/10cm/pintos/src/tests/threads/mlfqs-nice-2.ck | Perl | oos | 118 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected ([<<'EOF']);
(priority-donate-multiple2) begin
(priority-donate-multiple2) Main thread should have priority 34. Actual priority: 34.
(priority-donate-multiple2) Main thread should have priority 36. Actual priority: 36.
(priority-donate-multiple... | 10cm | trunk/10cm/pintos/src/tests/threads/priority-donate-multiple2.ck | Perl | oos | 846 |
/* Creates N threads, each of which sleeps a different, fixed
duration, M times. Records the wake-up order and verifies
that it is valid. */
#include <stdio.h>
#include "tests/threads/tests.h"
#include "threads/init.h"
#include "threads/malloc.h"
#include "threads/synch.h"
#include "threads/thread.h"
#include "... | 10cm | trunk/10cm/pintos/src/tests/threads/alarm-wait.c | C | oos | 4,177 |
#include "tests/filesys/seq-test.h"
#include <random.h>
#include <syscall.h>
#include "tests/lib.h"
void
seq_test (const char *file_name, void *buf, size_t size, size_t initial_size,
size_t (*block_size_func) (void),
void (*check_func) (int fd, long ofs))
{
size_t ofs;
int fd;
random_byt... | 10cm | trunk/10cm/pintos/src/tests/filesys/seq-test.c | C | oos | 1,017 |
#ifndef TESTS_FILESYS_SEQ_TEST_H
#define TESTS_FILESYS_SEQ_TEST_H
#include <stddef.h>
void seq_test (const char *file_name,
void *buf, size_t size, size_t initial_size,
size_t (*block_size_func) (void),
void (*check_func) (int fd, long ofs));
#endif /* tests/filesys/seq-t... | 10cm | trunk/10cm/pintos/src/tests/filesys/seq-test.h | C | oos | 329 |
/* -*- c -*- */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
static char buf[TEST_SIZE];
void
test_main (void)
{
const char *file_name = "blargle";
CHECK (create (file_name, TEST_SIZE), "create \"%s\"", file_name);
check_file (file_name, buf, TEST_SIZE);
}
| 10cm | trunk/10cm/pintos/src/tests/filesys/create.inc | C | oos | 290 |
/* Creates 50 files in the root directory. */
#define FILE_CNT 50
#include "tests/filesys/extended/grow-dir.inc"
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-root-lg.c | C | oos | 114 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-tree-persistence.ck | Perl | oos | 85 |
/* Tries to remove a parent of the current directory. This must
fail, because that directory is non-empty. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
CHECK (mkdir ("a"), "mkdir \"a\"");
CHECK (chdir ("a"), "chdir \"a\"");
CHECK (mkdir ("b"), "mkdir \"b\""... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-parent.c | C | oos | 418 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_archive ({"testfile" => [random_bytes (2134)]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-file-size-persistence.ck | Perl | oos | 139 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-over-file) begin
(dir-over-file) mkdir "abc"
(dir-over-file) create "abc" (must return false)
(dir-over-file) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-over-file.ck | Perl | oos | 240 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-empty-name) begin
(dir-empty-name) mkdir "" (must return false)
(dir-empty-name) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-empty-name.ck | Perl | oos | 211 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"testfile" => ["\0" x 76543]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-sparse-persistence.ck | Perl | oos | 113 |
/* Grows a file in chunks while subprocesses read the growing
file. */
#include <random.h>
#include <syscall.h>
#include "tests/filesys/extended/syn-rw.h"
#include "tests/lib.h"
#include "tests/main.h"
char buf[BUF_SIZE];
#define CHILD_CNT 4
void
test_main (void)
{
pid_t children[CHILD_CNT];
size_t ofs;
i... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/syn-rw.c | C | oos | 820 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"a" => ["\0" x 243]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-root-persistence.ck | Perl | oos | 104 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
my ($cwd_removable) = read_text_file ("tests/filesys/extended/can-rmdir-cwd");
$cwd_removable eq 'YES' || $cwd_removable eq 'NO' or die;
check_archive ($cwd_removable eq 'YES' ? {} : {"a" => {}});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-cwd-persistence.ck | Perl | oos | 262 |
/* tar.c
Creates a tar archive. */
#include <ustar.h>
#include <syscall.h>
#include <stdio.h>
#include <string.h>
static void usage (void);
static bool make_tar_archive (const char *archive_name,
char *files[], size_t file_cnt);
int
main (int argc, char *argv[])
{
if (argc < 3)
... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/tar.c | C | oos | 5,512 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-rm-tree) begin
(dir-rm-tree) creating /0/0/0/0 through /3/2/2/3...
(dir-rm-tree) open "/0/2/0/3"
(dir-rm-tree) close "/0/2/0/3"
(dir-rm-tree) removing /0/0/0/0 through /3/2/2/3...
(dir-rm-tree) open "/3/0... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-tree.ck | Perl | oos | 371 |
#ifndef TESTS_FILESYS_EXTENDED_SYN_RW_H
#define TESTS_FILESYS_EXTENDED_SYN_RW_H
#define CHUNK_SIZE 8
#define CHUNK_CNT 512
#define BUF_SIZE (CHUNK_SIZE * CHUNK_CNT)
static const char file_name[] = "logfile";
#endif /* tests/filesys/extended/syn-rw.h */
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/syn-rw.h | C | oos | 255 |
/* Grows two files in parallel and checks that their contents are
correct. */
#include <random.h>
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#define FILE_SIZE 8143
static char buf_a[FILE_SIZE];
static char buf_b[FILE_SIZE];
static void
write_some_bytes (const char *file_name, int fd, cons... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-two-files.c | C | oos | 1,516 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
my ($tree);
for my $a (0...3) {
for my $b (0...2) {
for my $c (0...2) {
for my $d (0...3) {
$tree->{$a}{$b}{$c}{$d} = [''];
}
}
}
}
check_archive ($tree);
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-mk-tree-persistence.ck | Perl | oos | 242 |
/* Tries to create a directory with the same name as an existing
file, which must return failure. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
CHECK (create ("abc", 0), "create \"abc\"");
CHECK (!mkdir ("abc"), "mkdir \"abc\" (must return false)");
}
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-under-file.c | C | oos | 311 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
my ($cwd_removable) = check_expected (IGNORE_EXIT_CODES => 1,
{NO => <<'EOF', YES => <<'EOF'});
(dir-rm-cwd) begin
(dir-rm-cwd) open "/"
(dir-rm-cwd) mkdir "a"
(dir-rm-cwd) open "/a"
(dir-rm-cwd) verify "/a" is empty
(dir-rm-cwd) "/" and "/a" must hav... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-cwd.ck | Perl | oos | 1,590 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-root-lg) begin
(grow-root-lg) creating and checking "file0"
(grow-root-lg) creating and checking "file1"
(grow-root-lg) creating and checking "file2"
(grow-root-lg) creating and checki... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-root-lg.ck | Perl | oos | 2,470 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-dir-lg) begin
(grow-dir-lg) mkdir /x
(grow-dir-lg) creating and checking "/x/file0"
(grow-dir-lg) creating and checking "/x/file1"
(grow-dir-lg) creating and checking "/x/file2"
(grow-... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-dir-lg.ck | Perl | oos | 2,591 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-seq-sm) begin
(grow-seq-sm) create "testme"
(grow-seq-sm) open "testme"
(grow-seq-sm) writing "testme"
(grow-seq-sm) close "testme"
(grow-seq-sm) open "testme" for verification
(grow-s... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-seq-sm.ck | Perl | oos | 414 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"blargle" => ['']});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-create-persistence.ck | Perl | oos | 102 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_archive ({"foobar" => [random_bytes (2134)]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-tell-persistence.ck | Perl | oos | 137 |
/* Creates 20 files in the root directory. */
#define FILE_CNT 20
#include "tests/filesys/extended/grow-dir.inc"
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-root-sm.c | C | oos | 114 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-under-file) begin
(dir-under-file) create "abc"
(dir-under-file) mkdir "abc" (must return false)
(dir-under-file) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-under-file.ck | Perl | oos | 244 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
my ($fs);
$fs->{'x'}{"file$_"} = [random_bytes (512)] foreach 0...49;
check_archive ($fs);
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-dir-lg-persistence.ck | Perl | oos | 175 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"abc" => ['']});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-under-file-persistence.ck | Perl | oos | 98 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
# The archive should look like this:
#
# 40642 dir-vine
# 42479 tar
# 0 start
# 11 start/file0
# 0 start/dir0
# 11 start/dir0/file1
# 0 start/dir0/dir1
# 11 start/dir0/dir1/file2
# 0 start/dir0/dir1/dir2
# 11 start/dir0/dir1/dir2/fil... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-vine-persistence.ck | Perl | oos | 1,170 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-mk-tree) begin
(dir-mk-tree) creating /0/0/0/0 through /3/2/2/3...
(dir-mk-tree) open "/0/2/0/3"
(dir-mk-tree) close "/0/2/0/3"
(dir-mk-tree) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-mk-tree.ck | Perl | oos | 272 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"xyzzy" => {}});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-open-persistence.ck | Perl | oos | 98 |
/* Creates directories /0/0/0 through /3/2/2 and creates files in
the leaf directories. */
#include "tests/filesys/extended/mk-tree.h"
#include "tests/main.h"
void
test_main (void)
{
make_tree (4, 3, 3, 4);
}
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-mk-tree.c | C | oos | 218 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-rm-parent) begin
(dir-rm-parent) mkdir "a"
(dir-rm-parent) chdir "a"
(dir-rm-parent) mkdir "b"
(dir-rm-parent) chdir "b"
(dir-rm-parent) remove "/a" (must fail)
(dir-rm-parent) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-parent.ck | Perl | oos | 307 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-vine) begin
(dir-vine) creating many levels of files and directories...
(dir-vine) removing all but top 10 levels of files and directories...
(dir-vine) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-vine.ck | Perl | oos | 283 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"abc" => {}});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-over-file-persistence.ck | Perl | oos | 96 |
/* Tests that seeking past the end of a file and writing will
properly zero out the region in between. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
static char buf[76543];
void
test_main (void)
{
const char *file_name = "testfile";
char zero = 0;
int fd;
CHECK (create (file_n... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-sparse.c | C | oos | 643 |
/* Create a very deep "vine" of directories: /dir0/dir1/dir2/...
and an ordinary file in each of them, until we fill up the
disk.
Then delete most of them, for two reasons. First, "tar"
limits file names to 100 characters (which could be extended
to 256 without much trouble). Second, a full disk ha... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-vine.c | C | oos | 2,774 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
my ($a) = random_bytes (8143);
my ($b) = random_bytes (8143);
check_archive ({"a" => [$a], "b" => [$b]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-two-files-persistence.ck | Perl | oos | 190 |
#ifndef TESTS_FILESYS_EXTENDED_MK_TREE_H
#define TESTS_FILESYS_EXTENDED_MK_TREE_H
void make_tree (int at, int bt, int ct, int dt);
#endif /* tests/filesys/extended/mk-tree.h */
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/mk-tree.h | C | oos | 179 |
/* Grows a file from 0 bytes to 72,943 bytes, 1,234 bytes at a
time. */
#define TEST_SIZE 72943
#include "tests/filesys/extended/grow-seq.inc"
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-seq-lg.c | C | oos | 147 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rmdir-persistence.ck | Perl | oos | 85 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-two-files) begin
(grow-two-files) create "a"
(grow-two-files) create "b"
(grow-two-files) open "a"
(grow-two-files) open "b"
(grow-two-files) write "a" and "b" alternately
(grow-two-fi... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-two-files.ck | Perl | oos | 617 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-root-sm) begin
(grow-root-sm) creating and checking "file0"
(grow-root-sm) creating and checking "file1"
(grow-root-sm) creating and checking "file2"
(grow-root-sm) creating and checki... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-root-sm.ck | Perl | oos | 1,090 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-create) begin
(grow-create) create "blargle"
(grow-create) open "blargle" for verification
(grow-create) verified contents of "blargle"
(grow-create) close "blargle"
(grow-create) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-create.ck | Perl | oos | 311 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-seq-lg) begin
(grow-seq-lg) create "testme"
(grow-seq-lg) open "testme"
(grow-seq-lg) writing "testme"
(grow-seq-lg) close "testme"
(grow-seq-lg) open "testme" for verification
(grow-s... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-seq-lg.ck | Perl | oos | 414 |
/* Create a file of size 0. */
#define TEST_SIZE 0
#include "tests/filesys/create.inc"
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-create.c | C | oos | 88 |
/* Creates a directory,
then creates 50 files in that directory. */
#define FILE_CNT 50
#define DIRECTORY "/x"
#include "tests/filesys/extended/grow-dir.inc"
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-dir-lg.c | C | oos | 162 |
/* Tries to remove the current directory, which may succeed or
fail. The requirements in each case are different; refer to
the assignment for details. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
static int
wrap_open (const char *name)
{
static int fds[8], fd_cnt;
int fd, i;
C... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-cwd.c | C | oos | 2,169 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_archive ({"testme" => [random_bytes (72943)]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-seq-lg-persistence.ck | Perl | oos | 138 |
/* Creates directories /0/0/0 through /3/2/2 and files in the
leaf directories, then removes them. */
#include <stdarg.h>
#include <stdio.h>
#include <syscall.h>
#include "tests/filesys/extended/mk-tree.h"
#include "tests/lib.h"
#include "tests/main.h"
static void remove_tree (int at, int bt, int ct, int dt);
voi... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-rm-tree.c | C | oos | 1,423 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-mkdir) begin
(dir-mkdir) mkdir "a"
(dir-mkdir) create "a/b"
(dir-mkdir) chdir "a"
(dir-mkdir) open "b"
(dir-mkdir) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-mkdir.ck | Perl | oos | 245 |
/* Tries to create a directory named as the empty string,
which must return failure. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
CHECK (!mkdir (""), "mkdir \"\" (must return false)");
}
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/dir-empty-name.c | C | oos | 245 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-sparse) begin
(grow-sparse) create "testfile"
(grow-sparse) open "testfile"
(grow-sparse) seek "testfile"
(grow-sparse) write "testfile"
(grow-sparse) close "testfile"
(grow-sparse) open "testfile" for v... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/grow-sparse.ck | Perl | oos | 437 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-vine) begin
(dir-vine) creating many levels of files and directories...
(dir-vine) removing all but top 10 levels of files and directories...
(dir-vine) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-vine.ck.svn-base | Perl | oos | 283 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-file-size) begin
(grow-file-size) create "testfile"
(grow-file-size) open "testfile"
(grow-file-size) writing "testfile"
(grow-file-size) close "testfile"
(grow-file-size) open "testfi... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-file-size.ck.svn-base | Perl | oos | 455 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-rm-tree-persistence.ck.svn-base | Perl | oos | 85 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-seq-lg) begin
(grow-seq-lg) create "testme"
(grow-seq-lg) open "testme"
(grow-seq-lg) writing "testme"
(grow-seq-lg) close "testme"
(grow-seq-lg) open "testme" for verification
(grow-s... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-seq-lg.ck.svn-base | Perl | oos | 414 |
# -*- makefile -*-
raw_tests = dir-empty-name dir-mk-tree dir-mkdir dir-open \
dir-over-file dir-rm-cwd dir-rm-parent dir-rm-root dir-rm-tree \
dir-rmdir dir-under-file dir-vine grow-create grow-dir-lg \
grow-file-size grow-root-lg grow-root-sm grow-seq-lg grow-seq-sm \
grow-sparse grow-tell grow-two-files syn-rw
... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/Make.tests.svn-base | Makefile | oos | 2,359 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({'a' => {'b' => ["\0" x 512]}});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-mkdir-persistence.ck.svn-base | Perl | oos | 113 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
my ($tree);
for my $a (0...3) {
for my $b (0...2) {
for my $c (0...2) {
for my $d (0...3) {
$tree->{$a}{$b}{$c}{$d} = [''];
}
}
}
}
check_archive ($tree);
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-mk-tree-persistence.ck.svn-base | Perl | oos | 242 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
my ($fs);
$fs->{'x'}{"file$_"} = [random_bytes (512)] foreach 0...49;
check_archive ($fs);
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-dir-lg-persistence.ck.svn-base | Perl | oos | 175 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-rmdir) begin
(dir-rmdir) mkdir "a"
(dir-rmdir) rmdir "a"
(dir-rmdir) chdir "a" (must return false)
(dir-rmdir) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-rmdir.ck.svn-base | Perl | oos | 241 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
# The archive should look like this:
#
# 40642 dir-vine
# 42479 tar
# 0 start
# 11 start/file0
# 0 start/dir0
# 11 start/dir0/file1
# 0 start/dir0/dir1
# 11 start/dir0/dir1/file2
# 0 start/dir0/dir1/dir2
# 11 start/dir0/dir1/dir2/fil... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-vine-persistence.ck.svn-base | Perl | oos | 1,170 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_archive ({"testme" => [random_bytes (5678)]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-seq-sm-persistence.ck.svn-base | Perl | oos | 137 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-seq-sm) begin
(grow-seq-sm) create "testme"
(grow-seq-sm) open "testme"
(grow-seq-sm) writing "testme"
(grow-seq-sm) close "testme"
(grow-seq-sm) open "testme" for verification
(grow-s... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-seq-sm.ck.svn-base | Perl | oos | 414 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-empty-name-persistence.ck.svn-base | Perl | oos | 85 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-over-file) begin
(dir-over-file) mkdir "abc"
(dir-over-file) create "abc" (must return false)
(dir-over-file) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-over-file.ck.svn-base | Perl | oos | 240 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
my ($cwd_removable) = read_text_file ("tests/filesys/extended/can-rmdir-cwd");
$cwd_removable eq 'YES' || $cwd_removable eq 'NO' or die;
check_archive ($cwd_removable eq 'YES' ? {} : {"a" => {}});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-rm-cwd-persistence.ck.svn-base | Perl | oos | 262 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-empty-name) begin
(dir-empty-name) mkdir "" (must return false)
(dir-empty-name) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-empty-name.ck.svn-base | Perl | oos | 211 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_archive ({"foobar" => [random_bytes (2134)]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-tell-persistence.ck.svn-base | Perl | oos | 137 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-dir-lg) begin
(grow-dir-lg) mkdir /x
(grow-dir-lg) creating and checking "/x/file0"
(grow-dir-lg) creating and checking "/x/file1"
(grow-dir-lg) creating and checking "/x/file2"
(grow-... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-dir-lg.ck.svn-base | Perl | oos | 2,591 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-rmdir-persistence.ck.svn-base | Perl | oos | 85 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-root-lg) begin
(grow-root-lg) creating and checking "file0"
(grow-root-lg) creating and checking "file1"
(grow-root-lg) creating and checking "file2"
(grow-root-lg) creating and checki... | 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-root-lg.ck.svn-base | Perl | oos | 2,470 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"testfile" => ["\0" x 76543]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-sparse-persistence.ck.svn-base | Perl | oos | 113 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"abc" => ['']});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-under-file-persistence.ck.svn-base | Perl | oos | 98 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
my ($a) = random_bytes (8143);
my ($b) = random_bytes (8143);
check_archive ({"a" => [$a], "b" => [$b]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-two-files-persistence.ck.svn-base | Perl | oos | 190 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(dir-rm-parent) begin
(dir-rm-parent) mkdir "a"
(dir-rm-parent) chdir "a"
(dir-rm-parent) mkdir "b"
(dir-rm-parent) chdir "b"
(dir-rm-parent) remove "/a" (must fail)
(dir-rm-parent) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-rm-parent.ck.svn-base | Perl | oos | 307 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
(grow-create) begin
(grow-create) create "blargle"
(grow-create) open "blargle" for verification
(grow-create) verified contents of "blargle"
(grow-create) close "blargle"
(grow-create) end
EOF
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-create.ck.svn-base | Perl | oos | 311 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
my ($fs);
$fs->{"file$_"} = [random_bytes (512)] foreach 0...19;
check_archive ($fs);
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-root-sm-persistence.ck.svn-base | Perl | oos | 170 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
use tests::random;
check_archive ({"testfile" => [random_bytes (2134)]});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/grow-file-size-persistence.ck.svn-base | Perl | oos | 139 |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_archive ({"a" => {"b" => {}}});
pass;
| 10cm | trunk/10cm/pintos/src/tests/filesys/extended/.svn/text-base/dir-rm-parent-persistence.ck.svn-base | Perl | oos | 103 |