Dmitry V. Levin | fef0907 | 2015-02-04 16:38:09 +0000 | [diff] [blame] | 1 | BEGIN { |
| 2 | r[1] = "^getrandom\\(\"(\\\\x[0-9a-f][0-9a-f]){3}\", 3, 0\\) += 3$" |
| 3 | r[2] = "^getrandom\\(\"(\\\\x[0-9a-f][0-9a-f]){3}\"\\.\\.\\., 4, GRND_NONBLOCK\\) += 4$" |
| 4 | r[3] = "^getrandom\\(0x[[0-9a-f]+, 4, GRND_NONBLOCK\\|GRND_RANDOM\\|0x3000\\) += -1 " |
| 5 | r[4] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$" |
| 6 | lines = 4 |
| 7 | fail = 0 |
| 8 | } |
| 9 | |
| 10 | NR > lines { exit 1 } |
| 11 | |
| 12 | { |
| 13 | if (match($0, r[NR])) |
| 14 | next |
| 15 | |
| 16 | print "Line " NR " does not match." |
| 17 | fail = 1 |
| 18 | } |
| 19 | |
| 20 | END { |
| 21 | if (fail == 0 && NR != lines) { |
| 22 | fail = 1 |
| 23 | print "Expected " lines " lines, found " NR " line(s)." |
| 24 | } |
| 25 | exit fail |
| 26 | } |