Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenlexcmp_test.cpp
Go to the documentation of this file.
00001 #include <vector> 00002 #include <algorithm> 00003 #include <functional> 00004 00005 #include "cppunit/cppunit_proxy.h" 00006 00007 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) 00008 using namespace std; 00009 #endif 00010 00011 // 00012 // TestCase class 00013 // 00014 class LexcmpTest : public CPPUNIT_NS::TestCase 00015 { 00016 CPPUNIT_TEST_SUITE(LexcmpTest); 00017 CPPUNIT_TEST(lexcmp1); 00018 CPPUNIT_TEST(lexcmp2); 00019 CPPUNIT_TEST_SUITE_END(); 00020 00021 protected: 00022 void lexcmp1(); 00023 void lexcmp2(); 00024 }; 00025 00026 CPPUNIT_TEST_SUITE_REGISTRATION(LexcmpTest); 00027 00028 // 00029 // tests implementation 00030 // 00031 void LexcmpTest::lexcmp1() 00032 { 00033 const unsigned size = 6; 00034 char n1[size] = "shoe"; 00035 char n2[size] = "shine"; 00036 00037 bool before = lexicographical_compare(n1, n1 + size, n2, n2 + size); 00038 CPPUNIT_ASSERT(!before); 00039 } 00040 void LexcmpTest::lexcmp2() 00041 { 00042 const unsigned size = 6; 00043 char n1[size] = "shoe"; 00044 char n2[size] = "shine"; 00045 00046 bool before = lexicographical_compare(n1, n1 + size, n2, n2 + size, greater<char>()); 00047 CPPUNIT_ASSERT(before); 00048 } Generated on Sat May 26 2012 04:34:19 for ReactOS by
1.7.6.1
|