1// ============================================================================= 2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3// Copyright (C) 2011 - DIGITEO - Bruno JOFRET 4// 5// This file is distributed under the same license as the Scilab package. 6// ============================================================================= 7// 8// <-- ENGLISH IMPOSED --> 9// 10// <-- CLI SHELL MODE --> 11// 12testFile=TMPDIR + '/testFile.bin'; 13fd = mopen(testFile,'wb'); 14// file should be empty 15if mtell(fd) <> 0 then bugmes();quit;end 16for j=1:100 17 for i=1:j 18 mput(i,'d'); 19 end 20 // 'd' is 8 bytes 21 if mtell(fd) <> 8 * j then bugmes();quit;end 22 mseek(0); 23end 24mclose(fd); 25try 26 mtell(fd); 27catch 28 errorMessage = sprintf(gettext("%s: Error while opening, reading or writing.\n"), "mtell"); 29 [message, ierr]=lasterror(); 30 if message <> errorMessage then bugmes();quit;end 31end 32fd = mopen(testFile,'wb'); 33// file should be empty 34if mtell(fd) <> 0 then bugmes();quit;end 35for j=1:100 36 for i=1:j 37 mput(i,'us'); 38 end 39 // 'us' is 2 bytes 40 if mtell(fd) <> 2 * j then bugmes();quit;end 41 mseek(0); 42end 43mclose(fd); 44fd = mopen(testFile,'wb'); 45// file should be empty 46if mtell(fd) <> 0 then bugmes();quit;end 47for j=1:100 48 for i=1:j 49 mput(i,'ul'); 50 end 51 // 'ul' is 8 bytes 52 if mtell(fd) <> 8 * j then bugmes();quit;end 53 mseek(0); 54end 55mclose(fd); 56