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

bcompos_test.cpp
Go to the documentation of this file.
00001 #include <algorithm>
00002 #include "unary.h"
00003 
00004 #include "cppunit/cppunit_proxy.h"
00005 
00006 #if defined(_STLP_USE_NAMESPACES)
00007 using namespace std;
00008 #endif
00009 
00010 //
00011 // TestCase class
00012 //
00013 class BcomposTest : public CPPUNIT_NS::TestCase
00014 {
00015   CPPUNIT_TEST_SUITE(BcomposTest);
00016 #if !defined (STLPORT) || defined (_STLP_NO_EXTENSIONS)
00017   CPPUNIT_IGNORE;
00018 #endif
00019   CPPUNIT_TEST(bcompos1);
00020   CPPUNIT_TEST(bcompos2);
00021   CPPUNIT_TEST_SUITE_END();
00022 
00023 protected:
00024   void bcompos1();
00025   void bcompos2();
00026 };
00027 
00028 CPPUNIT_TEST_SUITE_REGISTRATION(BcomposTest);
00029 
00030 //
00031 // tests implementation
00032 //
00033 void BcomposTest::bcompos1()
00034 {
00035 #if defined (STLPORT) && !defined (_STLP_NO_EXTENSIONS)
00036   int array [6] = { -2, -1, 0, 1, 2, 3 };
00037 
00038   binary_compose<logical_and<bool>, odd, positive>
00039   b = binary_compose<logical_and<bool>, odd, positive>(logical_and<bool>(), odd(), positive());
00040 
00041   int* p = find_if((int*)array, (int*)array + 6, b);
00042   CPPUNIT_ASSERT(p != array + 6);
00043 #endif
00044 }
00045 
00046 void BcomposTest::bcompos2()
00047 {
00048 #if defined (STLPORT) && !defined (_STLP_NO_EXTENSIONS)
00049   int array [6] = { -2, -1 , 0, 1, 2, 3 };
00050 
00051   int* p = find_if((int*)array, (int*)array + 6,
00052   compose2(logical_and<bool>(), odd(), positive()));
00053   CPPUNIT_ASSERT(p != array + 6);
00054 #endif
00055 }

Generated on Sun May 27 2012 04:35:19 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.