ReactOS 0.4.16-dev-340-g0540c21
valarray_test.cpp
Go to the documentation of this file.
1#include <valarray>
2
4
5#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
6using namespace std;
7#endif
8
9//
10// TestCase class
11//
12class ValarrayTest : public CPPUNIT_NS::TestCase
13{
17
18protected:
19 void transcendentals();
20};
21
23
24//
25// tests implementation
26//
27// For the moment this test is just a complitation test
28// everyone is welcome to do a real good unit test for
29// valarray functionality.
31{
32#ifdef __SUNPRO_CC
33 using std::abs;
34#endif
35 {
36 valarray<double> darray;
38 tmp = abs(darray);
39 tmp = acos(darray);
40 tmp = asin(darray);
41 tmp = atan(darray);
42 tmp = atan2(darray, tmp);
43 tmp = atan2(1.0, darray);
44 tmp = atan2(darray, 1.0);
45 tmp = cos(darray);
46 tmp = cosh(darray);
47 tmp = sin(darray);
48 tmp = sinh(darray);
49 tmp = tan(darray);
50#if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
51 tmp = tanh(darray);
52#endif
53 tmp = exp(darray);
54 tmp = log(darray);
55 tmp = log10(darray);
56 tmp = pow(darray, tmp);
57 tmp = pow(1.0, darray);
58 tmp = pow(darray, 1.0);
59 tmp = sqrt(darray);
60 }
61 {
62 valarray<float> farray;
64 tmp = abs(farray);
65 tmp = acos(farray);
66 tmp = asin(farray);
67 tmp = atan(farray);
68 tmp = atan2(farray, tmp);
69 tmp = atan2(1.0f, farray);
70 tmp = atan2(farray, 1.0f);
71 tmp = cos(farray);
72 tmp = cosh(farray);
73 tmp = sin(farray);
74 tmp = sinh(farray);
75 tmp = tan(farray);
76#if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
77 tmp = tanh(farray);
78#endif
79 tmp = exp(farray);
80 tmp = log(farray);
81 tmp = log10(farray);
82 tmp = pow(farray, tmp);
83 tmp = pow(1.0f, farray);
84 tmp = pow(farray, 1.0f);
85 tmp = sqrt(farray);
86 }
87#if !defined (STLPORT) || !defined (_STLP_NO_LONG_DOUBLE)
88 {
91 tmp = abs(ldarray);
92 tmp = acos(ldarray);
93 tmp = asin(ldarray);
94 tmp = atan(ldarray);
95 tmp = atan2(ldarray, tmp);
96 tmp = atan2(1.0l, ldarray);
97 tmp = atan2(ldarray, 1.0l);
98 tmp = cos(ldarray);
99 tmp = cosh(ldarray);
100 tmp = sin(ldarray);
101 tmp = sinh(ldarray);
102 tmp = tan(ldarray);
103# if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
104 tmp = tanh(ldarray);
105# endif
106 tmp = exp(ldarray);
107 tmp = log(ldarray);
108 tmp = log10(ldarray);
109 tmp = pow(ldarray, tmp);
110 tmp = pow(1.0l, ldarray);
111 tmp = pow(ldarray, 1.0l);
112 tmp = sqrt(ldarray);
113 }
114#endif
115 valarray<double> v0(2, 10);
116 valarray<double> v1(v0[slice(0, 1, 5)]);
117 v0[slice(0, 1, 5)] = 5;
119 //valarray<double> v3(v0[valarray<bool>()]);
121}
_STLP_DECLSPEC complex< float > _STLP_CALL sinh(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL cosh(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
_STLP_DECLSPEC complex< float > _STLP_CALL tanh(const complex< float > &)
valarray< _Tp > acos(const valarray< _Tp > &__x)
Definition: _valarray.h:901
valarray< _Tp > atan(const valarray< _Tp > &__x)
Definition: _valarray.h:919
valarray< _Tp > asin(const valarray< _Tp > &__x)
Definition: _valarray.h:910
valarray< _Tp > atan2(const valarray< _Tp > &__x, const valarray< _Tp > &__y)
Definition: _valarray.h:928
CPPUNIT_TEST_SUITE_END()
void transcendentals()
CPPUNIT_TEST_SUITE(ValarrayTest)
CPPUNIT_TEST(transcendentals)
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition: cppunit_mini.h:193
#define abs(i)
Definition: fconv.c:206
double log10(double x)
Definition: freeldr.c:122
double pow(double x, double y)
Definition: freeldr.c:110
GLfloat v0
Definition: glext.h:6061
GLfloat GLfloat v1
Definition: glext.h:6062
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
DWORD exp
Definition: msg.c:16058
Definition: features.h:417
#define log(outFile, fmt,...)
Definition: util.h:15