/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1999-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* *18***********************************************************************/19#include "vmtest.h"2021tmain()22{23Vmalloc_t* vm;24Void_t* addr[10];2526Vmdcheap->round = 64;27if(!(vm = vmopen(Vmdcheap, Vmbest, 0)) )28terror("Open failed");2930if(!(addr[0] = vmalloc(vm, 8)) )31terror("vmalloc failed");32if(!(addr[1] = vmalloc(vm, 8)) )33terror("vmalloc failed");34if(!(addr[2] = vmalloc(vm, 8)) )35terror("vmalloc failed");3637if(!(addr[3] = vmalloc(vm, 12)) )38terror("vmalloc failed");39if(!(addr[4] = vmalloc(vm, 12)) )40terror("vmalloc failed");41if(!(addr[5] = vmalloc(vm, 12)) )42terror("vmalloc failed");4344if(vmfree(vm, addr[1]) < 0)45terror("vmfree failed");46if(vmdbcheck(vm) < 0)47terror("vmdbcheck failed");4849if(vmfree(vm, addr[4]) < 0)50terror("vmfree failed");51vmdbcheck(vm);5253if(vmcompact(vm) < 0)54terror("vmcompact failed");55if(vmdbcheck(vm) < 0)56terror("vmdbcheck failed");5758texit(0);59}606162