Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros)
Date
Msg-id 20191007201004.o7n6tp35iyag7lwn@alap3.anarazel.de
Whole thread Raw
In response to Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros)  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2019-10-07 21:58:08 +0200, Peter Eisentraut wrote:
> On 2019-10-07 19:57, Tom Lane wrote:
> > I'd just put them all in c.h.  I see no reason why a new header
> > is helpful.
> 
> Assert stuff is already in there, but surely stuff that calls elog()
> doesn't belong in there?

Make it call an ExpectFailure() (or similar) function that takes the
various parameters (expression, file, line, severity, format string,
args) as an argument? And that's implemented in terms of elog() in the
backend, and pg_log* + abort() (when appropriate) in the frontend?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: expressive test macros (was: Report test_atomic_ops() failures consistently, via macros)
Next
From: Peter Geoghegan
Date:
Subject: Re: maintenance_work_mem used by Vacuum