ReactOS 0.4.15-dev-8064-gdaf8068
__64tof.c File Reference
#include <apitest.h>
Include dependency graph for __64tof.c:

Go to the source code of this file.

Classes

struct  _I64TOD_TEST_DATA
 
struct  _U64TOD_TEST_DATA
 
struct  _I64TOS_TEST_DATA
 
struct  _U64TOS_TEST_DATA
 

Typedefs

typedef struct _I64TOD_TEST_DATA I64TOD_TEST_DATA
 
typedef struct _U64TOD_TEST_DATA U64TOD_TEST_DATA
 
typedef struct _I64TOS_TEST_DATA I64TOS_TEST_DATA
 
typedef struct _U64TOS_TEST_DATA U64TOS_TEST_DATA
 

Functions

 START_TEST (__64tof)
 

Typedef Documentation

◆ I64TOD_TEST_DATA

◆ I64TOS_TEST_DATA

◆ U64TOD_TEST_DATA

◆ U64TOS_TEST_DATA

Function Documentation

◆ START_TEST()

START_TEST ( __64tof  )

Definition at line 50 of file __64tof.c.

51{
52 I64TOD_TEST_DATA i64tod[] =
53 {
54 { 1383034209LL, 1383034209.0 }, /* test 32bit number */
55 { -1383034209LL, -1383034209.0 }, /* test negative 32bit number */
56 { 354056757614LL, 354056757614.0 }, /* test 64bit int */
57 { -354056757614LL, -354056757614.0 }, /* test negative 64bit int */
58 { 18446744073709550000LL, -1616.0 }, /* test 20bit in float */
59 { 0x8000000000000000LL, -9223372036854775800.0 }, /* test big 64bit int */
60 { 0xFFFFFFFFFFFFFFFFLL, -1.0 }, /* test -1 */
61 { 0LL, +0.0 }, /* test 0 */
62 };
63 U64TOD_TEST_DATA u64tod[] =
64 {
65 { 1383034209ULL, 1383034209.0 }, /* test 32bit number */
66 { 354056757614ULL, 354056757614.0 }, /* test 64bit int */
67 { 18445937028656326656ULL, 18445937028656326656.0 }, /* test unsigned 64bit */
68 { 18446744073709550000ULL, 18446744073709550000.0 }, /* test 20bit in float */
69 { 18446744073709551615ULL, 18446744073709552000.0 }, /* test big 64bit number */
70 { 0ULL, +0.0 }, /* test 0 */
71 };
72 I64TOS_TEST_DATA i64tos[] =
73 {
74 { 1383034LL, 1383034.0f }, /* test 32bit number */
75 { -1383034LL, -1383034.0f }, /* test negative 32bit number */
76 { 354056765440LL, 354056765440.0f }, /* test 64bit int */
77 { -354056765440LL, -354056765440.0f }, /* test negative 64bit int */
78 { 18446744073709550000LL, -1616.0f }, /* test 20bit in float */
79 { 0x8000000000000000LL, -9223372036854775800.0f }, /* test big 64bit int */
80 { 0xFFFFFFFFFFFFFFFFLL, -1.0f }, /* test -1 */
81 { 0LL, +0.0f }, /* test 0 */
82 };
83 U64TOS_TEST_DATA u64tos[] =
84 {
85 { 1383034ULL, 1383034.0f }, /* test 32bit number */
86 { 354056765440ULL, 354056765440.0f }, /* test 64bit int */
87 { 18445937032174764032ULL, 18445937032174764032.0f }, /* test unsigned 64bit */
88 { 18446744073709550000ULL, 18446744073709550000.0f }, /* test 20bit in float */
89 { 18446744073709551615ULL, 18446744073709552000.0f }, /* test big 64bit number */
90 { 0ULL, +0.0f }, /* test 0 */
91 };
92
93 unsigned int i;
94
95 for (i = 0; i < _countof(i64tod); ++i)
96 {
97 double actual;
98
99 actual = (double)i64tod[i].given;
100 ok(actual == i64tod[i].expected.value, "(i64tod) %d: Expected %lf, but %lld -> %lf\n",
101 i, i64tod[i].expected.value, i64tod[i].given, actual);
102 }
103
104 for (i = 0; i < _countof(u64tod); ++i)
105 {
106 double actual;
107
108 actual = (double)u64tod[i].given;
109 ok(actual == u64tod[i].expected.value, "(u64tod) %d: Expected %lf, but %llu -> %lf\n",
110 i, u64tod[i].expected.value, u64tod[i].given, actual);
111 }
112
113 for (i = 0; i < _countof(i64tos); ++i)
114 {
115 float actual;
116
117 actual = (float)i64tos[i].given;
118 ok(actual == i64tos[i].expected.value, "(i64tos) %d: Expected %f, but %lld -> %f\n",
119 i, i64tos[i].expected.value, i64tos[i].given, actual);
120 }
121
122 for (i = 0; i < _countof(u64tos); ++i)
123 {
124 float actual;
125
126 actual = (float)u64tos[i].given;
127 ok(actual == u64tos[i].expected.value, "(u64tos) %d: Expected %f, but %llu -> %f\n",
128 i, u64tos[i].expected.value, u64tos[i].given, actual);
129 }
130}
#define ok(value,...)
Definition: atltest.h:57
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOL expected
Definition: store.c:2063
#define ULL(a, b)
Definition: format_msg.c:27
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
static float(__cdecl *square_half_float)(float x
#define _countof(array)
Definition: sndvol32.h:68
#define LL
Definition: tui.h:167