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