First public contribution.
5 #include "cppunit/cppunit_proxy.h"
7 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
14 class NeqTest : public CPPUNIT_NS::TestCase
16 CPPUNIT_TEST_SUITE(NeqTest);
17 CPPUNIT_TEST(negate0);
18 CPPUNIT_TEST(nequal0);
19 CPPUNIT_TEST_SUITE_END();
26 CPPUNIT_TEST_SUITE_REGISTRATION(NeqTest);
29 // tests implementation
31 void NeqTest::negate0()
33 int input [3] = { 1, 2, 3 };
36 transform((int*)input, (int*)input + 3, (int*)output, negate<int>());
38 CPPUNIT_ASSERT(output[0]==-1);
39 CPPUNIT_ASSERT(output[1]==-2);
40 CPPUNIT_ASSERT(output[2]==-3);
42 void NeqTest::nequal0()
44 int input1 [4] = { 1, 7, 2, 2 };
45 int input2 [4] = { 1, 6, 2, 3 };
48 transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, not_equal_to<int>());
50 CPPUNIT_ASSERT(output[0]==0);
51 CPPUNIT_ASSERT(output[1]==1);
52 CPPUNIT_ASSERT(output[2]==0);
53 CPPUNIT_ASSERT(output[3]==1);