blob: de3a7cda5c3ba056316fdc54070a808436aa32c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/usr/bin/env python
import sys
l = [int(line.strip()) for line in open(sys.argv[1])]
if len(l) != 3500:
print "result contained %d lines, not the expected 3500 lines!" % (len(l))
raise SystemExit, 1 # failure
lineno = 1
got_reset = 0
expected = 1
for i in l:
if i == 1:
if expected != 1: got_reset = 1
expected = i + 1
continue
if i != expected:
if expected == 1:
print "line %d: got %d, expected %d" % (lineno, i, expected)
else:
print "line %d: got %d, expected %d or 1" % (lineno, i, expected)
raise SystemExit, 1 # failure
expected = i + 1
lineno = lineno + 1
if got_reset:
raise SystemExit, 0 # success
print "no reset in %d lines!" % (lineno-1)
raise SystemExit, 1 # failure
|