31
|
1 |
|
|
2 |
// STLport regression testsuite component.
|
|
3 |
// To compile as a separate example, please #define MAIN.
|
|
4 |
|
|
5 |
#include <iostream>
|
|
6 |
#include <algorithm>
|
|
7 |
#include <numeric>
|
|
8 |
|
|
9 |
#ifdef MAIN
|
|
10 |
#define times_test main
|
|
11 |
#endif
|
|
12 |
|
|
13 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
14 |
using namespace std;
|
|
15 |
#endif
|
|
16 |
int times_test(int, char**)
|
|
17 |
{
|
|
18 |
cout<<"Results of times_test:"<<endl;
|
|
19 |
int input [4] = { 1, 5, 7, 2 };
|
|
20 |
|
|
21 |
int total = accumulate(input, input + 4, 1, multiplies<int>());
|
|
22 |
cout << "total = " << total << endl;
|
|
23 |
if(70!=total)
|
|
24 |
return 1;
|
|
25 |
else
|
|
26 |
return 0;
|
|
27 |
}
|