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