| 1 |
*> { dg-do run } |
| 2 |
|
| 3 |
identification division. |
| 4 |
program-id. test. |
| 5 |
data division. |
| 6 |
working-storage section. |
| 7 |
01 datev pic 99999999. |
| 8 |
01 should_be pic 9999. |
| 9 |
01 result pic 9999. |
| 10 |
procedure division. |
| 11 |
move function test-day-yyyyddd(1945123) to result |
| 12 |
move zero to should_be |
| 13 |
if result not equal to should_be then |
| 14 |
display "test-day-yyyyddd(1945123) should have been " |
| 15 |
should_be " but was " result |
| 16 |
move 1 to return-code |
| 17 |
end-if. |
| 18 |
move function test-day-yyyyddd(10000000) to result |
| 19 |
move 1 to should_be |
| 20 |
if result not equal to should_be then |
| 21 |
display "test-day-yyyyddd(100000000) should have been " |
| 22 |
should_be " but was " result |
| 23 |
move 1 to return-code |
| 24 |
end-if. |
| 25 |
move 1601000 to datev |
| 26 |
move 2 to should_be |
| 27 |
move function test-day-yyyyddd(datev) to result |
| 28 |
if result not equal to should_be then |
| 29 |
display "test-day-yyyyddd(" datev ") should have been " |
| 30 |
should_be " but was " result |
| 31 |
move 1 to return-code |
| 32 |
end-if. |
| 33 |
move 1601001 to datev |
| 34 |
move zero to should_be |
| 35 |
move function test-day-yyyyddd(datev) to result |
| 36 |
if result not equal to should_be then |
| 37 |
display "test-day-yyyyddd(" datev ") should have been " |
| 38 |
should_be " but was " result |
| 39 |
move 1 to return-code |
| 40 |
end-if. |
| 41 |
move 1601364 to datev |
| 42 |
move zero to should_be |
| 43 |
move function test-day-yyyyddd(datev) to result |
| 44 |
if result not equal to should_be then |
| 45 |
display "test-day-yyyyddd(" datev ") should have been " |
| 46 |
should_be " but was " result |
| 47 |
move 1 to return-code |
| 48 |
end-if. |
| 49 |
move 1601365 to datev |
| 50 |
move zero to should_be |
| 51 |
move function test-day-yyyyddd(datev) to result |
| 52 |
if result not equal to should_be then |
| 53 |
display "test-day-yyyyddd(" datev ") should have been " |
| 54 |
should_be " but was " result |
| 55 |
move 1 to return-code |
| 56 |
end-if. |
| 57 |
move 1601366 to datev |
| 58 |
move 2 to should_be |
| 59 |
move function test-day-yyyyddd(datev) to result |
| 60 |
if result not equal to should_be then |
| 61 |
display "test-day-yyyyddd(" datev ") should have been " |
| 62 |
should_be " but was " result |
| 63 |
move 1 to return-code |
| 64 |
end-if. |
| 65 |
move 1601367 to datev |
| 66 |
move 2 to should_be |
| 67 |
move function test-day-yyyyddd(datev) to result |
| 68 |
if result not equal to should_be then |
| 69 |
display "test-day-yyyyddd(" datev ") should have been " |
| 70 |
should_be " but was " result |
| 71 |
move 1 to return-code |
| 72 |
end-if. |
| 73 |
move 2000365 to datev |
| 74 |
move zero to should_be |
| 75 |
move function test-day-yyyyddd(datev) to result |
| 76 |
if result not equal to should_be then |
| 77 |
display "test-day-yyyyddd(" datev ") should have been " |
| 78 |
should_be " but was " result |
| 79 |
move 1 to return-code |
| 80 |
end-if. |
| 81 |
move 2000366 to datev |
| 82 |
move zero to should_be |
| 83 |
move function test-day-yyyyddd(datev) to result |
| 84 |
if result not equal to should_be then |
| 85 |
display "test-day-yyyyddd(" datev ") should have been " |
| 86 |
should_be " but was " result |
| 87 |
move 1 to return-code |
| 88 |
end-if. |
| 89 |
move 2000367 to datev |
| 90 |
move 2 to should_be |
| 91 |
move function test-day-yyyyddd(datev) to result |
| 92 |
if result not equal to should_be then |
| 93 |
display "test-day-yyyyddd(" datev ") should have been " |
| 94 |
should_be " but was " result |
| 95 |
move 1 to return-code |
| 96 |
end-if. |
| 97 |
move 2100365 to datev |
| 98 |
move zero to should_be |
| 99 |
move function test-day-yyyyddd(datev) to result |
| 100 |
if result not equal to should_be then |
| 101 |
display "test-day-yyyyddd(" datev ") should have been " |
| 102 |
should_be " but was " result |
| 103 |
move 1 to return-code |
| 104 |
end-if. |
| 105 |
move 2100366 to datev |
| 106 |
move 2 to should_be |
| 107 |
move function test-day-yyyyddd(datev) to result |
| 108 |
if result not equal to should_be then |
| 109 |
display "test-day-yyyyddd(" datev ") should have been " |
| 110 |
should_be " but was " result |
| 111 |
move 1 to return-code |
| 112 |
end-if. |
| 113 |
move 2100367 to datev |
| 114 |
move 2 to should_be |
| 115 |
move function test-day-yyyyddd(datev) to result |
| 116 |
if result not equal to should_be then |
| 117 |
display "test-day-yyyyddd(" datev ") should have been " |
| 118 |
should_be " but was " result |
| 119 |
move 1 to return-code |
| 120 |
end-if. |
| 121 |
move 1988365 to datev |
| 122 |
move zero to should_be |
| 123 |
move function test-day-yyyyddd(datev) to result |
| 124 |
if result not equal to should_be then |
| 125 |
display "test-day-yyyyddd(" datev ") should have been " |
| 126 |
should_be " but was " result |
| 127 |
move 1 to return-code |
| 128 |
end-if. |
| 129 |
move 1988366 to datev |
| 130 |
move zero to should_be |
| 131 |
move function test-day-yyyyddd(datev) to result |
| 132 |
if result not equal to should_be then |
| 133 |
display "test-day-yyyyddd(" datev ") should have been " |
| 134 |
should_be " but was " result |
| 135 |
move 1 to return-code |
| 136 |
end-if. |
| 137 |
move 1988367 to datev |
| 138 |
move 2 to should_be |
| 139 |
move function test-day-yyyyddd(datev) to result |
| 140 |
if result not equal to should_be then |
| 141 |
display "test-day-yyyyddd(" datev ") should have been " |
| 142 |
should_be " but was " result |
| 143 |
move 1 to return-code |
| 144 |
end-if. |
| 145 |
move 1989365 to datev |
| 146 |
move zero to should_be |
| 147 |
move function test-day-yyyyddd(datev) to result |
| 148 |
if result not equal to should_be then |
| 149 |
display "test-day-yyyyddd(" datev ") should have been " |
| 150 |
should_be " but was " result |
| 151 |
move 1 to return-code |
| 152 |
end-if. |
| 153 |
move 1989366 to datev |
| 154 |
move 2 to should_be |
| 155 |
move function test-day-yyyyddd(datev) to result |
| 156 |
if result not equal to should_be then |
| 157 |
display "test-day-yyyyddd(" datev ") should have been " |
| 158 |
should_be " but was " result |
| 159 |
move 1 to return-code |
| 160 |
end-if. |
| 161 |
move 1989367 to datev |
| 162 |
move 2 to should_be |
| 163 |
move function test-day-yyyyddd(datev) to result |
| 164 |
if result not equal to should_be then |
| 165 |
display "test-day-yyyyddd(" datev ") should have been " |
| 166 |
should_be " but was " result |
| 167 |
move 1 to return-code |
| 168 |
end-if. |
| 169 |
end program test. |
| 170 |
|