/***********************************************************************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{23Void_t* addr[10];24Vmalloc_t* vm;25int i;2627Vmdcheap->round = 127;28if(!(vm = vmopen(Vmdcheap,Vmlast,0)) )29terror("Can't open");3031for(i = 0; i < 10; ++i)32{ addr[i] = vmalloc(vm,8);33if((((Vmulong_t)addr[i])%ALIGN) != 0)34terror("Unaligned addr");35}3637if(vmfree(vm,addr[0]) >= 0)38terror("Free non-last element succeeds?");3940if(vmresize(vm,addr[9],256,1) == NIL(Void_t*))41terror("Resize last element does not succeed?");4243#ifdef DEBUG44for(i = 0; i < 10; ++i)45printf("size[%d]=%d\n",i,vmsize(vm,addr[i]));46printf("vmextent=%d\n",vmsize(vm,NIL(Void_t*)));47#endif4849texit(0);50}515253