Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 19 months ago

Last modified 8 months ago

#715 closed enhancement

Pcut requires the use of Yoda comparisons — at Version 1

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone:
Component: helenos/unspecified Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description (last modified by Jiri Svoboda)

PCUT assertion macros that test for equality require the use of Yoda comaprisons, essentially:

PCUT_ASSERT_[INT_]EQUALS(expected, actual)

while if writing tests manually with == operator one would typically write

assert(actual == expected);

e.g.

assert(rc == EOK)

vs.

PCUT_ASSERT_ERRNO_VAL(EOK, rc)
PCUT_ASSERT_INT_EQUALS(0, list_count(xyz))

This is, at least for me, something very unnatural that I have to keep thinking about when writing tests, consuming precious mental energy.

Change History (1)

comment:1 Changed 19 months ago by Jiri Svoboda

Description: modified (diff)
Note: See TracTickets for help on using tickets.