Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenpair_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
1.7.6.1
|