stdcpp/tsrc/Stdcpp_test/stlport/auto/stlport_nequal/src/nequal.cpp
changeset 0 e4d67989cc36
child 18 47c74d1534e1
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1  
       
     2 // STLport regression testsuite component.
       
     3 // To compile as a separate example, please #define MAIN.
       
     4 
       
     5 #include <iostream>
       
     6 #include <algorithm>
       
     7 #include <functional>
       
     8 
       
     9 #ifdef MAIN 
       
    10 #define nequal_test main
       
    11 #endif
       
    12 
       
    13 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
       
    14 using namespace std;
       
    15 #endif
       
    16 int nequal_test(int, char**)
       
    17 {
       
    18   cout<<"Results of nequal_test:"<<endl;
       
    19 int input1 [4] = { 1, 7, 2, 2 };
       
    20 int input2 [4] = { 1, 6, 2, 3 };
       
    21 int failure = 0;
       
    22   int output [4];
       
    23   transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, not_equal_to<int>());
       
    24   for(int i = 0; i < 4; i++)
       
    25     cout << output[i] << endl;
       
    26     if(output[0] != 0)
       
    27     failure++;
       
    28     if(output[1] != 1)
       
    29     failure++;
       
    30     if(output[2] != 0)
       
    31     failure++;
       
    32     if(output[3] != 1)
       
    33     failure++;
       
    34   return failure;
       
    35 }