ReactOS  0.4.14-dev-77-gd9e7c48
less_test.cpp
Go to the documentation of this file.
1 #include <vector>
2 #include <algorithm>
3 #include <functional>
4 
6 
7 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
8 using namespace std;
9 #endif
10 
11 //
12 // TestCase class
13 //
14 class LessTest : public CPPUNIT_NS::TestCase
15 {
17  CPPUNIT_TEST(lesst);
18  CPPUNIT_TEST(lesseqt);
20 
21 protected:
22  void lesst();
23  void lesseqt();
24 };
25 
27 
28 //
29 // tests implementation
30 //
32 {
33  int array [4] = { 3, 1, 4, 2 };
34  sort(array, array + 4, less<int>());
35 
36  CPPUNIT_ASSERT(array[0]==1);
37  CPPUNIT_ASSERT(array[1]==2);
38  CPPUNIT_ASSERT(array[2]==3);
39  CPPUNIT_ASSERT(array[3]==4);
40 }
42 {
43  int array [4] = { 3, 1, 4, 2 };
45 
46  CPPUNIT_ASSERT(array[0]==1);
47  CPPUNIT_ASSERT(array[1]==2);
48  CPPUNIT_ASSERT(array[2]==3);
49  CPPUNIT_ASSERT(array[3]==4);
50 }
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993
void lesst()
Definition: less_test.cpp:31
#define CPPUNIT_TEST_SUITE(X)
Definition: cppunit_mini.h:142
#define CPPUNIT_TEST(X)
Definition: cppunit_mini.h:182
Definition: features.h:417
void lesseqt()
Definition: less_test.cpp:41
#define CPPUNIT_TEST_SUITE_END()
Definition: cppunit_mini.h:191
CPPUNIT_TEST_SUITE_REGISTRATION(LessTest)
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200