equal
deleted
inserted
replaced
|
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 setintr0_test main |
|
10 #endif |
|
11 |
|
12 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
13 using namespace std; |
|
14 #endif |
|
15 int setintr0_test(int, char**) |
|
16 { |
|
17 int failures=0; |
|
18 cout<<"Results of setintr0_test:"<<endl; |
|
19 int v1[3] = { 13, 18, 23 }; |
|
20 int v2[4] = { 10, 13, 17, 23 }; |
|
21 int result[4] = { 0, 0, 0, 0 }; |
|
22 |
|
23 set_intersection((int*)v1, (int*)v1 + 3, (int*)v2, (int*)v2 + 4, (int*)result); |
|
24 for(int i = 0; i < 4; i++) |
|
25 cout << result[i] << ' '; |
|
26 cout << endl; |
|
27 |
|
28 if(13!=result[0]) |
|
29 failures++; |
|
30 else if(23!=result[1]) |
|
31 failures++; |
|
32 else if(0!=result[2]) |
|
33 failures++; |
|
34 else if(0!=result[3]) |
|
35 failures++; |
|
36 |
|
37 if(failures) |
|
38 return 1; |
|
39 else |
|
40 return 0; |
|
41 } |
|
42 |
|
43 |