Opened 6 years ago

Last modified 6 years 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 by Jiri Svoboda, 6 years ago

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