Skip to content

Commit fb0a853

Browse files
committed
Removed operation pattern size, which was a leftover from the time before patterns.
1 parent e1b534f commit fb0a853

File tree

2 files changed

+60
-63
lines changed

2 files changed

+60
-63
lines changed

sadc.test

+45-45
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@
77
################################################################################
88

99
# Before any writes, reads should go to unmapped.
10-
r _ 0 1,r _ 1 1,r _ 2 1,r _ 3 1,r _ 4 1,r _ 5 1,r _ 6 1,r _ 7 1,r _ 8 1,r _ 9 1,r _ 10 1,r _ 11 1:r 0 1,r 1 1,r 2 1,r 3 1,r 4 1,r 5 1,r 6 1,r 7 1,r 8 1,r 9 1,r 10 1,r 11 1
10+
r _ 0,r _ 1,r _ 2,r _ 3,r _ 4,r _ 5,r _ 6,r _ 7,r _ 8,r _ 9,r _ 10,r _ 11:r 0 1,r 1 1,r 2 1,r 3 1,r 4 1,r 5 1,r 6 1,r 7 1,r 8 1,r 9 1,r 10 1,r 11 1
1111

1212
# Read all of blocks in a single read operation.
13-
r ____________ 0 12:r 0 12
13+
r ____________ 0:r 0 12
1414

1515
# Write as much as possible without causing GC, one block at a time. Also
1616
# verify the contents.
17-
w a 0 1,w b 1 1,w c 2 1,w d 3 1,w e 4 1,w f 5 1,r a 0 1,r b 1 1,r c 2 1,r d 3 1,r e 4 1,r f 5 1:w 12 1,w 13 1,w 14 1,w 15 1,w 16 1,w 17 1,r 12 1,r 13 1,r 14 1,r 15 1,r 16 1,r 17 1
17+
w a 0,w b 1,w c 2,w d 3,w e 4,w f 5,r a 0,r b 1,r c 2,r d 3,r e 4,r f 5:w 12 1,w 13 1,w 14 1,w 15 1,w 16 1,w 17 1,r 12 1,r 13 1,r 14 1,r 15 1,r 16 1,r 17 1
1818

1919
# Write as much as possible without causing GC, in as big chunks as possible.
2020
# Also verify the contents.
21-
w aaa 0 3,w bbb 3 3,r aaa 0 3,r bbb 3 3:w 12 3,w 15 3,r 12 3,r 15 3
21+
w aaa 0,w bbb 3,r aaa 0,r bbb 3:w 12 3,w 15 3,r 12 3,r 15 3
2222

2323
# Write as much as possible without causing GC, one block at a time, for
2424
# non-contiguous bands. Also verify the contents.
25-
w a 3 1,w b 4 1,w c 5 1,w d 6 1,w e 7 1,w f 8 1,r a 3 1,r b 4 1,r c 5 1,r d 6 1,r e 7 1,r f 8 1:w 15 1,w 16 1,w 17 1,w 12 1,w 13 1,w 14 1,r 15 1,r 16 1,r 17 1,r 12 1,r 13 1,r 14 1
25+
w a 3,w b 4,w c 5,w d 6,w e 7,w f 8,r a 3,r b 4,r c 5,r d 6,r e 7,r f 8:w 15 1,w 16 1,w 17 1,w 12 1,w 13 1,w 14 1,r 15 1,r 16 1,r 17 1,r 12 1,r 13 1,r 14 1
2626

2727
# # Write as much as possible without causing GC, in as big chunks as possible,
2828
# # for non-contiguous bands. Also verify the contents.
29-
w aaa 3 3,w bbb 6 3,r aaa 3 3,r bbb 6 3:w 15 3,w 12 3,r 15 3,r 12 3
29+
w aaa 3,w bbb 6,r aaa 3,r bbb 6:w 15 3,w 12 3,r 15 3,r 12 3
3030

3131
################################################################################
3232
#
@@ -37,60 +37,60 @@ w aaa 3 3,w bbb 6 3,r aaa 3 3,r bbb 6 3:w 15 3,w 12 3,r 15 3,r 12 3
3737
################################################################################
3838

3939
# Write to the beginning of the band and read all of the band, one block.
40-
w a 0 1,r a__ 0 3:w 12 1,r 12 1,r 1 2
40+
w a 0,r a__ 0:w 12 1,r 12 1,r 1 2
4141

4242
# Write to the beginning of the band and read all of the band, two blocks.
43-
w ab 0 2,r ab_ 0 3:w 12 2,r 12 2,r 2 1
43+
w ab 0,r ab_ 0:w 12 2,r 12 2,r 2 1
4444

4545
# Write to the end of the band and read all of the band, one block.
46-
w a 2 1,r __a 0 3:w 12 1,r 0 2,r 12 1
46+
w a 2,r __a 0:w 12 1,r 0 2,r 12 1
4747

4848
# Write to the end of the band and read all of the band, two blocks.
49-
w ab 1 2,r _ab 0 3:w 12 2,r 0 1,r 12 2
49+
w ab 1,r _ab 0:w 12 2,r 0 1,r 12 2
5050

5151
# Write a single block to the middle of the band and read all of the band.
52-
w a 1 1,r _a_ 0 3:w 12 1,r 0 1,r 12 1,r 2 1
52+
w a 1,r _a_ 0:w 12 1,r 0 1,r 12 1,r 2 1
5353

5454
# Write to the beginning of every band and read all disk.
55-
w a 0 1,w b 3 1,w c 6 1,w d 9 1,r a__b__c__d__ 0 12:w 12 1,w 15 1,w 13 1,w 16 1,r 12 1,r 1 2,r 15 1,r 4 2,r 13 1,r 7 2,r 16 1,r 10 2
55+
w a 0,w b 3,w c 6,w d 9,r a__b__c__d__ 0:w 12 1,w 15 1,w 13 1,w 16 1,r 12 1,r 1 2,r 15 1,r 4 2,r 13 1,r 7 2,r 16 1,r 10 2
5656

5757
# Write to the middle of every band and read all disk.
58-
w a 1 1,w b 4 1,w c 7 1,w d 10 1,r _a__b__c__d_ 0 12:w 12 1,w 15 1,w 13 1,w 16 1,r 0 1,r 12 1,r 2 2,r 15 1,r 5 2,r 13 1,r 8 2,r 16 1,r 11 1
58+
w a 1,w b 4,w c 7,w d 10,r _a__b__c__d_ 0:w 12 1,w 15 1,w 13 1,w 16 1,r 0 1,r 12 1,r 2 2,r 15 1,r 5 2,r 13 1,r 8 2,r 16 1,r 11 1
5959

6060
# Write to the end of every band and read all disk.
61-
w a 2 1,w b 5 1,w c 8 1,w d 11 1,r __a__b__c__d 0 12:w 12 1,w 15 1,w 13 1,w 16 1,r 0 2,r 12 1,r 3 2,r 15 1,r 6 2,r 13 1,r 9 2,r 16 1
61+
w a 2,w b 5,w c 8,w d 11,r __a__b__c__d 0:w 12 1,w 15 1,w 13 1,w 16 1,r 0 2,r 12 1,r 3 2,r 15 1,r 6 2,r 13 1,r 9 2,r 16 1
6262

6363
# Write from left to right diagonal to first 3 bands, read all disk.
64-
w a 0 1,w b 4 1,w c 8 1,r a___b___c___ 0 12:w 12 1,w 15 1,w 13 1,r 12 1,r 1 3,r 15 1,r 5 3,r 13 1,r 9 3
64+
w a 0,w b 4,w c 8,r a___b___c___ 0:w 12 1,w 15 1,w 13 1,r 12 1,r 1 3,r 15 1,r 5 3,r 13 1,r 9 3
6565

6666
# Write from left to right diagonal to second 3 bands, read all disk.
67-
w a 3 1,w b 7 1,w c 11 1,r ___a___b___c 0 12:w 15 1,w 12 1,w 16 1,r 0 3,r 15 1,r 4 3,r 12 1,r 8 3,r 16 1
67+
w a 3,w b 7,w c 11,r ___a___b___c 0:w 15 1,w 12 1,w 16 1,r 0 3,r 15 1,r 4 3,r 12 1,r 8 3,r 16 1
6868

6969
# Write from right to left diagonal to first 3 bands, read all disk.
70-
w a 2 1,w b 4 1,w c 6 1,r __a_b_c_____ 0 12:w 12 1,w 15 1,w 13 1,r 0 2,r 12 1,r 3 1,r 15 1,r 5 1,r 13 1,r 7 5
70+
w a 2,w b 4,w c 6,r __a_b_c_____ 0:w 12 1,w 15 1,w 13 1,r 0 2,r 12 1,r 3 1,r 15 1,r 5 1,r 13 1,r 7 5
7171

7272
# Write from right to left diagonal to second 3 bands, read all disk.
73-
w a 5 1,w b 7 1,w c 9 1,r _____a_b_c__ 0 12:w 15 1,w 12 1,w 16 1,r 0 5,r 15 1,r 6 1,r 12 1,r 8 1,r 16 1,r 10 2
73+
w a 5,w b 7,w c 9,r _____a_b_c__ 0:w 15 1,w 12 1,w 16 1,r 0 5,r 15 1,r 6 1,r 12 1,r 8 1,r 16 1,r 10 2
7474

7575
# Fill every band in isolation and read all disk.
76-
w abc 0 3,r abc_________ 0 12:w 12 3,r 12 3,r 3 9
77-
w abc 3 3,r ___abc______ 0 12:w 15 3,r 0 3,r 15 3,r 6 6
78-
w abc 6 3,r ______abc___ 0 12:w 12 3,r 0 6,r 12 3,r 9 3
79-
w abc 9 3,r _________abc 0 12:w 15 3,r 0 9,r 15 3
76+
w abc 0,r abc_________ 0:w 12 3,r 12 3,r 3 9
77+
w abc 3,r ___abc______ 0:w 15 3,r 0 3,r 15 3,r 6 6
78+
w abc 6,r ______abc___ 0:w 12 3,r 0 6,r 12 3,r 9 3
79+
w abc 9,r _________abc 0:w 15 3,r 0 9,r 15 3
8080

8181
# Fill every two bands without causing GC and read all disk.
82-
w abc 0 3,w def 3 3,r abcdef______ 0 12:w 12 3,w 15 3,r 12 6,r 6 6
83-
w def 3 3,w abc 0 3,r abcdef______ 0 12:w 15 3,w 12 3,r 12 6,r 6 6
84-
w abc 0 3,w def 9 3,r abc______def 0 12:w 12 3,w 15 3,r 12 3,r 3 6,r 15 3
85-
w def 9 3,w abc 0 3,r abc______def 0 12:w 15 3,w 12 3,r 12 3,r 3 6,r 15 3
86-
w abc 3 3,w def 6 3,r ___abcdef___ 0 12:w 15 3,w 12 3,r 0 3,r 15 3,r 12 3,r 9 3
87-
w def 6 3,w abc 3 3,r ___abcdef___ 0 12:w 12 3,w 15 3,r 0 3,r 15 3,r 12 3,r 9 3
88-
w abc 6 3,w def 9 3,r ______abcdef 0 12:w 12 3,w 15 3,r 0 6,r 12 6
89-
w def 9 3,w abc 6 3,r ______abcdef 0 12:w 15 3,w 12 3,r 0 6,r 12 6
82+
w abc 0,w def 3,r abcdef______ 0:w 12 3,w 15 3,r 12 6,r 6 6
83+
w def 3,w abc 0,r abcdef______ 0:w 15 3,w 12 3,r 12 6,r 6 6
84+
w abc 0,w def 9,r abc______def 0:w 12 3,w 15 3,r 12 3,r 3 6,r 15 3
85+
w def 9,w abc 0,r abc______def 0:w 15 3,w 12 3,r 12 3,r 3 6,r 15 3
86+
w abc 3,w def 6,r ___abcdef___ 0:w 15 3,w 12 3,r 0 3,r 15 3,r 12 3,r 9 3
87+
w def 6,w abc 3,r ___abcdef___ 0:w 12 3,w 15 3,r 0 3,r 15 3,r 12 3,r 9 3
88+
w abc 6,w def 9,r ______abcdef 0:w 12 3,w 15 3,r 0 6,r 12 6
89+
w def 9,w abc 6,r ______abcdef 0:w 15 3,w 12 3,r 0 6,r 12 6
9090

9191
# Write cross-band, read back.
92-
w abc 1 3,r abc 1 3:w 12 2,w 15 1,r 12 2,r 15 1
93-
w abc 2 3,r abc 2 3:w 12 1,w 15 2,r 12 1,r 15 2
92+
w abc 1,r abc 1:w 12 2,w 15 1,r 12 2,r 15 1
93+
w abc 2,r abc 2:w 12 1,w 15 2,r 12 1,r 15 2
9494

9595
################################################################################
9696
#
@@ -101,21 +101,21 @@ w abc 2 3,r abc 2 3:w 12 1,w 15 2,r 12 1,r 15 2
101101

102102
# Simplest GC test. Fill each band one block at a time and do another block
103103
# write at the first block of the band.
104-
w a 0 1,w b 1 1,w c 2 1,w d 0 1,r dbc_ 0 4:w 12 1,w 13 1,w 14 1,r 0 1,r 1 1,r 2 1,r 12 1,r 13 1,r 14 1,w 0 1,w 1 1,w 2 1,w 12 1,r 12 1,r 1 3
105-
w a 3 1,w b 4 1,w c 5 1,w d 3 1,r ___dbc_ 0 7:w 15 1,w 16 1,w 17 1,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,w 15 1,r 0 3,r 15 1,r 4 3
106-
w a 6 1,w b 7 1,w c 8 1,w d 6 1,r ______dbc_ 0 10:w 12 1,w 13 1,w 14 1,r 6 1,r 7 1,r 8 1,r 12 1,r 13 1,r 14 1,w 6 1,w 7 1,w 8 1,w 12 1,r 0 6,r 12 1,r 7 3
107-
w a 9 1,w b 10 1,w c 11 1,w d 9 1,r _________dbc 0 12:w 15 1,w 16 1,w 17 1,r 9 1,r 10 1,r 11 1,r 15 1,r 16 1,r 17 1,w 9 1,w 10 1,w 11 1,w 15 1,r 0 9,r 15 1,r 10 2
104+
w a 0,w b 1,w c 2,w d 0,r dbc_ 0:w 12 1,w 13 1,w 14 1,r 0 1,r 1 1,r 2 1,r 12 1,r 13 1,r 14 1,w 0 1,w 1 1,w 2 1,w 12 1,r 12 1,r 1 3
105+
w a 3,w b 4,w c 5,w d 3,r ___dbc_ 0:w 15 1,w 16 1,w 17 1,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,w 15 1,r 0 3,r 15 1,r 4 3
106+
w a 6,w b 7,w c 8,w d 6,r ______dbc_ 0:w 12 1,w 13 1,w 14 1,r 6 1,r 7 1,r 8 1,r 12 1,r 13 1,r 14 1,w 6 1,w 7 1,w 8 1,w 12 1,r 0 6,r 12 1,r 7 3
107+
w a 9,w b 10,w c 11,w d 9,r _________dbc 0:w 15 1,w 16 1,w 17 1,r 9 1,r 10 1,r 11 1,r 15 1,r 16 1,r 17 1,w 9 1,w 10 1,w 11 1,w 15 1,r 0 9,r 15 1,r 10 2
108108

109109
# Same as above, but fill the band at once.
110-
w abc 0 3,w d 0 1,r dbc_ 0 4:w 12 3,r 0 1,r 1 1,r 2 1,r 12 1,r 13 1,r 14 1,w 0 1,w 1 1,w 2 1,w 12 1,r 12 1,r 1 3
111-
w abc 3 3,w d 3 1,r ___dbc_ 0 7:w 15 3,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,w 15 1,r 0 3,r 15 1,r 4 3
112-
w abc 6 3,w d 6 1,r ______dbc_ 0 10:w 12 3,r 6 1,r 7 1,r 8 1,r 12 1,r 13 1,r 14 1,w 6 1,w 7 1,w 8 1,w 12 1,r 0 6,r 12 1,r 7 3
113-
w abc 9 3,w d 9 1,r _________dbc 0 12:w 15 3,r 9 1,r 10 1,r 11 1,r 15 1,r 16 1,r 17 1,w 9 1,w 10 1,w 11 1,w 15 1,r 0 9,r 15 1,r 10 2
110+
w abc 0,w d 0,r dbc_ 0:w 12 3,r 0 1,r 1 1,r 2 1,r 12 1,r 13 1,r 14 1,w 0 1,w 1 1,w 2 1,w 12 1,r 12 1,r 1 3
111+
w abc 3,w d 3,r ___dbc_ 0:w 15 3,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,w 15 1,r 0 3,r 15 1,r 4 3
112+
w abc 6,w d 6,r ______dbc_ 0:w 12 3,r 6 1,r 7 1,r 8 1,r 12 1,r 13 1,r 14 1,w 6 1,w 7 1,w 8 1,w 12 1,r 0 6,r 12 1,r 7 3
113+
w abc 9,w d 9,r _________dbc 0:w 15 3,r 9 1,r 10 1,r 11 1,r 15 1,r 16 1,r 17 1,w 9 1,w 10 1,w 11 1,w 15 1,r 0 9,r 15 1,r 10 2
114114

115115
# Fill each band at once, then write to another band that shares the cache band
116116
# and read all disk.
117-
w abc 0 3,w d 6 1,r abc___d_ 0 8:w 12 3,r 0 1,r 1 1,r 2 1,r 12 1,r 13 1,r 14 1,w 0 1,w 1 1,w 2 1,w 12 1,r 0 6,r 12 1,r 7 1
118-
w abc 3 3,w d 9 1,r ___abc___d__ 0 12:w 15 3,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,w 15 1,r 0 9,r 15 1,r 10 2
117+
w abc 0,w d 6,r abc___d_ 0:w 12 3,r 0 1,r 1 1,r 2 1,r 12 1,r 13 1,r 14 1,w 0 1,w 1 1,w 2 1,w 12 1,r 0 6,r 12 1,r 7 1
118+
w abc 3,w d 9,r ___abc___d__ 0:w 15 3,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,w 15 1,r 0 9,r 15 1,r 10 2
119119

120120
################################################################################
121121
#
@@ -126,9 +126,9 @@ w abc 3 3,w d 9 1,r ___abc___d__ 0 12:w 15 3,r 3 1,r 4 1,r 5 1,r 15 1,r 16 1,r 1
126126

127127
# Write enough to two bands sharing the cache band to cause GC and then read the
128128
# whole disk.
129-
w b 8 1,w a 1 1,w c 6 1,w x 0 1,r xa____c_b___ 0 12:w 12 1,w 13 1,w 14 1,r 0 1,r 1 1,r 2 1,r 13 1,w 0 1,w 1 1,w 2 1,r 6 1,r 7 1,r 8 1,r 14 1,r 12 1,w 6 1,w 7 1,w 8 1,w 12 1,r 12 1,r 1 11
130-
w x 10 1,w ab 3 2,w z 9 1,r ___ab____zx_ 0 12:w 15 1,w 16 2,r 3 1,r 4 1,r 5 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,r 9 1,r 10 1,r 11 1,r 15 1,w 9 1,w 10 1,w 11 1,w 15 1,r 0 9,r 15 1,r 10 2
129+
w b 8,w a 1,w c 6,w x 0,r xa____c_b___ 0:w 12 1,w 13 1,w 14 1,r 0 1,r 1 1,r 2 1,r 13 1,w 0 1,w 1 1,w 2 1,r 6 1,r 7 1,r 8 1,r 14 1,r 12 1,w 6 1,w 7 1,w 8 1,w 12 1,r 12 1,r 1 11
130+
w x 10,w ab 3,w z 9,r ___ab____zx_ 0:w 15 1,w 16 2,r 3 1,r 4 1,r 5 1,r 16 1,r 17 1,w 3 1,w 4 1,w 5 1,r 9 1,r 10 1,r 11 1,r 15 1,w 9 1,w 10 1,w 11 1,w 15 1,r 0 9,r 15 1,r 10 2
131131

132132
# Write to two bands sharing the cache band, then do another band-crossing write
133133
# that will cause RMW of two bands and a write to another band.
134-
w a 4 1,w dx 9 2,w fo 5 2,r ____afo__dx_ 0 12:w 15 1,w 16 2,r 3 1,r 4 1,r 5 1,r 15 1,w 3 1,w 4 1,w 5 1,r 9 1,r 10 1,r 11 1,r 16 1,r 17 1,w 9 1,w 10 1,w 11 1,w 15 1,w 12 1,r 0 5,r 15 1,r 12 1,r 7 5
134+
w a 4,w dx 9,w fo 5,r ____afo__dx_ 0:w 15 1,w 16 2,r 3 1,r 4 1,r 5 1,r 15 1,w 3 1,w 4 1,w 5 1,r 9 1,r 10 1,r 11 1,r 16 1,r 17 1,w 9 1,w 10 1,w 11 1,w 15 1,w 12 1,r 0 5,r 15 1,r 12 1,r 7 5

test.go

+15-18
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ func tearDown() {
123123
}
124124

125125
// Allocates aligned blocks for direct I/O.
126-
func alignedBlocks(count int, pattern string) []byte {
126+
func alignedBlocks(pattern string) []byte {
127+
count := len(pattern)
127128
b := make([]byte, pageSize+blockSize*count)
128129
a := int(uintptr(unsafe.Pointer(&b[0])) & (pageSize - 1))
129130

@@ -141,9 +142,10 @@ func alignedBlocks(count int, pattern string) []byte {
141142
return b
142143
}
143144

144-
// Writes |count| number of blocks filled with |c|, starting at |blockNo|.
145-
func writeBlocks(f *os.File, blockNo, count int, pattern string) string {
146-
b := alignedBlocks(count, pattern)
145+
// Writes |len(pattern)| number of blocks filled with |pattern[i]|, starting at
146+
// |blockNo|.
147+
func writeBlocks(f *os.File, blockNo int, pattern string) string {
148+
b := alignedBlocks(pattern)
147149

148150
offset := int64(blockNo * blockSize)
149151
if _, err := f.WriteAt(b, offset); err != nil {
@@ -152,10 +154,11 @@ func writeBlocks(f *os.File, blockNo, count int, pattern string) string {
152154
return ""
153155
}
154156

155-
// Reads |count| number of blocks starting at |blockNo| and verifies that the
156-
// read blocks' contents match the |pattern|.
157-
func readBlocks(f *os.File, blockNo, count int, pattern string) string {
158-
b := alignedBlocks(count, strings.Repeat("!", count))
157+
// Reads |len(pattern)| number of blocks starting at |blockNo| and verifies that
158+
// the read blocks' contents match the |pattern|.
159+
func readBlocks(f *os.File, blockNo int, pattern string) string {
160+
count := len(pattern)
161+
b := alignedBlocks(strings.Repeat("!", count))
159162

160163
offset := int64(blockNo * blockSize)
161164
if _, err := f.ReadAt(b, offset); err != nil {
@@ -196,7 +199,7 @@ func doResetDisk() {
196199
}
197200
defer f.Close()
198201

199-
b := alignedBlocks(1, "\x00")
202+
b := alignedBlocks("\x00")
200203
for i := 0; i < diskSize/blockSize; i++ {
201204
if _, err := f.Write(b); err != nil {
202205
panicf("Failed to write to %s: %v", blockDevice, err)
@@ -206,7 +209,7 @@ func doResetDisk() {
206209

207210
// Verifies syntax of the tests.
208211
func verify(tests []string) {
209-
var userCmdRegexp = regexp.MustCompile(`^[wr]\s[a-z_]+\s\d+\s\d+$`)
212+
var userCmdRegexp = regexp.MustCompile(`^[wr]\s[a-z_]+\s\d+$`)
210213
var btEventRegexp = regexp.MustCompile(`^[wr]\s\d+\s\d+$`)
211214

212215
fmt.Println("Verifying syntax of tests...")
@@ -218,11 +221,6 @@ func verify(tests []string) {
218221
if !userCmdRegexp.MatchString(c) {
219222
panicf("Bad user command %d: %s", i, c)
220223
}
221-
f := strings.Fields(c)
222-
n, _ := strconv.Atoi(f[3])
223-
if len(f[1]) != n {
224-
panicf("Bad user command %d: %s", i, c)
225-
}
226224
}
227225
for _, e := range strings.Split(btEvents, ",") {
228226
if !btEventRegexp.MatchString(e) {
@@ -237,13 +235,12 @@ func doUserCmd(f *os.File, cmd string) string {
237235
fs := strings.Fields(cmd)
238236
operation, pattern := fs[0], fs[1]
239237
offset, _ := strconv.Atoi(fs[2])
240-
count, _ := strconv.Atoi(fs[3])
241238

242239
var s string
243240
if operation == "w" {
244-
s = writeBlocks(f, offset, count, pattern)
241+
s = writeBlocks(f, offset, pattern)
245242
} else {
246-
s = readBlocks(f, offset, count, pattern)
243+
s = readBlocks(f, offset, pattern)
247244
}
248245
if s != "" {
249246
s += " [" + cmd + "]"

0 commit comments

Comments
 (0)