Mercurial > octave
diff test/io.tst @ 19278:6ca096827123
Use tempname() rather than tmpnam() in core Octave.
* scripts/miscellaneous/tempname.m: Removed m-file as function is now C++.
* scripts/miscellaneous/tmpnam.m: New m-file is an alias that calls tempname.
* scripts/miscellaneous/module.mk: Add tmpnam.m to build system.
* io.txi: Place tempname, tempdir, P_tmpdir docstrings in section on temporary
files.
* system.txi: Remove tempname, tempdir, P_tmpdir docstrings from generic
system functions section of manual.
* dirfns.cc, dlmread.cc, md5sum.cc, ov-fcn-handle.cc: Replace instances
of tmpnam with tempname in BIST code.
* file-io.cc (Ftempname): Change DEFUNX for tmpnam to DEFUN for tempname.
Remove seealso links to tmpnam.
* ftp.m, playaudio.m, wavwrite.m, imformats.m, imread.m, imwrite.m, imageIO.m,
csvwrite.m, dlmwrite.m, fileread.m, importdata.m, textread.m, textscan.m,
genvarname.m, unpack.m, install.m, legend.m, __gnuplot_drawnow__.m,
copyobj.m, hgsave.m, print.m, __ghostscript__.m, __gnuplot_get_var__.m,
__gnuplot_ginput__.m, __gnuplot_print__.m: Replace tmpnam with tempname in
core code.
* build-sparse-tests.sh, io.tst, prefer.tst, system.tst: Replace tmpnam with
tempname in test code.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 22 Oct 2014 10:41:15 -0700 |
parents | f1b91e3137b9 |
children | 112fc552ea22 |
line wrap: on
line diff
--- a/test/io.tst Tue Oct 21 14:37:44 2014 -0400 +++ b/test/io.tst Wed Oct 22 10:41:15 2014 -0700 @@ -295,7 +295,7 @@ %% Note use fprintf so output not sent to stdout %!test -%! nm = tmpnam (); +%! nm = tempname (); %! fid1 = fopen (nm,"w"); %! x = fprintf (fid1, "%s: %d\n", "test", 1); %! fclose (fid1); @@ -340,7 +340,7 @@ %! elseif (j == 4) %! mode_list = {"W+"; "R+"; "A+"}; %! endif -%! nm = tmpnam (); +%! nm = tempname (); %! for k = 1:3 %! mode = mode_list{k}; %! [id, err] = fopen (nm, mode, arch); @@ -397,12 +397,12 @@ %!error fclose (0) %!error <Invalid call to fclose> fclose (1, 2) -%!assert (ischar (tmpnam ())) +%!assert (ischar (tempname ())) -%!warning tmpnam (1); -%!warning tmpnam ("foo", 1); +%!warning tempname (1); +%!warning tempname ("foo", 1); -%!error <Invalid call to tmpnam> tmpnam (1, 2, 3) +%!error <Invalid call to tempname> tempname (1, 2, 3) %!test %! type_list = ["char"; "char*1"; "integer*1"; "int8"; @@ -413,7 +413,7 @@ %! "real*8"; "int16"; "integer*2"; "int32"; "integer*4"]; %! %! n = rows (type_list); -%! nm = tmpnam (); +%! nm = tempname (); %! id = fopen (nm, "wb"); %! if (id > 0) %! for i = 1:n @@ -440,7 +440,7 @@ %!test %! x = char (128:255)'; -%! nm = tmpnam (); +%! nm = tempname (); %! id = fopen (nm, "wb"); %! fwrite (id, x); %! fclose (id); @@ -451,7 +451,7 @@ %! assert (x, y); %!test -%! nm = tmpnam (); +%! nm = tempname (); %! id = fopen (nm, "wb"); %! if (id > 0) %! fprintf (id, "%d\n", 1:100);