octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test failure


From: John W. Eaton
Subject: test failure
Date: Fri, 23 Jan 2009 15:40:39 -0500

OK, now I'm seeing the following test failures:

    ***** test # replace base m-file
   echo_to_file ('function a=dispatch_x(a)', "dispatch_x.m");
   dispatch('dispatch_x','length','string')
   assert(dispatch_x(3),3)
   assert(dispatch_x("a"),1)
   sleep (2);
   echo_to_file ('function a=dispatch_x(a),++a;', "dispatch_x.m");
   rehash();
   assert(dispatch_x(3),4)
   assert(dispatch_x("a"),1)
  !!!!! test failed
  `dispatch_x' undefined near line 5 column 9

    ***** assert(log2(complex(0,Inf)), Inf + log2(i));
  !!!!! test failed
  assert (log2 (complex (0, Inf)),Inf + log2 (i)) expected
  Inf + 2.266i
  but got
  Inf - NaNi
  NaNs don't match

The second one is not new, and I'm not concerned about it because I
think it is a C math library issue.

I'm not sure what is causing the first one to fail.  The function
echo_to_file is defined with the tests in dispatch.cc and is

  function echo_to_file (str, name)
    fid = fopen (name, 'w');
    if (fid != -1)
      fprintf (fid, str);
      fprintf (fid, '\n');
      fclose (fid);
    endif
  endfunction

If I define this function and then run the tests

  echo_to_file ('function a=dispatch_x(a)', "dispatch_x.m");
  dispatch('dispatch_x','length','string')
  assert(dispatch_x(3),3)
  assert(dispatch_x("a"),1)
  sleep (2);
  echo_to_file ('function a=dispatch_x(a),++a;', "dispatch_x.m");
  rehash();
  assert(dispatch_x(3),4)
  assert(dispatch_x("a"),1)

  echo_to_file ('function a=dispatch_x(a)', "dispatch_x.m");
  dispatch('dispatch_x','length','string')
  assert(dispatch_x(3),3)
  assert(dispatch_x("a"),1)
  echo_to_file ('function a=dispatch_x(a),++a;', "dispatch_x.m");
  rehash();
  assert(dispatch_x(3),4)
  assert(dispatch_x("a"),1)

by hand (cut and paste to the Octave prompt) it appears to succeed
consistently.  Without the call to sleep, I consistently see this
failure:

  octave> echo_to_file ('function a=dispatch_x(a)', "dispatch_x.m");
  octave> dispatch('dispatch_x','length','string')
  octave> assert(dispatch_x(3),3)
  octave> assert(dispatch_x("a"),1)
  octave> echo_to_file ('function a=dispatch_x(a),++a;', "dispatch_x.m");
  octave> rehash();
  octave> assert(dispatch_x(3),4)
  error: assert (dispatch_x (3),4) expected
   4
  but got
   3
  values do not match
  error: called from:
  error:   /home/jwe/src/octave/scripts/testfun/assert.m at line 209, column 5
  octave> assert(dispatch_x("a"),1)

This failure is different from the one I see when running the tests
with Make, but there does seem to be a timing issue.  Perhaps that is
also causing dispatch_x to not be defined above?

In addition to this mode of failure, sometimes the dispatch.cc tests
appear to hang indefinitely on my system, and I have no idea what is
causing that.

If there is a race condition here, I don't understand why.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]