On Thu 20-02-14 15:01:28, [email protected] wrote:
> Hi!
> > + if (event->mask == IN_MOVED_FROM) {
> > + if (event->cookie == 0)
> > + goto cookie_fail;
> > + stored_cookie = event->cookie;
> > + } else if (event->mask == IN_MOVED_TO) {
> > + if (event->cookie != stored_cookie)
> > + goto cookie_fail;
> > + stored_cookie = UINT_MAX;
> > + } else {
> > + if (event->cookie != 0)
> > + goto cookie_fail;
> > + }
> > tst_resm(TPASS,
> > "get event: wd=%d mask=%x"
> > " cookie=%u len=%u name=\"%s\"",
> > event->wd, event->mask, event->cookie,
> > event->len, event->name);
> > -
> > + goto next;
> > +cookie_fail:
> > + tst_resm(TFAIL,
> > + "get event: wd=%d mask=%x cookie=%u "
> > + "(wrong) len=%u name=\"%s\"",
> > + event->wd, event->mask,
> > + event->cookie, event->len,
> > + event->name);
> > } else {
> > tst_resm(TFAIL, "get event: wd=%d mask=%x "
> > "(expected %x) cookie=%u len=%u "
> > @@ -241,6 +261,7 @@ int main(int ac, char **av)
> > strcmp(event_set[test_num].name,
> > event->name));
> > }
> > +next:
>
> Hmm, shouldn't we rather add a variable named failed, initialize it to
> zero, set it to non-zero values ono failure and branch tst_resm() on it?
>
> The goto statements are getting a bit out of hand in this part...
Yeah, that's probably going to be more readable. Will send v2 in a
moment.
Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list