ReactOS 0.4.15-dev-8344-g0574987
greater_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)
8using namespace std;
9#endif
10
11//
12// TestCase class
13//
14class GreaterTest : public CPPUNIT_NS::TestCase
15{
20
21protected:
22 void greatert();
23 void greatereq();
24};
25
27
28//
29// tests implementation
30//
32{
33 int array[4] = { 3, 1, 4, 2 };
34 sort(array, array + 4, greater<int>() );
35
36 CPPUNIT_ASSERT(array[0]==4);
37 CPPUNIT_ASSERT(array[1]==3);
38 CPPUNIT_ASSERT(array[2]==2);
39 CPPUNIT_ASSERT(array[3]==1);
40}
42{
43 int array [4] = { 3, 1, 4, 2 };
45 CPPUNIT_ASSERT(array[0]==4);
46 CPPUNIT_ASSERT(array[1]==3);
47 CPPUNIT_ASSERT(array[2]==2);
48 CPPUNIT_ASSERT(array[3]==1);
49}
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993
CPPUNIT_TEST(greatereq)
CPPUNIT_TEST_SUITE_END()
void greatert()
CPPUNIT_TEST_SUITE(GreaterTest)
void greatereq()
CPPUNIT_TEST(greatert)
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition: cppunit_mini.h:193
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
Definition: features.h:417