1ea706db0Spgoyette /*-
2ea706db0Spgoyette * Copyright (c) 2009 The NetBSD Foundation, Inc.
3ea706db0Spgoyette * All rights reserved.
4ea706db0Spgoyette *
5ea706db0Spgoyette * This code is derived from software contributed to The NetBSD Foundation
6ea706db0Spgoyette * by Christos Zoulas.
7ea706db0Spgoyette *
8ea706db0Spgoyette * Redistribution and use in source and binary forms, with or without
9ea706db0Spgoyette * modification, are permitted provided that the following conditions
10ea706db0Spgoyette * are met:
11ea706db0Spgoyette * 1. Redistributions of source code must retain the above copyright
12ea706db0Spgoyette * notice, this list of conditions and the following disclaimer.
13ea706db0Spgoyette * 2. Redistributions in binary form must reproduce the above copyright
14ea706db0Spgoyette * notice, this list of conditions and the following disclaimer in the
15ea706db0Spgoyette * documentation and/or other materials provided with the distribution.
16ea706db0Spgoyette * 3. All advertising materials mentioning features or use of this software
17ea706db0Spgoyette * must display the following acknowledgement:
18ea706db0Spgoyette * This product includes software developed by the NetBSD
19ea706db0Spgoyette * Foundation, Inc. and its contributors.
20ea706db0Spgoyette * 4. Neither the name of The NetBSD Foundation nor the names of its
21ea706db0Spgoyette * contributors may be used to endorse or promote products derived
22ea706db0Spgoyette * from this software without specific prior written permission.
23ea706db0Spgoyette *
24ea706db0Spgoyette * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
25ea706db0Spgoyette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26ea706db0Spgoyette * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27ea706db0Spgoyette * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
28ea706db0Spgoyette * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29ea706db0Spgoyette * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30ea706db0Spgoyette * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31ea706db0Spgoyette * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32ea706db0Spgoyette * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33ea706db0Spgoyette * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34ea706db0Spgoyette * POSSIBILITY OF SUCH DAMAGE.
35ea706db0Spgoyette */
36ea706db0Spgoyette #include <sys/cdefs.h>
37*d70931daSmartin __RCSID("$NetBSD: t_gdtoa.c,v 1.4 2012/09/27 08:19:18 martin Exp $");
38ea706db0Spgoyette
39ea706db0Spgoyette #include <atf-c.h>
40ea706db0Spgoyette
41ea706db0Spgoyette #include <stdio.h>
42*d70931daSmartin #include <stdlib.h>
43ea706db0Spgoyette
44ea706db0Spgoyette /* reported by Maksymilian Arciemowicz */
45ea706db0Spgoyette
46ea706db0Spgoyette ATF_TC(long_format);
47ea706db0Spgoyette
ATF_TC_HEAD(long_format,tc)48ea706db0Spgoyette ATF_TC_HEAD(long_format, tc)
49ea706db0Spgoyette {
50ea706db0Spgoyette
51e792323bSnjoly atf_tc_set_md_var(tc, "descr", "Test printf with %%1.262159f format");
52ea706db0Spgoyette }
53ea706db0Spgoyette
ATF_TC_BODY(long_format,tc)54ea706db0Spgoyette ATF_TC_BODY(long_format, tc)
55ea706db0Spgoyette {
56ea706db0Spgoyette char *buf;
57908d2159Schristos ATF_REQUIRE_EQ(262161, asprintf(&buf, "%1.262159f", 1.1));
58908d2159Schristos free(buf);
59ea706db0Spgoyette }
60ea706db0Spgoyette
ATF_TP_ADD_TCS(tp)61ea706db0Spgoyette ATF_TP_ADD_TCS(tp)
62ea706db0Spgoyette {
63ea706db0Spgoyette
64ea706db0Spgoyette ATF_TP_ADD_TC(tp, long_format);
65ea706db0Spgoyette
66ea706db0Spgoyette return atf_no_error();
67ea706db0Spgoyette }
68