Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmodulus_test.cpp
Go to the documentation of this file.
00001 #include <algorithm> 00002 #include <functional> 00003 00004 #include "cppunit/cppunit_proxy.h" 00005 00006 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) 00007 using namespace std; 00008 #endif 00009 00010 // 00011 // TestCase class 00012 // 00013 class ModulusTest : public CPPUNIT_NS::TestCase 00014 { 00015 CPPUNIT_TEST_SUITE(ModulusTest); 00016 CPPUNIT_TEST(modulus0); 00017 CPPUNIT_TEST_SUITE_END(); 00018 00019 protected: 00020 void modulus0(); 00021 }; 00022 00023 CPPUNIT_TEST_SUITE_REGISTRATION(ModulusTest); 00024 00025 // 00026 // tests implementation 00027 // 00028 void ModulusTest::modulus0() 00029 { 00030 int input1 [4] = { 6, 8, 10, 2 }; 00031 int input2 [4] = { 4, 2, 11, 3 }; 00032 00033 int output [4]; 00034 00035 transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, modulus<int>()); 00036 CPPUNIT_ASSERT(output[0]==2); 00037 CPPUNIT_ASSERT(output[1]==0); 00038 CPPUNIT_ASSERT(output[2]==10); 00039 CPPUNIT_ASSERT(output[3]==2); 00040 } Generated on Sat May 26 2012 04:34:21 for ReactOS by
1.7.6.1
|