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 <functional> |
|
22 #include <iostream> |
|
23 #include <algorithm> |
|
24 |
|
25 #ifdef MAIN |
|
26 #define logicand_test main |
|
27 #endif |
|
28 |
|
29 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
30 using namespace std; |
|
31 #endif |
|
32 int logicand_test(int, char**) |
|
33 { |
|
34 cout<<"Results of logicand_test:"<<endl; |
|
35 int input1 [4] = { 1, 1, 0, 1 }; |
|
36 int input2 [4] = { 0, 1, 0, 0 }; |
|
37 int failures = 0; |
|
38 |
|
39 int output [4]; |
|
40 transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, logical_and<bool>()); |
|
41 for(int i = 0; i < 4; i++) |
|
42 cout << output[i] << endl; |
|
43 if(output[0] != 0) |
|
44 failures++; |
|
45 if(output[1] != 1) |
|
46 failures++; |
|
47 if(output[2] !=0 ) |
|
48 failures++; |
|
49 if(output[3] != 0) |
|
50 failures++; |
|
51 return failures; |
|
52 } |