/***********************************************************************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 "sftest.h"2021#if _typ_long_double22#include <float.h>23#endif2425tmain()26{27#if _typ_long_double28long double ldval, ldmax;29char *s, *str;3031if(sfsscanf("Inf","%Le",&ldmax) != 1)32terror("sfsscanf Inf failed");33if(!(s = sfprints("%Le",ldmax)) )34terror("sfprints failed1");35if(!(str = malloc(strlen(s)+1)) )36terror("Malloc failed");37strcpy(str,s);3839if(sfsscanf(str,"%Le",&ldval) != 1)40terror("sfsscanf failed");41if(!(s = sfprints("%Le",ldval)) )42terror("sfprints failed2");4344if(strcmp(s,str) != 0)45terror("Bad conversion, expecting %s and getting %s",str,s);46#endif4748texit(0);49}505152