#include <stdlib.h>
#include <my_assert.h>

void entry (void)
{
    char *p, *q;
    struct dfwmalloc *dfw;
    int leak;
    dfw = dfwmalloc_new ();

    printf ("heap extension checks:\n");
    p = (char *) dfwmalloc_malloc (dfw, 1000000);
    assert (p != NULL);
    q = (char *) dfwmalloc_realloc (dfw, p, 1010000);
    assert (p == q);
    q = (char *) dfwmalloc_realloc (dfw, p, 1020000);
    assert (p == q);
    q = (char *) dfwmalloc_realloc (dfw, p, 1);
    assert (p == q);
    q = (char *) dfwmalloc_realloc (dfw, p, 100000);
    assert (p == q);
    printf ("done heap extension checks.\n");

    dfwmalloc_free (dfw, p);
    leak = dfwmalloc_destroy (dfw);
    assert (!leak);

}

