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/threads/alarm.pm | |
| 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/threads/alarm.pm')
| -rw-r--r-- | pintos-progos/tests/threads/alarm.pm | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/pintos-progos/tests/threads/alarm.pm b/pintos-progos/tests/threads/alarm.pm deleted file mode 100644 index 84b3b7f..0000000 --- a/pintos-progos/tests/threads/alarm.pm +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | sub check_alarm { | ||
| 2 | my ($iterations) = @_; | ||
| 3 | our ($test); | ||
| 4 | |||
| 5 | @output = read_text_file ("$test.output"); | ||
| 6 | common_checks ("run", @output); | ||
| 7 | |||
| 8 | my (@products); | ||
| 9 | for (my ($i) = 0; $i < $iterations; $i++) { | ||
| 10 | for (my ($t) = 0; $t < 5; $t++) { | ||
| 11 | push (@products, ($i + 1) * ($t + 1) * 10); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | @products = sort {$a <=> $b} @products; | ||
| 15 | |||
| 16 | local ($_); | ||
| 17 | foreach (@output) { | ||
| 18 | fail $_ if /out of order/i; | ||
| 19 | |||
| 20 | my ($p) = /product=(\d+)$/; | ||
| 21 | next if !defined $p; | ||
| 22 | |||
| 23 | my ($q) = shift (@products); | ||
| 24 | fail "Too many wakeups.\n" if !defined $q; | ||
| 25 | fail "Out of order wakeups ($p vs. $q).\n" if $p != $q; # FIXME | ||
| 26 | } | ||
| 27 | fail scalar (@products) . " fewer wakeups than expected.\n" | ||
| 28 | if @products != 0; | ||
| 29 | pass; | ||
| 30 | } | ||
| 31 | |||
| 32 | 1; | ||
