equal
deleted
inserted
replaced
|
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 #include <algorithm> |
|
22 #include <iostream> |
|
23 |
|
24 #ifdef MAIN |
|
25 #define remcopy1_test main |
|
26 #endif |
|
27 |
|
28 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
29 using namespace std; |
|
30 #endif |
|
31 int remcopy1_test(int, char**) |
|
32 { |
|
33 |
|
34 int failures=0; |
|
35 cout<<"Results of remcopy1_test:"<<endl; |
|
36 int numbers[6] = { 1, 2, 3, 1, 2, 3 }; |
|
37 int result[6] = { 0, 0, 0, 0, 0, 0 }; |
|
38 |
|
39 remove_copy((int*)numbers, (int*)numbers + 6, (int*)result, 2); |
|
40 for(int i = 0; i < 6; i++) |
|
41 cout << result[i] << ' '; |
|
42 cout << endl; |
|
43 |
|
44 if(1!=result[0]) |
|
45 failures++; |
|
46 else if(3!=result[1]) |
|
47 failures++; |
|
48 else if(1!=result[2]) |
|
49 failures++; |
|
50 else if(3!=result[3]) |
|
51 failures++; |
|
52 else if(0!=result[4]) |
|
53 failures++; |
|
54 else if(0!=result[5]) |
|
55 failures++; |
|
56 |
|
57 if(failures) |
|
58 return 1; |
|
59 else |
|
60 return 0; |
|
61 } |
|
62 |