shopsuite-dev
[Top][All Lists]
Advanced

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

Re: [ShopSuite-dev] new rational.c, check it


From: Tomasz Wegrzanowski
Subject: Re: [ShopSuite-dev] new rational.c, check it
Date: Thu, 23 Aug 2001 01:38:08 +0200
User-agent: Mutt/1.3.20i

On Wed, Aug 22, 2001 at 03:32:51PM +0100, Davi Leal wrote:
> > What about making automatic test in two files ?
> >     rational/test/queries.sql
> >     rational/test/expected.out
> >
> > That would help a lot.
> 
> Great idea, however, are two files needed?. What do you think about only using
> rational/checks.sql with the expected value as a "SELECT (expected value);" 
> query?.
> So both the expected and the got value must be the same, and the user checks 
> it
> easily due to both appears in adjacent lines. (I will be today evening at irc,
> therefore, if you will be there, we will be able to discus the minor details).

So you can do `make test' and it will check if two files are identical.

> Please, run the test set before sending rational.c to the dev list.

Here is test.psql and test.out for current version and current
version. Addition and substraction on negatives are broken.
All other operations seem to work.

I'll have to add tests on overflow later.

> 3. Converted to Not-A-Number
>     Invalid Number:
>         numerator   != 0
>       denominator == 0
>     Conversion algorithm:
>       numerator = 1
> <       numerator = 1      <------- Must be converted to 0 ???
> <                         As above:
> <                             3. Not-A-Number
> <                                 numerator   == 0
> <                                 denominator == 0

right

3. Converted to Not-A-Number                                                    
             
    Invalid Number:                                                             
             
        numerator   != 0                                                        
             
        denominator == 0                                                        
             
    Conversion algorithm:                                                       
             
        numerator = 0  

> Undef is not equal to any other rational number.
> Results of other comparisions between undef and non-undef are undefined,
> but they must be consintent and commutators and negators must be preserved.

One more detail.
Mahematical assertions:
     (a>=b) == (a>b || a==b)
     (a<=b) == (a<b || a==b)
are currenly broken if any of arguments are undef
I'll have to fix it.

Attachment: test.sql
Description: Text document

Attachment: test.out
Description: Text document

Attachment: rational.c
Description: Text Data


reply via email to

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