On Mon, Jul 23, 2012 at 11:40:52AM +0300, Pekka Paalanen wrote:
> On Sun, 22 Jul 2012 14:24:15 -0400
> Kristian Høgsberg <[email protected]> wrote:
> 
> > > diff --git a/tests/array-test.c b/tests/array-test.c
> > > index 7639878..ff5bb8c 100644
> > > --- a/tests/array-test.c
> > > +++ b/tests/array-test.c
> > > @@ -60,7 +60,9 @@ TEST(array_add)
> > >  
> > >   /* add some data */
> > >   for (i = 0; i < iterations; i++) {
> > > -         struct mydata* ptr = wl_array_add(&array, datasize);
> > > +         struct mydata* ptr = NULL;
> > > +         while (ptr == NULL)
> > > +                 ptr = wl_array_add(&array, datasize);
> > >           assert((i + 1) * datasize == array.size);
> > 
> > If we want to test our malloc failure paths, we should inject malloc
> > errors using our malloc wrapper in test/test-runner.c, not by forcing
> > out-of-memory.  The typical approach here is to run the test once to
> > see how many mallocs there are, then run it once for each malloc,
> > failing malloc i in iteration i.
> 
> We don't have a realloc() wrapper yet, do we?
> Array uses realloc. We're missing calloc(), too, no?

Yea, we don't have those.

Kristian
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to