1272343Sngie/*-
2272343Sngie * Copyright (c) 2009 The NetBSD Foundation, Inc.
3272343Sngie * All rights reserved.
4272343Sngie *
5272343Sngie * This code is derived from software contributed to The NetBSD Foundation
6272343Sngie * by Christos Zoulas.
7272343Sngie *
8272343Sngie * Redistribution and use in source and binary forms, with or without
9272343Sngie * modification, are permitted provided that the following conditions
10272343Sngie * are met:
11272343Sngie * 1. Redistributions of source code must retain the above copyright
12272343Sngie *    notice, this list of conditions and the following disclaimer.
13272343Sngie * 2. Redistributions in binary form must reproduce the above copyright
14272343Sngie *    notice, this list of conditions and the following disclaimer in the
15272343Sngie *    documentation and/or other materials provided with the distribution.
16272343Sngie * 3. All advertising materials mentioning features or use of this software
17272343Sngie *    must display the following acknowledgement:
18272343Sngie *        This product includes software developed by the NetBSD
19272343Sngie *        Foundation, Inc. and its contributors.
20272343Sngie * 4. Neither the name of The NetBSD Foundation nor the names of its
21272343Sngie *    contributors may be used to endorse or promote products derived
22272343Sngie *    from this software without specific prior written permission.
23272343Sngie *
24272343Sngie * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
25272343Sngie * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26272343Sngie * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27272343Sngie * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
28272343Sngie * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29272343Sngie * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30272343Sngie * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31272343Sngie * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32272343Sngie * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33272343Sngie * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34272343Sngie * POSSIBILITY OF SUCH DAMAGE.
35272343Sngie */
36272343Sngie#include <sys/cdefs.h>
37272343Sngie__RCSID("$NetBSD: t_gdtoa.c,v 1.4 2012/09/27 08:19:18 martin Exp $");
38272343Sngie
39272343Sngie#include <atf-c.h>
40272343Sngie
41272343Sngie#include <stdio.h>
42272343Sngie#include <stdlib.h>
43272343Sngie
44272343Sngie/* reported by Maksymilian Arciemowicz */
45272343Sngie
46272343SngieATF_TC(long_format);
47272343Sngie
48272343SngieATF_TC_HEAD(long_format, tc)
49272343Sngie{
50272343Sngie
51272343Sngie	atf_tc_set_md_var(tc, "descr", "Test printf with %%1.262159f format");
52272343Sngie}
53272343Sngie
54272343SngieATF_TC_BODY(long_format, tc)
55272343Sngie{
56272343Sngie	char *buf;
57272343Sngie	ATF_REQUIRE_EQ(262161, asprintf(&buf, "%1.262159f", 1.1));
58272343Sngie	free(buf);
59272343Sngie}
60272343Sngie
61272343SngieATF_TP_ADD_TCS(tp)
62272343Sngie{
63272343Sngie
64272343Sngie	ATF_TP_ADD_TC(tp, long_format);
65272343Sngie
66272343Sngie	return atf_no_error();
67272343Sngie}
68