Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros)

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros)
Дата
Msg-id 20191008045946.GA4054860@rfd.leadboat.com
обсуждение исходный текст
Ответ на Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros)  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: expressive test macros (was: Report test_atomic_ops() failuresconsistently, via macros)  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
On Mon, Oct 07, 2019 at 09:56:20PM +0200, Peter Eisentraut wrote:
> On 2019-10-06 04:20, Noah Misch wrote:
> >  elog(ERROR, \
> >       "%s yielded %u, expected %s (%u) in file \"%s\" line %u", \
> >       #result_expr, result, #expected_expr, expected, __FILE__, __LINE__); \

> I've been meaning to propose some JUnit-style more-specific Assert
> variants such as AssertEquals for this reason.  But as Tom writes
> nearby, it should be a straight wrapper around Assert, not elog.  So
> these need to be named separately.

Agreed.

> Btw., JUnit uses the ordering convention assertEquals(expected, actual),
> whereas Perl Test::More uses is(actual, expected).  Let's make sure we
> pick something and stick with it.

Since we write "if (actual == expected)", I prefer f(actual, expected).  CUnit
uses CU_ASSERT_EQUAL(actual, expected).



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Two pg_rewind patches (auto generate recovery conf and ensureclean shutdown)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Non-Active links being referred in our source code