|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 // STLport regression testsuite component. |
|
19 // To compile as a separate example, please #define MAIN. |
|
20 |
|
21 |
|
22 #include <iostream> |
|
23 #include <algorithm> |
|
24 |
|
25 #ifdef MAIN |
|
26 #define incl0_test main |
|
27 #endif |
|
28 |
|
29 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
30 using namespace std; |
|
31 #endif |
|
32 int incl0_test(int, char**) |
|
33 { |
|
34 cout<<"Results of incl0_test:"<<endl; |
|
35 int failures = 0; |
|
36 int numbers1[5] = { 1, 2, 3, 4, 5 }; |
|
37 int numbers2[5] = { 1, 2, 4, 8, 16 }; |
|
38 int numbers3[2] = { 4, 8 }; |
|
39 |
|
40 if(includes(numbers1, numbers1 + 5, numbers3, numbers3 + 2)) |
|
41 { |
|
42 failures++; |
|
43 cout << "numbers1 includes numbers3" << endl; |
|
44 } |
|
45 else |
|
46 cout << "numbers1 does not include numbers3" << endl; |
|
47 |
|
48 if(includes(numbers2, numbers2 + 5, numbers3, numbers3 + 2)) |
|
49 cout << "numbers2 includes numbers3" << endl; |
|
50 else |
|
51 { |
|
52 failures++; |
|
53 cout << "numbers2 does not include numbers3" << endl; |
|
54 } |
|
55 return 0; |
|
56 } |