Update contrib.
5 #include "cppunit/cppunit_proxy.h"
7 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
14 class PlusMinusTest : public CPPUNIT_NS::TestCase
16 CPPUNIT_TEST_SUITE(PlusMinusTest);
19 CPPUNIT_TEST_SUITE_END();
26 CPPUNIT_TEST_SUITE_REGISTRATION(PlusMinusTest);
29 // tests implementation
31 void PlusMinusTest::plus0()
33 int input1 [4] = { 1, 6, 11, 8 };
34 int input2 [4] = { 1, 5, 2, 3 };
36 int total = inner_product(input1, input1 + 4, input2, 0, plus<int>(), multiplies <int>());
38 CPPUNIT_ASSERT(total==77);
40 void PlusMinusTest::minus0()
42 int input1 [4] = { 1, 5, 7, 8 };
43 int input2 [4] = { 1, 4, 8, 3 };
47 transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, minus<int>());
48 CPPUNIT_ASSERT(output[0]==0);
49 CPPUNIT_ASSERT(output[1]==1);
50 CPPUNIT_ASSERT(output[2]==-1);
51 CPPUNIT_ASSERT(output[3]==5);