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 rndshuf0_test main
|
|
10 |
#endif
|
|
11 |
|
|
12 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
13 |
using namespace std;
|
|
14 |
#endif
|
|
15 |
int rndshuf0_test(int, char**)
|
|
16 |
{
|
|
17 |
cout<<"Results of rndshuf0_test:"<<endl;
|
|
18 |
int numbers[6] = { 1, 2, 3, 4, 5, 6 };
|
|
19 |
int failures =0;
|
|
20 |
random_shuffle(numbers, numbers + 6);
|
|
21 |
for(int i = 0; i < 6; i++)
|
|
22 |
cout << numbers[i] << ' ';
|
|
23 |
cout << endl;
|
|
24 |
if (numbers[0] != 1 && numbers[1] != 4 && numbers[2] != 2 && numbers[3] != 5 && numbers[4] != 6 && numbers[5] != 3)
|
|
25 |
failures++;
|
|
26 |
|
|
27 |
return failures;
|
|
28 |
}
|