166869Sadrian/*-
266869Sadrian * Copyright (c) 2009 The NetBSD Foundation, Inc.
366869Sadrian * All rights reserved.
466869Sadrian *
566869Sadrian * This code is derived from software contributed to The NetBSD Foundation
666869Sadrian * by Christos Zoulas.
766869Sadrian *
866869Sadrian * Redistribution and use in source and binary forms, with or without
966869Sadrian * modification, are permitted provided that the following conditions
1066869Sadrian * are met:
1166869Sadrian * 1. Redistributions of source code must retain the above copyright
1266869Sadrian *    notice, this list of conditions and the following disclaimer.
1366869Sadrian * 2. Redistributions in binary form must reproduce the above copyright
1466869Sadrian *    notice, this list of conditions and the following disclaimer in the
1566869Sadrian *    documentation and/or other materials provided with the distribution.
1666869Sadrian * 3. All advertising materials mentioning features or use of this software
1766869Sadrian *    must display the following acknowledgement:
1866869Sadrian *        This product includes software developed by the NetBSD
1966869Sadrian *        Foundation, Inc. and its contributors.
2066869Sadrian * 4. Neither the name of The NetBSD Foundation nor the names of its
2166869Sadrian *    contributors may be used to endorse or promote products derived
2266869Sadrian *    from this software without specific prior written permission.
2366869Sadrian *
2466869Sadrian * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2566869Sadrian * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2666869Sadrian * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2766869Sadrian * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2866869Sadrian * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2966869Sadrian * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3066869Sadrian * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3166869Sadrian * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3266869Sadrian * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3366869Sadrian * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3466869Sadrian * POSSIBILITY OF SUCH DAMAGE.
3566869Sadrian */
3666869Sadrian#include <sys/cdefs.h>
3766869Sadrian__RCSID("$NetBSD: t_gdtoa.c,v 1.4 2012/09/27 08:19:18 martin Exp $");
3866869Sadrian
3966869Sadrian#include <atf-c.h>
4066869Sadrian
4166869Sadrian#include <stdio.h>
4266869Sadrian#include <stdlib.h>
4366869Sadrian
4466869Sadrian/* reported by Maksymilian Arciemowicz */
4566869Sadrian
4666869SadrianATF_TC(long_format);
4766869Sadrian
4866869SadrianATF_TC_HEAD(long_format, tc)
4966869Sadrian{
5066869Sadrian
5166869Sadrian	atf_tc_set_md_var(tc, "descr", "Test printf with %%1.262159f format");
5266869Sadrian}
5366869Sadrian
5466869SadrianATF_TC_BODY(long_format, tc)
5566869Sadrian{
5666869Sadrian	char *buf;
5766869Sadrian	ATF_REQUIRE_EQ(262161, asprintf(&buf, "%1.262159f", 1.1));
5866869Sadrian	free(buf);
5966869Sadrian}
6066869Sadrian
6166869SadrianATF_TP_ADD_TCS(tp)
6266869Sadrian{
6366869Sadrian
6466869Sadrian	ATF_TP_ADD_TC(tp, long_format);
6566869Sadrian
6666869Sadrian	return atf_no_error();
6766869Sadrian}
6866869Sadrian