31
|
1 |
|
|
2 |
|
|
3 |
// STLport regression testsuite component.
|
|
4 |
// To compile as a separate example, please #define MAIN.
|
|
5 |
|
|
6 |
#include <algorithm>
|
|
7 |
#include <iostream>
|
|
8 |
|
|
9 |
#ifdef MAIN
|
|
10 |
#define equal0_test main
|
|
11 |
#endif
|
|
12 |
|
|
13 |
|
|
14 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
15 |
using namespace std;
|
|
16 |
#endif
|
|
17 |
int equal0_test(int, char**)
|
|
18 |
{
|
|
19 |
cout<<"Results of equal0_test:"<<endl;
|
|
20 |
int numbers1[5] = { 1, 2, 3, 4, 5 };
|
|
21 |
int numbers2[5] = { 1, 2, 4, 8, 16 };
|
|
22 |
int numbers3[2] = { 1, 2 };
|
|
23 |
|
|
24 |
int failures = 0;
|
|
25 |
|
|
26 |
if(equal(numbers1, numbers1 + 5, numbers2))
|
|
27 |
{
|
|
28 |
cout << "numbers1 is equal to numbers2" << endl;
|
|
29 |
failures ++;
|
|
30 |
}
|
|
31 |
else
|
|
32 |
{
|
|
33 |
cout << "numbers1 is not equal to numbers2" << endl;
|
|
34 |
}
|
|
35 |
if(equal(numbers3, numbers3 + 2, numbers1))
|
|
36 |
{
|
|
37 |
cout << "numbers3 is equal to numbers1" << endl;
|
|
38 |
}
|
|
39 |
else
|
|
40 |
{
|
|
41 |
cout << "numbers3 is not equal to numbers1" << endl;
|
|
42 |
failures++;
|
|
43 |
}
|
|
44 |
|
|
45 |
if(!failures)
|
|
46 |
return 0;
|
|
47 |
else
|
|
48 |
return 1;
|
|
49 |
|
|
50 |
}
|