octave-maintainers
[Top][All Lists]
Advanced

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

Re: failing tests in tip


From: Jaroslav Hajek
Subject: Re: failing tests in tip
Date: Fri, 13 Mar 2009 18:19:43 +0100

On Fri, Mar 13, 2009 at 5:07 PM, John W. Eaton <address@hidden> wrote:
> On 13-Mar-2009, Jaroslav Hajek wrote:
>
> | I fixed those tests using "full". Still, my comment is valid - there
> | is no good way to test for
> | exact numeric equality. What about the following small patch? It seems
> | that this was the intention
> | after all, judging by the surrounding code.
>
> | # HG changeset patch
> | # User Jaroslav Hajek <address@hidden>
> | # Date 1236959387 -3600
> | # Node ID d4aa946efab7a9705cb78dd5175b56bc4e334b0b
> | # Parent  2e9af33636694e611a08e4f00c70c13491d180b7
> | have zero tolerance force numeric assert
> |
> | diff --git a/scripts/testfun/assert.m b/scripts/testfun/assert.m
> | --- a/scripts/testfun/assert.m
> | +++ b/scripts/testfun/assert.m
> | @@ -141,7 +141,7 @@
> |        iserror = 1;
> |        coda = "Dimensions don't match";
> |
> | -    elseif (tol == 0 && ! strcmp (typeinfo (cond), typeinfo (expected)))
> | +    elseif (nargin < 3 && ! strcmp (typeinfo (cond), typeinfo (expected)))
> |        iserror = 1;
> |        coda = cstrcat ("Type ", typeinfo (cond), " != ", typeinfo 
> (expected));
>
> Maybe I'm missing something, but how does that change the behavior of
> assert given the
>
>    if (nargin < 3)
>      tol = 0;
>
> block near the beginning of the function?
>
> jwe
>
>

assert (var1, var2, 0) will then force a numeric check (no typeinfos).
At least I don't see what's wrong.



-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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