ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

valarray_test.cpp
Go to the documentation of this file.
00001 #include <valarray>
00002 
00003 #include "cppunit/cppunit_proxy.h"
00004 
00005 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
00006 using namespace std;
00007 #endif
00008 
00009 //
00010 // TestCase class
00011 //
00012 class ValarrayTest : public CPPUNIT_NS::TestCase
00013 {
00014   CPPUNIT_TEST_SUITE(ValarrayTest);
00015   CPPUNIT_TEST(transcendentals);
00016   CPPUNIT_TEST_SUITE_END();
00017 
00018 protected:
00019   void transcendentals();
00020 };
00021 
00022 CPPUNIT_TEST_SUITE_REGISTRATION(ValarrayTest);
00023 
00024 //
00025 // tests implementation
00026 //
00027 // For the moment this test is just a complitation test
00028 // everyone is welcome to do a real good unit test for
00029 // valarray functionality.
00030 void ValarrayTest::transcendentals()
00031 {
00032 #ifdef __SUNPRO_CC
00033   using std::abs;
00034 #endif
00035   {
00036     valarray<double> darray;
00037     valarray<double> tmp;
00038     tmp = abs(darray);
00039     tmp = acos(darray);
00040     tmp = asin(darray);
00041     tmp = atan(darray);
00042     tmp = atan2(darray, tmp);
00043     tmp = atan2(1.0, darray);
00044     tmp = atan2(darray, 1.0);
00045     tmp = cos(darray);
00046     tmp = cosh(darray);
00047     tmp = sin(darray);
00048     tmp = sinh(darray);
00049     tmp = tan(darray);
00050 #if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
00051     tmp = tanh(darray);
00052 #endif
00053     tmp = exp(darray);
00054     tmp = log(darray);
00055     tmp = log10(darray);
00056     tmp = pow(darray, tmp);
00057     tmp = pow(1.0, darray);
00058     tmp = pow(darray, 1.0);
00059     tmp = sqrt(darray);
00060   }
00061   {
00062     valarray<float> farray;
00063     valarray<float> tmp;
00064     tmp = abs(farray);
00065     tmp = acos(farray);
00066     tmp = asin(farray);
00067     tmp = atan(farray);
00068     tmp = atan2(farray, tmp);
00069     tmp = atan2(1.0f, farray);
00070     tmp = atan2(farray, 1.0f);
00071     tmp = cos(farray);
00072     tmp = cosh(farray);
00073     tmp = sin(farray);
00074     tmp = sinh(farray);
00075     tmp = tan(farray);
00076 #if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
00077     tmp = tanh(farray);
00078 #endif
00079     tmp = exp(farray);
00080     tmp = log(farray);
00081     tmp = log10(farray);
00082     tmp = pow(farray, tmp);
00083     tmp = pow(1.0f, farray);
00084     tmp = pow(farray, 1.0f);
00085     tmp = sqrt(farray);
00086   }
00087 #if !defined (STLPORT) || !defined (_STLP_NO_LONG_DOUBLE)
00088   {
00089     valarray<long double> ldarray;
00090     valarray<long double> tmp;
00091     tmp = abs(ldarray);
00092     tmp = acos(ldarray);
00093     tmp = asin(ldarray);
00094     tmp = atan(ldarray);
00095     tmp = atan2(ldarray, tmp);
00096     tmp = atan2(1.0l, ldarray);
00097     tmp = atan2(ldarray, 1.0l);
00098     tmp = cos(ldarray);
00099     tmp = cosh(ldarray);
00100     tmp = sin(ldarray);
00101     tmp = sinh(ldarray);
00102     tmp = tan(ldarray);
00103 #  if !defined (STLPORT) || !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_M_AMD64)
00104     tmp = tanh(ldarray);
00105 #  endif
00106     tmp = exp(ldarray);
00107     tmp = log(ldarray);
00108     tmp = log10(ldarray);
00109     tmp = pow(ldarray, tmp);
00110     tmp = pow(1.0l, ldarray);
00111     tmp = pow(ldarray, 1.0l);
00112     tmp = sqrt(ldarray);
00113   }
00114 #endif
00115   valarray<double> v0(2, 10);
00116   valarray<double> v1(v0[slice(0, 1, 5)]);
00117   v0[slice(0, 1, 5)] = 5;
00118   valarray<double> v2(v0[gslice()]);
00119   //valarray<double> v3(v0[valarray<bool>()]);
00120   valarray<double> v4(v0[valarray<size_t>()]);
00121 }

Generated on Thu May 24 2012 04:36:22 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.