3 #include "cppunit/cppunit_proxy.h"
5 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
12 class ValarrayTest : public CPPUNIT_NS::TestCase
14 CPPUNIT_TEST_SUITE(ValarrayTest);
15 CPPUNIT_TEST(transcendentals);
16 CPPUNIT_TEST_SUITE_END();
19 void transcendentals();
22 CPPUNIT_TEST_SUITE_REGISTRATION(ValarrayTest);
25 // tests implementation
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.
30 void ValarrayTest::transcendentals()
36 valarray<double> darray;
42 tmp = atan2(darray, tmp);
43 tmp = atan2(1.0, darray);
44 tmp = atan2(darray, 1.0);
50 #if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
56 tmp = pow(darray, tmp);
57 tmp = pow(1.0, darray);
58 tmp = pow(darray, 1.0);
62 valarray<float> farray;
68 tmp = atan2(farray, tmp);
69 tmp = atan2(1.0f, farray);
70 tmp = atan2(farray, 1.0f);
76 #if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
82 tmp = pow(farray, tmp);
83 tmp = pow(1.0f, farray);
84 tmp = pow(farray, 1.0f);
87 #if !defined (STLPORT) || !defined (_STLP_NO_LONG_DOUBLE)
89 valarray<long double> ldarray;
90 valarray<long double> tmp;
95 tmp = atan2(ldarray, tmp);
96 tmp = atan2(1.0l, ldarray);
97 tmp = atan2(ldarray, 1.0l);
103 # if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
108 tmp = log10(ldarray);
109 tmp = pow(ldarray, tmp);
110 tmp = pow(1.0l, ldarray);
111 tmp = pow(ldarray, 1.0l);
115 valarray<double> v0(2, 10);
116 valarray<double> v1(v0[slice(0, 1, 5)]);
117 v0[slice(0, 1, 5)] = 5;
118 valarray<double> v2(v0[gslice()]);
119 //valarray<double> v3(v0[valarray<bool>()]);
120 valarray<double> v4(v0[valarray<size_t>()]);