changeset 19168:9163a6e9b096

Use unsetenv to fix libgomp error created by nproc BIST testing. * nproc.cc (Fnproc): Use unsetenv to delete OMP_NUM_THREADS environment variable after testing. * test/system.tst: Rename putenv to setenv in %!tests.
author Rik <rik@octave.org>
date Sat, 27 Sep 2014 12:47:37 -0700
parents 6f0290863d50
children 1faae07afbd8
files libinterp/corefcn/nproc.cc test/system.tst
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/nproc.cc	Sat Sep 27 12:26:57 2014 -0700
+++ b/libinterp/corefcn/nproc.cc	Sat Sep 27 12:47:37 2014 -0700
@@ -101,7 +101,7 @@
 %!   if (! isempty (old_val))
 %!     setenv ("OMP_NUM_THREADS", old_val);
 %!   else
-%!     setenv ("OMP_NUM_THREADS", "");
+%!     unsetenv ("OMP_NUM_THREADS");
 %!   endif
 %! end_unwind_protect
 
--- a/test/system.tst	Sat Sep 27 12:26:57 2014 -0700
+++ b/test/system.tst	Sat Sep 27 12:47:37 2014 -0700
@@ -280,16 +280,16 @@
 %! warning (wns.state, "Octave:num-to-str");
 
 %!test
-%! putenv ("foobar", "baz");
+%! setenv ("foobar", "baz");
 %! assert (getenv ("foobar"), "baz");
 
-%!error <Invalid call to putenv> putenv ()
-%!error <Invalid call to putenv> putenv ("foo", "bar", 1)
+%!error <Invalid call to setenv> setenv ()
+%!error <Invalid call to setenv> setenv ("foo", "bar", 1)
 
 %!test
 %! wns = warning ("query", "Octave:num-to-str");
 %! warning ("on", "Octave:num-to-str");
-%! fail ("putenv (1, 2)","warning");
+%! fail ("setenv (1, 2)","warning");
 %! warning (wns.state, "Octave:num-to-str");
 
 %!test