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