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