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