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 swap1_test main
|
|
10 |
#endif
|
|
11 |
|
|
12 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
13 |
using namespace std;
|
|
14 |
#endif
|
|
15 |
int swap1_test(int, char**)
|
|
16 |
{
|
|
17 |
cout<<"Results of swap1_test:"<<endl;
|
|
18 |
int a = 42;
|
|
19 |
int b = 19;
|
|
20 |
cout << "a = " << a << " b = " << b << endl;
|
|
21 |
swap(a, b);
|
|
22 |
cout << "a = " << a << " b = " << b << endl;
|
|
23 |
|
|
24 |
if(a!=19 || b!=42)
|
|
25 |
return 1;
|
|
26 |
else
|
|
27 |
return 0;
|
|
28 |
}
|
|
29 |
|