/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1999-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#include "dttest.h"
static int Close = 0;
static int Free = 0;
#if __STD_C
#else
int type;
#endif
{ /* opening first dictionary */
if(obj)
return 0;
else /* opening a dictionary sharing with some previous one */
return 1;
}
}
else return 0;
}
{ if(Close == 0 ) /* do not free objects */
return 1;
else return 0;
}
else return 0;
}
#if __STD_C
#else
#endif
{
if(!buf)
}
else
{ if(Close > 0)
Free += 1;
}
return buf;
}
{ 0, sizeof(long), -1,
};
tmain()
{
long i, k;
terror("Opening Dtoset1");
terror("Inserting 1");
terror("Inserting 3");
terror("Inserting 5");
terror("Opening Dtoset2");
terror("Inserting 2");
terror("Inserting 4");
terror("Inserting 6");
for(i = 1; i <= 6; ++i)
terror("Didn't find a long");
if(i != k)
terror("Didn't walk a long");
/* this test makes sure that dtclose() does not free objects */
Close = 0;
if(Free > 0 )
terror("Memory should not have been freed");
/* this test makes sure that all objects are freed */
Close = 1;
if(Free <= 0 )
terror("Memory should have been freed");
/* test to make sure that shared dictionaries use the same method */
terror("Opening first dictionary");
terror("This open should have failed");
texit(0);
}