Re: Email to hackers for test coverage

From: Ahsan Hadi <ahsan(dot)hadi(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: "movead(dot)li(at)highgo(dot)ca" <movead(dot)li(at)highgo(dot)ca>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Email to hackers for test coverage
Date: 2019-08-29 11:47:31
Message-ID: CA+9bhCKstL735McysasePHftun=NbwKrfTMWCVhtX4DHRA4diw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 28, 2019 at 9:43 PM Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:

> On 2019-08-22 11:46, movead(dot)li(at)highgo(dot)ca wrote:
> > *1. src/include/utils/float.h:140*
> >
> > Analyze:
> > This is an error report line when converting a big float8 value
> > which a float4 can not storage to float4.
> >
> > Test case:
> > Add a test case as below in file float4.sql:
> > select float4(1234567890123456789012345678901234567890::float8);
>
> > +-- Add test case for float4() type fonversion function
>
> Check spelling
>
> > *2. src/include/utils/float.h:145*
> >
> > Analyze:
> > This is an error report line when converting a small float8 value
> > which a float4 can not storage to float4.
> >
> > Test case:
> > Add a test case as below in file float4.sql:
> > select float4(0.0000000000000000000000000000000000000000000001::float8);
> >
> > *3.src/include/utils/sortsupport.h:264*
> >
> > Analyze:
> > It is reverse sorting for the data type that has abbreviated for
> > sort, for example macaddr, uuid, numeric, network and I choose
> > numeric to do it.
> >
> > Test cast:
> > Add a test case as below in file numeric.sql:
> > INSERT INTO num_input_test(n1) values('99999999999999999999999999.998');
> > INSERT INTO num_input_test(n1) values('99999999999999999999999999.997');
> > SELECT * FROM num_input_test ORDER BY n1 DESC;
>
> > INSERT INTO num_input_test(n1) VALUES (' nan');
> > +INSERT INTO num_input_test(n1) values('99999999999999999999999999.998');
> > +INSERT INTO num_input_test(n1) values('99999999999999999999999999.997');
>
> Make spaces and capitalization match surrounding code.
>
> > Result and patch
> >
> > By adding the test cases, the test coverage of float.h increased from
> > 97.7% to 100% and sortsupport.h increased from 76.7% to 80.0%.
>
> That's fine, but I suggest that if you really want to make an impact in
> test coverage, look to increase function coverage rather than line
> coverage. Or look for files that are not covered at all.
>
>
+1

> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2019-08-29 12:09:33 Re: Zedstore - compressed in-core columnar storage
Previous Message fn ln 2019-08-29 11:39:39 Re: BUG #15977: Inconsistent behavior in chained transactions