Changeset View
Changeset View
Standalone View
Standalone View
lib/msun/tests/conj_test.c
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | ATF_TC_BODY(main, tc) | ||||
complex long double expected; | complex long double expected; | ||||
int i; | int i; | ||||
for (i = 0; i < ntests; i++) { | for (i = 0; i < ntests; i++) { | ||||
__real__ expected = __real__ in = tests[2 * i]; | __real__ expected = __real__ in = tests[2 * i]; | ||||
__imag__ in = tests[2 * i + 1]; | __imag__ in = tests[2 * i + 1]; | ||||
__imag__ expected = -cimag(in); | __imag__ expected = -cimag(in); | ||||
ATF_REQUIRE(fpequal(libcrealf(in), __real__ in)); | ATF_REQUIRE(fpequal_cs(libcrealf(in), __real__ in, true)); | ||||
ATF_REQUIRE(fpequal(libcreal(in), __real__ in)); | ATF_REQUIRE(fpequal_cs(libcreal(in), __real__ in, true)); | ||||
ATF_REQUIRE(fpequal(libcreall(in), __real__ in)); | ATF_REQUIRE(fpequal_cs(libcreall(in), __real__ in, true)); | ||||
ATF_REQUIRE(fpequal(libcimagf(in), __imag__ in)); | ATF_REQUIRE(fpequal_cs(libcimagf(in), __imag__ in, true)); | ||||
ATF_REQUIRE(fpequal(libcimag(in), __imag__ in)); | ATF_REQUIRE(fpequal_cs(libcimag(in), __imag__ in, true)); | ||||
ATF_REQUIRE(fpequal(libcimagl(in), __imag__ in)); | ATF_REQUIRE(fpequal_cs(libcimagl(in), __imag__ in, true)); | ||||
ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); | ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); | ||||
ATF_REQUIRE_MSG( | ATF_REQUIRE_MSG( | ||||
cfpequal(libconjf(in), expected), | cfpequal(libconjf(in), expected), | ||||
"conjf(%#.2g + %#.2gI): wrong value", creal(in), cimag(in) | "conjf(%#.2g + %#.2gI): wrong value", creal(in), cimag(in) | ||||
); | ); | ||||
ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), | ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), | ||||
"conj(%#.2g + %#.2gI): threw an exception: %#x", creal(in), | "conj(%#.2g + %#.2gI): threw an exception: %#x", creal(in), | ||||
Show All 24 Lines |