diff -r 000000000000 -r bde4ae8d615e os/ossrv/genericopenlibs/cppstdlib/stl/test/unit/times_test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/test/unit/times_test.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,34 @@ +#include +#include +#include + +#include "cppunit/cppunit_proxy.h" + +#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) +using namespace std; +#endif + +// +// TestCase class +// +class TimesTest : public CPPUNIT_NS::TestCase +{ + CPPUNIT_TEST_SUITE(TimesTest); + CPPUNIT_TEST(times); + CPPUNIT_TEST_SUITE_END(); + +protected: + void times(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(TimesTest); + +// +// tests implementation +// +void TimesTest::times() +{ + int input [4] = { 1, 5, 7, 2 }; + int total = accumulate(input, input + 4, 1, multiplies()); + CPPUNIT_ASSERT(total==70); +}