mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[MSVCRT_APITEST]
Add more tests svn path=/trunk/; revision=54437
This commit is contained in:
parent
3cd3e4c5a8
commit
83d38617e6
1 changed files with 137 additions and 0 deletions
|
@ -199,9 +199,146 @@ void test_isnan(void)
|
|||
ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
|
||||
}
|
||||
|
||||
void test_scalb(void)
|
||||
{
|
||||
ieee_double tested;
|
||||
ieee_double expected;
|
||||
ieee_double result;
|
||||
|
||||
expected.l = 0;
|
||||
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFFFFFFFFFFFFFFFLL;
|
||||
expected.l = 0xFFFFFFFFFFFFFFFFLL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFF8000000000001LL;
|
||||
expected.l = 0xFFF8000000000001LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFF8000000000000LL;
|
||||
expected.l = 0xFFF8000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFF7FFFFFFFFFFFFLL;
|
||||
expected.l = 0xFFFFFFFFFFFFFFFFLL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFF0000000000001LL;
|
||||
expected.l = 0xFFF8000000000001LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFF0000000000000LL;
|
||||
expected.l = 0xFFF0000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0xFFEFFFFFFFFFFFFFLL;
|
||||
expected.l = 0xFFF0000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == ERANGE, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x8010000000000000LL;
|
||||
expected.l = 0x8040000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x800FFFFFFFFFFFFFLL;
|
||||
expected.l = 0x803FFFFFFFFFFFFELL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x8000000000000001LL;
|
||||
expected.l = 0x8000000000000008LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x8000000000000000LL;
|
||||
expected.l = 0x8000000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x0000000000000000LL;
|
||||
expected.l = 0x0000000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x0000000000000001LL;
|
||||
expected.l = 0x0000000000000008LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x000FFFFFFFFFFFFFLL;
|
||||
expected.l = 0x003FFFFFFFFFFFFELL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x0010000000000000LL;
|
||||
expected.l = 0x0040000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x7FEFFFFFFFFFFFFFLL;
|
||||
expected.l = 0x7FF0000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == ERANGE, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x7FF0000000000000LL;
|
||||
expected.l = 0x7FF0000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x7FF0000000000001LL;
|
||||
expected.l = 0x7FF8000000000001LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x7FF7FFFFFFFFFFFFLL;
|
||||
expected.l = 0x7FFFFFFFFFFFFFFFLL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x7FF8000000000000LL;
|
||||
expected.l = 0x7FF8000000000000LL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
errno = 0xDEADBEEF;
|
||||
tested.l = 0x7FFFFFFFFFFFFFFFLL;
|
||||
expected.l = 0x7FFFFFFFFFFFFFFFLL;
|
||||
result.d = _scalb(tested.d, 3);
|
||||
ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
|
||||
ok(errno == EDOM, "errno: %d\n", errno);
|
||||
}
|
||||
|
||||
START_TEST(ieee)
|
||||
{
|
||||
test_finite();
|
||||
test_fpclass();
|
||||
test_isnan();
|
||||
test_scalb();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue