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