Re: [chrony-dev] [PATCH v5 5/5] test/unit: add leapdb test

2024-02-11 Thread Miroslav Lichvar
On Mon, Feb 12, 2024 at 08:20:46AM +1100, Patrick Oppenlander wrote:
> Thanks for resolving those remaining issues. Looks like I should have
> been running a few more tests beyond "make check". How do you run the
> static analyser?

There is test/compilation/002-scanbuild in the repository to run
the clang static analyzer in few different chrony configurations.

I also run a Coverity scan we have access to at Red Hat before each
release. I think they provide a free service for open source projects,
but I'm not sure how that works.

-- 
Miroslav Lichvar


-- 
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].



Re: [chrony-dev] [PATCH v5 5/5] test/unit: add leapdb test

2024-02-11 Thread Patrick Oppenlander
On Fri, Feb 9, 2024 at 2:28 AM Miroslav Lichvar  wrote:
>
> On Thu, Feb 08, 2024 at 02:36:29PM +1100, [email protected] wrote:
> > +} tests[] = {
> > +  /* leapdb.list is a cut down version of leap-seconds.list */
> > +  {3439756800, 34, LEAP_InsertSecond, 0}, /* 1 Jan 2009 */
> > +  {3550089600, 35, LEAP_InsertSecond, 0}, /* 1 Jul 2012 */
> > +  {3644697600, 36, LEAP_InsertSecond, 0}, /* 1 Jul 2015 */
> > +  {3692217600, 37, LEAP_InsertSecond, 0}, /* 1 Jan 2017 */
> > +  {34711891200, 36, LEAP_DeleteSecond, 1}, /* 1 Jan 3000 fake in 
> > leapdb.list */
>
> This value is too large to fit in 32-bit time_t. I changed it to 1 Jan
> 2020.

Ah, I didn't think of that as all of the platforms I work with are
64-bit time_t and have been for a few years now.

> There was also an issue I found after I updated the other tests. The
> refclock tai option checked only for leapsectz. And there was a new
> issue reported by static analyzer about uninitialized value, probably
> due to not being able to follow the new function pointers.

Thanks for resolving those remaining issues. Looks like I should have
been running a few more tests beyond "make check". How do you run the
static analyser?

Thanks for getting it merged,

Patrick

> Thanks,
>
> --
> Miroslav Lichvar
>
>
> --
> To unsubscribe email [email protected] with 
> "unsubscribe" in the subject.
> For help email [email protected] with "help" in the 
> subject.
> Trouble?  Email [email protected].
>

--
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].



Re: [chrony-dev] [PATCH v5 5/5] test/unit: add leapdb test

2024-02-08 Thread Miroslav Lichvar
On Thu, Feb 08, 2024 at 02:36:29PM +1100, [email protected] wrote:
> +} tests[] = {
> +  /* leapdb.list is a cut down version of leap-seconds.list */
> +  {3439756800, 34, LEAP_InsertSecond, 0}, /* 1 Jan 2009 */
> +  {3550089600, 35, LEAP_InsertSecond, 0}, /* 1 Jul 2012 */
> +  {3644697600, 36, LEAP_InsertSecond, 0}, /* 1 Jul 2015 */
> +  {3692217600, 37, LEAP_InsertSecond, 0}, /* 1 Jan 2017 */
> +  {34711891200, 36, LEAP_DeleteSecond, 1}, /* 1 Jan 3000 fake in leapdb.list 
> */

This value is too large to fit in 32-bit time_t. I changed it to 1 Jan
2020.

There was also an issue I found after I updated the other tests. The
refclock tai option checked only for leapsectz. And there was a new
issue reported by static analyzer about uninitialized value, probably
due to not being able to follow the new function pointers.

Thanks,

-- 
Miroslav Lichvar


-- 
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].