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 |
#ifdef MAIN
|
|
10 |
#define count0_test main
|
|
11 |
#endif
|
|
12 |
|
|
13 |
|
|
14 |
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
|
|
15 |
using namespace std;
|
|
16 |
#endif
|
|
17 |
int count0_test(int, char**)
|
|
18 |
{
|
|
19 |
|
|
20 |
cout<<"Results of count0_test:"<<endl;
|
|
21 |
int numbers[10] = { 1, 2, 4, 1, 2, 4, 1, 2, 4, 1 };
|
|
22 |
|
|
23 |
int result = 0;
|
|
24 |
count(numbers, numbers + 10, 1, result);
|
|
25 |
cout << "Found " << result << " 1's." << endl;
|
|
26 |
|
|
27 |
if(result == 4)
|
|
28 |
return 0;
|
|
29 |
else
|
|
30 |
return 1;
|
|
31 |
|
|
32 |
}
|