Remove building with NOCRYPTO option
[minix3.git] / tests / lib / libc / gen / t_isnan.c
blob2871e314066e542f662d94021519c9c72d0462a7
1 /* $NetBSD: t_isnan.c,v 1.5 2014/11/04 00:20:19 justin Exp $ */
3 /*
4 * This file is in the Public Domain.
6 * The nan test is blatently copied by Simon Burge from the infinity
7 * test by Ben Harris.
8 */
10 #include <sys/param.h>
12 #include <atf-c.h>
14 #include <math.h>
15 #include <string.h>
17 ATF_TC(isnan_basic);
18 ATF_TC_HEAD(isnan_basic, tc)
20 atf_tc_set_md_var(tc, "descr", "Verify that isnan(3) works");
23 ATF_TC_BODY(isnan_basic, tc)
25 #if defined(__m68k__)
26 atf_tc_skip("Test not applicable on " MACHINE_ARCH);
27 #endif
29 #ifdef NAN
30 /* NAN is meant to be a (float)NaN. */
31 ATF_CHECK(isnan(NAN) != 0);
32 ATF_CHECK(isnan((double)NAN) != 0);
33 #else
34 atf_tc_skip("Test not applicable");
35 #endif
38 ATF_TC(isinf_basic);
39 ATF_TC_HEAD(isinf_basic, tc)
41 atf_tc_set_md_var(tc, "descr", "Verify that isinf(3) works");
44 ATF_TC_BODY(isinf_basic, tc)
46 #if defined(__m68k__)
47 atf_tc_skip("Test not applicable on " MACHINE_ARCH);
48 #endif
50 /* HUGE_VAL is meant to be an infinity. */
51 ATF_CHECK(isinf(HUGE_VAL) != 0);
53 /* HUGE_VALF is the float analog of HUGE_VAL. */
54 ATF_CHECK(isinf(HUGE_VALF) != 0);
56 /* HUGE_VALL is the long double analog of HUGE_VAL. */
57 ATF_CHECK(isinf(HUGE_VALL) != 0);
60 ATF_TP_ADD_TCS(tp)
62 ATF_TP_ADD_TC(tp, isnan_basic);
63 ATF_TP_ADD_TC(tp, isinf_basic);
65 return atf_no_error();