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

pair_test.cpp
Go to the documentation of this file.
00001 #include <utility>
00002 #include <vector>
00003 #include <algorithm>
00004 #include <string>
00005 
00006 #include "cppunit/cppunit_proxy.h"
00007 
00008 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
00009 using namespace std;
00010 #endif
00011 
00012 class PairTest : public CPPUNIT_NS::TestCase
00013 {
00014     CPPUNIT_TEST_SUITE(PairTest);
00015     CPPUNIT_TEST(pair0);
00016     CPPUNIT_TEST(init);
00017     CPPUNIT_TEST_SUITE_END();
00018 
00019   protected:
00020     void pair0();
00021     void init();
00022 };
00023 
00024 CPPUNIT_TEST_SUITE_REGISTRATION(PairTest);
00025 
00026 void PairTest::pair0()
00027 {
00028   pair<int, int> p = make_pair(1, 10);
00029 
00030   CPPUNIT_ASSERT(p.first==1);
00031   CPPUNIT_ASSERT(p.second==10);
00032 }
00033 
00034 void PairTest::init()
00035 {
00036   pair<int, string> PAIR_ARRAY[] = { pair<int, string>(0, "0") };
00037 
00038   int PAIR_ARRAY_SIZE = sizeof(PAIR_ARRAY) > 0 ? sizeof(PAIR_ARRAY) / sizeof(PAIR_ARRAY[0]) : 0;
00039 
00040 
00041   for ( int i = 0; i < PAIR_ARRAY_SIZE; i++ ) {
00042     CPPUNIT_CHECK( PAIR_ARRAY[i].first == 0 );
00043     CPPUNIT_CHECK( PAIR_ARRAY[i].second == "0" );
00044     PAIR_ARRAY[i].second = "1";
00045   }
00046 }

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