author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
1 #include <algorithm>
2 #include <numeric>
3 #include <functional>
5 #include "cppunit/cppunit_proxy.h"
7 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
8 using namespace std;
9 #endif
11 //
12 // TestCase class
13 //
14 class TimesTest : public CPPUNIT_NS::TestCase
15 {
16 CPPUNIT_TEST_SUITE(TimesTest);
17 CPPUNIT_TEST(times);
18 CPPUNIT_TEST_SUITE_END();
20 protected:
21 void times();
22 };
24 CPPUNIT_TEST_SUITE_REGISTRATION(TimesTest);
26 //
27 // tests implementation
28 //
29 void TimesTest::times()
30 {
31 int input [4] = { 1, 5, 7, 2 };
32 int total = accumulate(input, input + 4, 1, multiplies<int>());
33 CPPUNIT_ASSERT(total==70);
34 }