/***********************************************************************
* *
* 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 "sftest.h"
tmain()
{
terror("Can't open a string stream");
terror("sfwrite failed");
terror("sfstrseek failed");
if(strcmp(s,"abcd") != 0)
terror("Got wrong data");
terror("sfstruse failed");
if(strcmp(s,"0123456789") != 0)
terror("Got bad data");
terror("Bad sfstrseek");
terror("Can't reserve space");
terror("Lost data");
terror("sfstrtmp failed");
terror("Wrong base");
terror("Wrong buffer size");
terror("sfstruse should have failed");
if(sfstrclose(fp))
terror("sfstrclose failed");
terror("sfstropen failed");
terror("initial sfreserve SF_LOCKR should fail");
terror("initial sfreserve SF_WRITE|SF_LOCKR failed");
terror("sfwrite reserve unlock failed");
if(sfstrclose(fp))
terror("sfstrclose failed");
terror("sfstropen failed");
terror("initial sfreserve SF_WRITE SF_LOCKR failed");
terror("sfwrite reserve unlock failed");
if(sfstrclose(fp))
terror("sfstrclose failed");
terror("sfstropen failed");
terror("initial sfreserve SF_READ SF_LOCKR should have failed");
if(sfstrclose(fp))
terror("sfstrclose failed");
texit(0);
}