On Wed, 13.02.13 18:29, Thomas H.P. Andersen (pho...@gmail.com) wrote: > > On Wed, Feb 13, 2013 at 1:25 AM, Lennart Poettering > <lenn...@poettering.net> wrote: > > On Mon, 11.02.13 22:39, Daniel Buch (boogiewasth...@gmail.com) wrote: > > > >> And now with patch files. > > > > Looks pretty OK. > > > > But two points: > > > > Could you please use assert_se() rather than assert() for these tests? > > They both have pretty much the same function but the latter becomes a > > NOP if -DNDEBUG is defined, which can be used by people who want to > > optimize a few checks away. However, these are unit tests, so optimizing > > the assertions away defeats their entire point... > > > > Also, we generally always check for Out of Memory (OOM) situations. Of > > course, this doesn't really matter too much as this is unit tests, but > > it would still be nice to check with assert_cc() if the allocations > > worked. > > > > Or in other words: strv_new() and friends can fail due to lack of > > memory, you really should add an explicit "assert_cc" after that before > > just using the returned object... > > None of the other tests do this. Did you mean assert_se instead of > assert_cc here?
Oops, sorry. Yes, assert_se(). And yes, not all tests use this, but they should.... Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel