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 |
#include <cstring>
|
|
8 |
|
|
9 |
#ifdef MAIN
|
|
10 |
#define min2_test main
|
|
11 |
#endif
|
|
12 |
|
|
13 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
14 |
using namespace std;
|
|
15 |
#endif
|
|
16 |
|
|
17 |
static bool str_compare(const char* a_, const char* b_)
|
|
18 |
{
|
|
19 |
return strcmp(a_, b_) < 0 ? 1 : 0;
|
|
20 |
}
|
|
21 |
|
|
22 |
int min2_test(int, char**)
|
|
23 |
{
|
|
24 |
cout<<"Results of min2_test:"<<endl;
|
|
25 |
|
|
26 |
cout << min((char *)"shoe",(char *)"shine", str_compare) << endl;
|
|
27 |
if (!strcmp(min((char *)"shoe",(char *)"shine", str_compare), "shine"))
|
|
28 |
return 0;
|
|
29 |
else
|
|
30 |
return 1;
|
|
31 |
}
|