ReactOS  0.4.14-dev-998-g623dd26
modulus_test.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 #include <functional>
3 
5 
6 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
7 using namespace std;
8 #endif
9 
10 //
11 // TestCase class
12 //
13 class ModulusTest : public CPPUNIT_NS::TestCase
14 {
16  CPPUNIT_TEST(modulus0);
18 
19 protected:
20  void modulus0();
21 };
22 
24 
25 //
26 // tests implementation
27 //
29 {
30  int input1 [4] = { 6, 8, 10, 2 };
31  int input2 [4] = { 4, 2, 11, 3 };
32 
33  int output [4];
34 
35  transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, modulus<int>());
36  CPPUNIT_ASSERT(output[0]==2);
37  CPPUNIT_ASSERT(output[1]==0);
38  CPPUNIT_ASSERT(output[2]==10);
39  CPPUNIT_ASSERT(output[3]==2);
40 }
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
#define CPPUNIT_TEST_SUITE(X)
Definition: cppunit_mini.h:142
#define CPPUNIT_TEST(X)
Definition: cppunit_mini.h:182
Definition: features.h:417
#define CPPUNIT_TEST_SUITE_END()
Definition: cppunit_mini.h:191
CPPUNIT_TEST_SUITE_REGISTRATION(ModulusTest)
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint GLenum GLenum transform
Definition: glext.h:9407
void modulus0()