equal
deleted
inserted
replaced
68 |
68 |
69 "Created: / 12.8.1998 / 13:25:25 / cg" |
69 "Created: / 12.8.1998 / 13:25:25 / cg" |
70 ! |
70 ! |
71 |
71 |
72 doTestWrite:size |
72 doTestWrite:size |
73 "basic writing" |
73 "basic writing. writes a chunk of data and reads it back to verify its written correctly |
|
74 Called with different sizes and interrupted while writing" |
74 |
75 |
75 |file s sz buffer byte| |
76 |file s sz buffer byte| |
76 |
77 |
77 buffer := ByteArray new:size. |
78 buffer := ByteArray new:size. |
78 1 to:buffer size do:[:idx | |
79 1 to:buffer size do:[:idx | |
260 [p isDead] whileFalse:[ |
261 [p isDead] whileFalse:[ |
261 Delay waitForMilliseconds:5. |
262 Delay waitForMilliseconds:5. |
262 p interruptWith:[count := count + 1]. |
263 p interruptWith:[count := count + 1]. |
263 ]. |
264 ]. |
264 self assert:errorOccured isNil. |
265 self assert:errorOccured isNil. |
265 ('read file <1p> times; interrupted <2p> times' |
266 self assert:count > 50. "/ at least 50 times interrupted... |
266 expandMacrosWith:nLoop with:count) printCR |
267 "/ Transcript printf:'read file %d times; interrupted %d times\n' with:nLoop with:count. |
267 |
268 |
268 " |
269 " |
269 self new testRead3 |
270 self new testRead3 |
270 " |
271 " |
271 |
272 |
465 |
466 |
466 !FileStreamTest class methodsFor:'documentation'! |
467 !FileStreamTest class methodsFor:'documentation'! |
467 |
468 |
468 version |
469 version |
469 ^ '$Header$' |
470 ^ '$Header$' |
|
471 ! |
|
472 |
|
473 version_CVS |
|
474 ^ '$Header$' |
470 ! ! |
475 ! ! |
471 |
476 |