blob: 4c5f6fc108179e377b28123e2ad7bb06b041f68c [file] [log] [blame]
Dmitry V. Levinfef09072015-02-04 16:38:09 +00001BEGIN {
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
10NR > 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
20END {
21 if (fail == 0 && NR != lines) {
22 fail = 1
23 print "Expected " lines " lines, found " NR " line(s)."
24 }
25 exit fail
26}