On Sun, Oct 6, 2013 at 1:41 PM, Holger Hans Peter Freyther
<holger(a)freyther.de> wrote:
On Sat, Oct 05, 2013 at 12:16:07PM +0200, Alexander
Chemeris wrote:
#define SUBSCR_PUT(sub) \
- sub->net = &dummy_net; \
- subscr_put(sub);
+ if (sub) { \
+ sub->net = &dummy_net; \
+ subscr_put(sub); \
+ }
I don't like this semantic change. Either the tests expects a valid
subscriber or it doesn't. It is not a "maybe" this query will result
in a look up.
My changes are to avoid _segfault_ when something goes wrong. Test
will still fail, because it will print info about NULL original or
copy, and comparison with the proper output will fail.
I decided to do it that way, because it makes the code of the test
itself looking clean. Otherwise we have to put this "if(sub)" to every
test, which looks ugly. But if you prefer some other way - please go
ahead, I don't really care about this. I just tried to keep the clean
look.
--
Regards,
Alexander Chemeris.
CEO, Fairwaves LLC / ООО УмРадио
http://fairwaves.ru