31
|
1 |
|
|
2 |
|
|
3 |
// STLport regression testsuite component.
|
|
4 |
// To compile as a separate example, please #define MAIN.
|
|
5 |
|
|
6 |
#include <iostream>
|
|
7 |
#include <algorithm>
|
|
8 |
#include <functional>
|
|
9 |
|
|
10 |
#ifdef MAIN
|
|
11 |
#define equalto_test main
|
|
12 |
#endif
|
|
13 |
|
|
14 |
|
|
15 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
16 |
using namespace std;
|
|
17 |
#endif
|
|
18 |
int equalto_test(int, char**)
|
|
19 |
{
|
|
20 |
cout<<"Results of equalto_test:"<<endl;
|
|
21 |
int input1 [4] = { 1, 7, 2, 2 };
|
|
22 |
int input2 [4] = { 1, 6, 2, 3 };
|
|
23 |
int res_arr[4] = { 1, 0, 1, 0 };
|
|
24 |
int failures = 0;
|
|
25 |
|
|
26 |
int output [4];
|
|
27 |
transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, equal_to<int>());
|
|
28 |
for(int i = 0; i < 4; i++)
|
|
29 |
{
|
|
30 |
cout << output[i] << endl;
|
|
31 |
if (output[i] != res_arr[i])
|
|
32 |
failures++;
|
|
33 |
}
|
|
34 |
|
|
35 |
if(!failures)
|
|
36 |
return 0;
|
|
37 |
else
|
|
38 |
return 1;
|
|
39 |
}
|
|
40 |
|