ReactOS 0.4.16-dev-340-g0540c21
neq_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 NeqTest : public CPPUNIT_NS::TestCase
15{
20
21protected:
22 void negate0();
23 void nequal0();
24};
25
27
28//
29// tests implementation
30//
32{
33 int input [3] = { 1, 2, 3 };
34
35 int output[3];
36 transform((int*)input, (int*)input + 3, (int*)output, negate<int>());
37
38 CPPUNIT_ASSERT(output[0]==-1);
39 CPPUNIT_ASSERT(output[1]==-2);
40 CPPUNIT_ASSERT(output[2]==-3);
41}
43{
44 int input1 [4] = { 1, 7, 2, 2 };
45 int input2 [4] = { 1, 6, 2, 3 };
46
47 int output [4];
48 transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, not_equal_to<int>());
49
50 CPPUNIT_ASSERT(output[0]==0);
51 CPPUNIT_ASSERT(output[1]==1);
52 CPPUNIT_ASSERT(output[2]==0);
53 CPPUNIT_ASSERT(output[3]==1);
54}
void negate0()
Definition: neq_test.cpp:31
CPPUNIT_TEST(negate0)
void nequal0()
Definition: neq_test.cpp:42
CPPUNIT_TEST(nequal0)
CPPUNIT_TEST_SUITE_END()
CPPUNIT_TEST_SUITE(NeqTest)
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition: cppunit_mini.h:193
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLenum GLenum GLenum input
Definition: glext.h:9031
Definition: features.h:417