Mercurial > octave-nkf
comparison test/io.tst @ 18210:77fa327a956d gui-release
maint: Periodic merge of stable to gui-release.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 03 Jan 2014 17:32:56 -0500 |
parents | 85d45717b28d a0abcf377ec5 |
children | 39fbe4aba560 |
comparison
equal
deleted
inserted
replaced
18184:d03a6d272fee | 18210:77fa327a956d |
---|---|
530 | 530 |
531 %!error <Invalid call to frewind> frewind () | 531 %!error <Invalid call to frewind> frewind () |
532 %!error <Invalid call to frewind> frewind (1, 2) | 532 %!error <Invalid call to frewind> frewind (1, 2) |
533 %!error frewind ("foo") | 533 %!error frewind ("foo") |
534 | 534 |
535 %!test | |
536 %! id = tmpfile (); | |
537 %! fwrite (id, "abcdefg"); | |
538 %! frewind (id); | |
539 %! [data, count] = fread (id); | |
540 %! assert (data, [97; 98; 99; 100; 101; 102; 103]); | |
541 %! assert (count, 7); | |
542 %! frewind (id); | |
543 %! [data, count] = fread (id, 'int16'); | |
544 %! assert (data, [25185; 25699; 26213]); | |
545 %! assert (count, 3); | |
546 %! frewind (id); | |
547 %! [data, count] = fread (id, [10, 2], 'int16'); | |
548 %! assert (data, [25185; 25699; 26213]); | |
549 %! assert (count, 3); | |
550 %! frewind (id); | |
551 %! [data, count] = fread (id, [2, 10], 'int16'); | |
552 %! assert (data, [25185, 26213; 25699, 0]); | |
553 %! assert (count, 3); | |
554 %! fclose (id); |