octave-maintainers
[Top][All Lists]
Advanced

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

make check fails for CVS


From: John W. Eaton
Subject: make check fails for CVS
Date: Tue, 8 Feb 2005 13:09:44 -0500

On  7-Feb-2005, Todd Neal <address@hidden> wrote:

| "make check" fails for the current CVS version.  The problem is with
| dec2base.m:
| 
| Running ./octave.test/string/string.exp ...
| FAIL: octave.test/string/dec2bin-3.m
| FAIL: octave.test/string/dec2hex-3.m
| 
| 
| 
| In dec2base.m this check ignores the len argument:
| 
| 92    ## Check if the first element is the zero symbol
| 93    if (all (retval(:,1) == symbols(1)))
| 94      retval = retval(:,2:end);
| 95    endif

Thanks for the report and patch.

I fixed this in a slightly different way.

jwe


scripts/ChangeLog:

2005-02-08  John W. Eaton  <address@hidden>

        * strings/dec2base.m: Don't delete leading zero if third arg is
        provided and len <= computed max_len.


Index: scripts/strings/dec2base.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/strings/dec2base.m,v
retrieving revision 1.5
diff -u -r1.5 dec2base.m
--- scripts/strings/dec2base.m  27 Jan 2005 17:50:57 -0000      1.5
+++ scripts/strings/dec2base.m  8 Feb 2005 18:03:19 -0000
@@ -89,8 +89,13 @@
   ## convert digits to symbols
   retval = reshape (symbols (digits+1), size (digits));
 
-  ## Check if the first element is the zero symbol
-  if (all (retval(:,1) == symbols(1)))
+  ## Check if the first element is the zero symbol. It seems possible
+  ## that LEN is provided, and is less than the computed MAX_LEN and
+  ## MAX_LEN is computed to be one larger than necessary, so we would
+  ## have a leading zero to remove.  But if LEN >= MAX_LEN, we should
+  ## not remove any leading zeros.
+  if ((nargin == 2 || (nargin == 3 && max_len > len))
+      && all (retval(:,1) == symbols(1)))
     retval = retval(:,2:end);
   endif
 



reply via email to

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