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