diff options
author | Camil Staps | 2015-10-22 11:09:23 +0200 |
---|---|---|
committer | Camil Staps | 2015-10-22 11:09:23 +0200 |
commit | ce35195021beae9c8483d2a705cb1684c3363350 (patch) | |
tree | 75157334fc5e39246f3a9b949bacd7529fa0f8ca /Practical1/tester | |
parent | First version practical 1 (garbage collection) (diff) |
Practical 1 Tester
Diffstat (limited to 'Practical1/tester')
21 files changed, 1620 insertions, 0 deletions
diff --git a/Practical1/tester/cases.py b/Practical1/tester/cases.py new file mode 100644 index 0000000..d09ff27 --- /dev/null +++ b/Practical1/tester/cases.py @@ -0,0 +1,20 @@ +rows, cols, bins = 3, 3, 5 +#rows, cols, bins = 4, 4, 7 +#rows, cols, bins = 5, 5, 10 +rows, cols, bins = 6, 6, 14 +#rows, cols, bins = 7, 7, 18 +#rows, cols, bins = 8, 8, 23 +#rows, cols, bins = 9, 9, 28 +#rows, cols, bins = 10, 10, 36 +#rows, cols, bins = 11, 11, 42 + +print 3 * (rows - 1) * (cols - 1) + (rows - 1) + (cols - 1), rows * cols, bins +for r in range(rows - 1): + for c in range(r * cols + 1, (r+1) * cols): + print c, c + 1 + print c, c + cols + print c, c + cols + 1 + print (r+1) * cols, (r+2) * cols +for c in range(rows * cols - cols + 1, rows * cols): + print c, c + 1 + diff --git a/Practical1/tester/samples/big_1.in b/Practical1/tester/samples/big_1.in new file mode 100644 index 0000000..e7f2c8c --- /dev/null +++ b/Practical1/tester/samples/big_1.in @@ -0,0 +1,92 @@ +90 45 15 +1 2 +1 3 +1 4 +1 43 +2 3 +2 5 +2 44 +3 6 +3 45 +4 5 +4 6 +4 7 +5 6 +5 8 +6 9 +7 8 +7 9 +7 10 +8 9 +8 11 +9 12 +10 11 +10 12 +10 13 +11 12 +11 14 +12 15 +13 14 +13 15 +13 16 +14 15 +14 17 +15 18 +16 17 +16 18 +16 19 +17 18 +17 20 +18 21 +19 20 +19 21 +19 22 +20 21 +20 23 +21 24 +22 23 +22 24 +22 25 +23 24 +23 26 +24 27 +25 26 +25 27 +25 28 +26 27 +26 29 +27 30 +28 29 +28 30 +28 31 +29 30 +29 32 +30 33 +31 32 +31 33 +31 34 +32 33 +32 35 +33 36 +34 35 +34 36 +34 37 +35 36 +35 38 +36 39 +37 38 +37 39 +37 40 +38 39 +38 41 +39 42 +40 41 +40 42 +40 43 +41 42 +41 44 +42 45 +43 44 +43 45 +44 45 + diff --git a/Practical1/tester/samples/big_2.in b/Practical1/tester/samples/big_2.in new file mode 100644 index 0000000..a5200f5 --- /dev/null +++ b/Practical1/tester/samples/big_2.in @@ -0,0 +1,92 @@ +90 45 15 +1 9 +1 8 +1 7 +1 6 +2 12 +2 11 +2 10 +2 6 +3 12 +3 11 +3 10 +3 7 +4 15 +4 14 +4 13 +4 8 +5 15 +5 14 +5 13 +5 9 +6 9 +6 7 +7 8 +8 9 +10 12 +10 11 +11 12 +13 15 +13 14 +14 15 +16 24 +16 23 +16 22 +16 21 +17 27 +17 26 +17 25 +17 21 +18 27 +18 26 +18 25 +18 22 +19 30 +19 29 +19 28 +19 23 +20 30 +20 29 +20 28 +20 24 +21 24 +21 22 +22 23 +23 24 +25 27 +25 26 +26 27 +28 30 +28 29 +29 30 +31 39 +31 38 +31 37 +31 36 +32 42 +32 41 +32 40 +32 36 +33 42 +33 41 +33 40 +33 37 +34 45 +34 44 +34 43 +34 38 +35 45 +35 44 +35 43 +35 39 +36 39 +36 37 +37 38 +38 39 +40 42 +40 41 +41 42 +43 45 +43 44 +44 45 + diff --git a/Practical1/tester/samples/big_3.in b/Practical1/tester/samples/big_3.in new file mode 100644 index 0000000..5a26667 --- /dev/null +++ b/Practical1/tester/samples/big_3.in @@ -0,0 +1,126 @@ +125 72 18 +69 70 +69 71 +69 72 +70 71 +70 72 +71 72 +65 66 +65 67 +65 68 +66 67 +66 68 +67 68 +61 62 +61 63 +61 64 +62 63 +62 64 +63 64 +57 58 +57 59 +57 60 +58 59 +58 60 +59 60 +53 54 +53 55 +53 56 +54 55 +54 56 +55 56 +49 50 +49 51 +49 52 +50 51 +50 52 +51 52 +45 46 +45 47 +45 48 +46 47 +46 48 +47 48 +41 42 +41 43 +41 44 +42 43 +42 44 +43 44 +37 38 +37 39 +37 40 +38 39 +38 40 +39 40 +33 34 +33 35 +33 36 +34 35 +34 36 +35 36 +29 30 +29 31 +29 32 +30 31 +30 32 +31 32 +25 26 +25 27 +25 28 +26 27 +26 28 +27 28 +21 22 +21 23 +21 24 +22 23 +22 24 +23 24 +17 18 +17 19 +17 20 +18 19 +18 20 +19 20 +13 14 +13 15 +13 16 +14 15 +14 16 +15 16 +9 10 +9 11 +9 12 +10 11 +10 12 +11 12 +5 6 +5 7 +5 8 +6 7 +6 8 +7 8 +1 2 +1 3 +1 4 +2 3 +2 4 +3 4 +2 5 +6 9 +10 13 +14 17 +18 21 +22 25 +26 29 +30 33 +34 37 +38 41 +42 45 +46 49 +50 53 +54 57 +58 61 +62 65 +66 69 diff --git a/Practical1/tester/samples/big_4.in b/Practical1/tester/samples/big_4.in new file mode 100644 index 0000000..295688f --- /dev/null +++ b/Practical1/tester/samples/big_4.in @@ -0,0 +1,126 @@ +125 72 19 +69 70 +69 71 +69 72 +70 71 +70 72 +71 72 +65 66 +65 67 +65 68 +66 67 +66 68 +67 68 +61 62 +61 63 +61 64 +62 63 +62 64 +63 64 +57 58 +57 59 +57 60 +58 59 +58 60 +59 60 +53 54 +53 55 +53 56 +54 55 +54 56 +55 56 +49 50 +49 51 +49 52 +50 51 +50 52 +51 52 +45 46 +45 47 +45 48 +46 47 +46 48 +47 48 +41 42 +41 43 +41 44 +42 43 +42 44 +43 44 +37 38 +37 39 +37 40 +38 39 +38 40 +39 40 +33 34 +33 35 +33 36 +34 35 +34 36 +35 36 +29 30 +29 31 +29 32 +30 31 +30 32 +31 32 +25 26 +25 27 +25 28 +26 27 +26 28 +27 28 +21 22 +21 23 +21 24 +22 23 +22 24 +23 24 +17 18 +17 19 +17 20 +18 19 +18 20 +19 20 +13 14 +13 15 +13 16 +14 15 +14 16 +15 16 +9 10 +9 11 +9 12 +10 11 +10 12 +11 12 +5 6 +5 7 +5 8 +6 7 +6 8 +7 8 +1 2 +1 3 +1 4 +2 3 +2 4 +3 4 +2 5 +6 9 +10 13 +14 17 +18 21 +22 25 +26 29 +30 33 +34 37 +38 41 +42 45 +46 49 +50 53 +54 57 +58 61 +62 65 +66 69 diff --git a/Practical1/tester/samples/big_5.in b/Practical1/tester/samples/big_5.in new file mode 100644 index 0000000..f95e42a --- /dev/null +++ b/Practical1/tester/samples/big_5.in @@ -0,0 +1,181 @@ +180 90 18 +86 87 +86 88 +86 89 +86 90 +87 88 +87 89 +87 90 +88 89 +88 90 +89 90 +81 82 +81 83 +81 84 +81 85 +82 83 +82 84 +82 85 +83 84 +83 85 +84 85 +76 77 +76 78 +76 79 +76 80 +77 78 +77 79 +77 80 +78 79 +78 80 +79 80 +71 72 +71 73 +71 74 +71 75 +72 73 +72 74 +72 75 +73 74 +73 75 +74 75 +66 67 +66 68 +66 69 +66 70 +67 68 +67 69 +67 70 +68 69 +68 70 +69 70 +61 62 +61 63 +61 64 +61 65 +62 63 +62 64 +62 65 +63 64 +63 65 +64 65 +56 57 +56 58 +56 59 +56 60 +57 58 +57 59 +57 60 +58 59 +58 60 +59 60 +51 52 +51 53 +51 54 +51 55 +52 53 +52 54 +52 55 +53 54 +53 55 +54 55 +46 47 +46 48 +46 49 +46 50 +47 48 +47 49 +47 50 +48 49 +48 50 +49 50 +41 42 +41 43 +41 44 +41 45 +42 43 +42 44 +42 45 +43 44 +43 45 +44 45 +36 37 +36 38 +36 39 +36 40 +37 38 +37 39 +37 40 +38 39 +38 40 +39 40 +31 32 +31 33 +31 34 +31 35 +32 33 +32 34 +32 35 +33 34 +33 35 +34 35 +26 27 +26 28 +26 29 +26 30 +27 28 +27 29 +27 30 +28 29 +28 30 +29 30 +21 22 +21 23 +21 24 +21 25 +22 23 +22 24 +22 25 +23 24 +23 25 +24 25 +16 17 +16 18 +16 19 +16 20 +17 18 +17 19 +17 20 +18 19 +18 20 +19 20 +11 12 +11 13 +11 14 +11 15 +12 13 +12 14 +12 15 +13 14 +13 15 +14 15 +6 7 +6 8 +6 9 +6 10 +7 8 +7 9 +7 10 +8 9 +8 10 +9 10 +1 2 +1 3 +1 4 +1 5 +2 3 +2 4 +2 5 +3 4 +3 5 +4 5 diff --git a/Practical1/tester/samples/big_6.in b/Practical1/tester/samples/big_6.in new file mode 100644 index 0000000..1f1d155 --- /dev/null +++ b/Practical1/tester/samples/big_6.in @@ -0,0 +1,181 @@ +180 90 19 +86 87 +86 88 +86 89 +86 90 +87 88 +87 89 +87 90 +88 89 +88 90 +89 90 +81 82 +81 83 +81 84 +81 85 +82 83 +82 84 +82 85 +83 84 +83 85 +84 85 +76 77 +76 78 +76 79 +76 80 +77 78 +77 79 +77 80 +78 79 +78 80 +79 80 +71 72 +71 73 +71 74 +71 75 +72 73 +72 74 +72 75 +73 74 +73 75 +74 75 +66 67 +66 68 +66 69 +66 70 +67 68 +67 69 +67 70 +68 69 +68 70 +69 70 +61 62 +61 63 +61 64 +61 65 +62 63 +62 64 +62 65 +63 64 +63 65 +64 65 +56 57 +56 58 +56 59 +56 60 +57 58 +57 59 +57 60 +58 59 +58 60 +59 60 +51 52 +51 53 +51 54 +51 55 +52 53 +52 54 +52 55 +53 54 +53 55 +54 55 +46 47 +46 48 +46 49 +46 50 +47 48 +47 49 +47 50 +48 49 +48 50 +49 50 +41 42 +41 43 +41 44 +41 45 +42 43 +42 44 +42 45 +43 44 +43 45 +44 45 +36 37 +36 38 +36 39 +36 40 +37 38 +37 39 +37 40 +38 39 +38 40 +39 40 +31 32 +31 33 +31 34 +31 35 +32 33 +32 34 +32 35 +33 34 +33 35 +34 35 +26 27 +26 28 +26 29 +26 30 +27 28 +27 29 +27 30 +28 29 +28 30 +29 30 +21 22 +21 23 +21 24 +21 25 +22 23 +22 24 +22 25 +23 24 +23 25 +24 25 +16 17 +16 18 +16 19 +16 20 +17 18 +17 19 +17 20 +18 19 +18 20 +19 20 +11 12 +11 13 +11 14 +11 15 +12 13 +12 14 +12 15 +13 14 +13 15 +14 15 +6 7 +6 8 +6 9 +6 10 +7 8 +7 9 +7 10 +8 9 +8 10 +9 10 +1 2 +1 3 +1 4 +1 5 +2 3 +2 4 +2 5 +3 4 +3 5 +4 5 diff --git a/Practical1/tester/samples/cases_3.in b/Practical1/tester/samples/cases_3.in new file mode 100644 index 0000000..a9b8617 --- /dev/null +++ b/Practical1/tester/samples/cases_3.in @@ -0,0 +1,17 @@ +16 9 5 +1 2 +1 4 +1 5 +2 3 +2 5 +2 6 +3 6 +4 5 +4 7 +4 8 +5 6 +5 8 +5 9 +6 9 +7 8 +8 9 diff --git a/Practical1/tester/samples/cases_4.in b/Practical1/tester/samples/cases_4.in new file mode 100644 index 0000000..33d82b8 --- /dev/null +++ b/Practical1/tester/samples/cases_4.in @@ -0,0 +1,34 @@ +33 16 7 +1 2 +1 5 +1 6 +2 3 +2 6 +2 7 +3 4 +3 7 +3 8 +4 8 +5 6 +5 9 +5 10 +6 7 +6 10 +6 11 +7 8 +7 11 +7 12 +8 12 +9 10 +9 13 +9 14 +10 11 +10 14 +10 15 +11 12 +11 15 +11 16 +12 16 +13 14 +14 15 +15 16 diff --git a/Practical1/tester/samples/cases_5.in b/Practical1/tester/samples/cases_5.in new file mode 100644 index 0000000..396c395 --- /dev/null +++ b/Practical1/tester/samples/cases_5.in @@ -0,0 +1,57 @@ +56 25 10 +1 2 +1 6 +1 7 +2 3 +2 7 +2 8 +3 4 +3 8 +3 9 +4 5 +4 9 +4 10 +5 10 +6 7 +6 11 +6 12 +7 8 +7 12 +7 13 +8 9 +8 13 +8 14 +9 10 +9 14 +9 15 +10 15 +11 12 +11 16 +11 17 +12 13 +12 17 +12 18 +13 14 +13 18 +13 19 +14 15 +14 19 +14 20 +15 20 +16 17 +16 21 +16 22 +17 18 +17 22 +17 23 +18 19 +18 23 +18 24 +19 20 +19 24 +19 25 +20 25 +21 22 +22 23 +23 24 +24 25 diff --git a/Practical1/tester/samples/cases_6.in b/Practical1/tester/samples/cases_6.in new file mode 100644 index 0000000..ea922dd --- /dev/null +++ b/Practical1/tester/samples/cases_6.in @@ -0,0 +1,86 @@ +85 36 14 +1 2 +1 7 +1 8 +2 3 +2 8 +2 9 +3 4 +3 9 +3 10 +4 5 +4 10 +4 11 +5 6 +5 11 +5 12 +6 12 +7 8 +7 13 +7 14 +8 9 +8 14 +8 15 +9 10 +9 15 +9 16 +10 11 +10 16 +10 17 +11 12 +11 17 +11 18 +12 18 +13 14 +13 19 +13 20 +14 15 +14 20 +14 21 +15 16 +15 21 +15 22 +16 17 +16 22 +16 23 +17 18 +17 23 +17 24 +18 24 +19 20 +19 25 +19 26 +20 21 +20 26 +20 27 +21 22 +21 27 +21 28 +22 23 +22 28 +22 29 +23 24 +23 29 +23 30 +24 30 +25 26 +25 31 +25 32 +26 27 +26 32 +26 33 +27 28 +27 33 +27 34 +28 29 +28 34 +28 35 +29 30 +29 35 +29 36 +30 36 +31 32 +32 33 +33 34 +34 35 +35 36 diff --git a/Practical1/tester/samples/cases_7.in b/Practical1/tester/samples/cases_7.in new file mode 100644 index 0000000..1097fb4 --- /dev/null +++ b/Practical1/tester/samples/cases_7.in @@ -0,0 +1,121 @@ +120 49 18 +1 2 +1 8 +1 9 +2 3 +2 9 +2 10 +3 4 +3 10 +3 11 +4 5 +4 11 +4 12 +5 6 +5 12 +5 13 +6 7 +6 13 +6 14 +7 14 +8 9 +8 15 +8 16 +9 10 +9 16 +9 17 +10 11 +10 17 +10 18 +11 12 +11 18 +11 19 +12 13 +12 19 +12 20 +13 14 +13 20 +13 21 +14 21 +15 16 +15 22 +15 23 +16 17 +16 23 +16 24 +17 18 +17 24 +17 25 +18 19 +18 25 +18 26 +19 20 +19 26 +19 27 +20 21 +20 27 +20 28 +21 28 +22 23 +22 29 +22 30 +23 24 +23 30 +23 31 +24 25 +24 31 +24 32 +25 26 +25 32 +25 33 +26 27 +26 33 +26 34 +27 28 +27 34 +27 35 +28 35 +29 30 +29 36 +29 37 +30 31 +30 37 +30 38 +31 32 +31 38 +31 39 +32 33 +32 39 +32 40 +33 34 +33 40 +33 41 +34 35 +34 41 +34 42 +35 42 +36 37 +36 43 +36 44 +37 38 +37 44 +37 45 +38 39 +38 45 +38 46 +39 40 +39 46 +39 47 +40 41 +40 47 +40 48 +41 42 +41 48 +41 49 +42 49 +43 44 +44 45 +45 46 +46 47 +47 48 +48 49 diff --git a/Practical1/tester/samples/cases_8.in b/Practical1/tester/samples/cases_8.in new file mode 100644 index 0000000..dd23253 --- /dev/null +++ b/Practical1/tester/samples/cases_8.in @@ -0,0 +1,162 @@ +161 64 23 +1 2 +1 9 +1 10 +2 3 +2 10 +2 11 +3 4 +3 11 +3 12 +4 5 +4 12 +4 13 +5 6 +5 13 +5 14 +6 7 +6 14 +6 15 +7 8 +7 15 +7 16 +8 16 +9 10 +9 17 +9 18 +10 11 +10 18 +10 19 +11 12 +11 19 +11 20 +12 13 +12 20 +12 21 +13 14 +13 21 +13 22 +14 15 +14 22 +14 23 +15 16 +15 23 +15 24 +16 24 +17 18 +17 25 +17 26 +18 19 +18 26 +18 27 +19 20 +19 27 +19 28 +20 21 +20 28 +20 29 +21 22 +21 29 +21 30 +22 23 +22 30 +22 31 +23 24 +23 31 +23 32 +24 32 +25 26 +25 33 +25 34 +26 27 +26 34 +26 35 +27 28 +27 35 +27 36 +28 29 +28 36 +28 37 +29 30 +29 37 +29 38 +30 31 +30 38 +30 39 +31 32 +31 39 +31 40 +32 40 +33 34 +33 41 +33 42 +34 35 +34 42 +34 43 +35 36 +35 43 +35 44 +36 37 +36 44 +36 45 +37 38 +37 45 +37 46 +38 39 +38 46 +38 47 +39 40 +39 47 +39 48 +40 48 +41 42 +41 49 +41 50 +42 43 +42 50 +42 51 +43 44 +43 51 +43 52 +44 45 +44 52 +44 53 +45 46 +45 53 +45 54 +46 47 +46 54 +46 55 +47 48 +47 55 +47 56 +48 56 +49 50 +49 57 +49 58 +50 51 +50 58 +50 59 +51 52 +51 59 +51 60 +52 53 +52 60 +52 61 +53 54 +53 61 +53 62 +54 55 +54 62 +54 63 +55 56 +55 63 +55 64 +56 64 +57 58 +58 59 +59 60 +60 61 +61 62 +62 63 +63 64 diff --git a/Practical1/tester/samples/cases_9.in b/Practical1/tester/samples/cases_9.in new file mode 100644 index 0000000..e382d8e --- /dev/null +++ b/Practical1/tester/samples/cases_9.in @@ -0,0 +1,209 @@ +208 81 28 +1 2 +1 10 +1 11 +2 3 +2 11 +2 12 +3 4 +3 12 +3 13 +4 5 +4 13 +4 14 +5 6 +5 14 +5 15 +6 7 +6 15 +6 16 +7 8 +7 16 +7 17 +8 9 +8 17 +8 18 +9 18 +10 11 +10 19 +10 20 +11 12 +11 20 +11 21 +12 13 +12 21 +12 22 +13 14 +13 22 +13 23 +14 15 +14 23 +14 24 +15 16 +15 24 +15 25 +16 17 +16 25 +16 26 +17 18 +17 26 +17 27 +18 27 +19 20 +19 28 +19 29 +20 21 +20 29 +20 30 +21 22 +21 30 +21 31 +22 23 +22 31 +22 32 +23 24 +23 32 +23 33 +24 25 +24 33 +24 34 +25 26 +25 34 +25 35 +26 27 +26 35 +26 36 +27 36 +28 29 +28 37 +28 38 +29 30 +29 38 +29 39 +30 31 +30 39 +30 40 +31 32 +31 40 +31 41 +32 33 +32 41 +32 42 +33 34 +33 42 +33 43 +34 35 +34 43 +34 44 +35 36 +35 44 +35 45 +36 45 +37 38 +37 46 +37 47 +38 39 +38 47 +38 48 +39 40 +39 48 +39 49 +40 41 +40 49 +40 50 +41 42 +41 50 +41 51 +42 43 +42 51 +42 52 +43 44 +43 52 +43 53 +44 45 +44 53 +44 54 +45 54 +46 47 +46 55 +46 56 +47 48 +47 56 +47 57 +48 49 +48 57 +48 58 +49 50 +49 58 +49 59 +50 51 +50 59 +50 60 +51 52 +51 60 +51 61 +52 53 +52 61 +52 62 +53 54 +53 62 +53 63 +54 63 +55 56 +55 64 +55 65 +56 57 +56 65 +56 66 +57 58 +57 66 +57 67 +58 59 +58 67 +58 68 +59 60 +59 68 +59 69 +60 61 +60 69 +60 70 +61 62 +61 70 +61 71 +62 63 +62 71 +62 72 +63 72 +64 65 +64 73 +64 74 +65 66 +65 74 +65 75 +66 67 +66 75 +66 76 +67 68 +67 76 +67 77 +68 69 +68 77 +68 78 +69 70 +69 78 +69 79 +70 71 +70 79 +70 80 +71 72 +71 80 +71 81 +72 81 +73 74 +74 75 +75 76 +76 77 +77 78 +78 79 +79 80 +80 81 diff --git a/Practical1/tester/samples/small_1.in b/Practical1/tester/samples/small_1.in new file mode 100644 index 0000000..fe1a7aa --- /dev/null +++ b/Practical1/tester/samples/small_1.in @@ -0,0 +1,12 @@ +10 7 3 +1 7 +1 3 +1 4 +1 2 +2 7 +2 3 +2 4 +3 7 +3 4 +4 7 + diff --git a/Practical1/tester/samples/small_2.in b/Practical1/tester/samples/small_2.in new file mode 100644 index 0000000..633fb9b --- /dev/null +++ b/Practical1/tester/samples/small_2.in @@ -0,0 +1,12 @@ +10 7 4 +2 5 +2 3 +2 6 +2 7 +3 5 +3 6 +3 7 +5 6 +5 7 +6 7 + diff --git a/Practical1/tester/samples/small_3.in b/Practical1/tester/samples/small_3.in new file mode 100644 index 0000000..6207afa --- /dev/null +++ b/Practical1/tester/samples/small_3.in @@ -0,0 +1,18 @@ +16 9 2 +1 6 +1 2 +1 5 +1 3 +2 3 +2 5 +2 9 +3 9 +3 4 +4 8 +4 6 +5 9 +5 6 +6 7 +7 8 +7 9 + diff --git a/Practical1/tester/samples/small_4.in b/Practical1/tester/samples/small_4.in new file mode 100644 index 0000000..16068e1 --- /dev/null +++ b/Practical1/tester/samples/small_4.in @@ -0,0 +1,18 @@ +16 9 3 +1 4 +1 8 +1 5 +1 7 +2 4 +2 7 +2 5 +2 6 +3 8 +3 9 +4 9 +4 7 +5 6 +5 7 +6 8 +6 9 + diff --git a/Practical1/tester/samples/small_5.in b/Practical1/tester/samples/small_5.in new file mode 100644 index 0000000..113adab --- /dev/null +++ b/Practical1/tester/samples/small_5.in @@ -0,0 +1,18 @@ +16 9 4 +1 4 +1 5 +1 2 +1 7 +2 8 +2 5 +2 4 +3 6 +3 9 +4 6 +4 9 +5 7 +5 8 +6 7 +7 8 +8 9 + diff --git a/Practical1/tester/samples/small_6.in b/Practical1/tester/samples/small_6.in new file mode 100644 index 0000000..75bba12 --- /dev/null +++ b/Practical1/tester/samples/small_6.in @@ -0,0 +1,6 @@ +4 5 3 +1 2 +1 5 +3 5 +3 4 + diff --git a/Practical1/tester/test.sh b/Practical1/tester/test.sh new file mode 100755 index 0000000..a13fd63 --- /dev/null +++ b/Practical1/tester/test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +java="/usr/lib/jvm/java-8-openjdk-amd64/bin/java" + +failed=0 + +cd "$(dirname $0)/../out/production/Practical1" +for tc in ../../../tester/samples/cas*.in +do + answer=$(cat ${tc/in/out}) + header=$(head -n1 "$tc" | tr -d '\n') + echo -n "Running $(basename $tc) $(printf '%-12s' "($answer ")$(printf '%-12s' "/ $header)") ... " + time_start=$(($(date +%s%N)/1000000)) + result=$(eval "cat '$tc' | /usr/lib/jvm/java-8-openjdk-amd64/bin/java nl.camilstaps.cs.GarbageCollectionHelper") + time_end=$(($(date +%s%N)/1000000)) + time=`expr $time_end - $time_start` + if [ $result != $answer ] + then + echo "failure ($time ms)." + failed+=1 + else + echo "success ($time ms)." + fi +done +cd - + +if [ $failed -eq 0 ] +then + echo "All tests passed" +else + echo "$failed tests failed" +fi + |