home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / incl1.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  835b  |  37 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <vector>
  5. #include <algorithm>
  6. #include <iostream>
  7.  
  8. #ifdef MAIN 
  9. #define incl1_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15. int incl1_test(int, char**)
  16. {
  17.   cout<<"Results of incl1_test:"<<endl;
  18.   vector<int> v1(10);
  19.   vector<int> v2(3);
  20.   int i;
  21.   for(i = 0; i < v1.size(); i++)
  22.   {
  23.     v1[i] = i;
  24.   }
  25.   if(includes(v1.begin(), v1.end(), v2.begin(), v2.end()))
  26.     cout << "v1 includes v2" << endl;
  27.   else
  28.     cout << "v1 does not include v2" << endl;
  29.   for(i = 0; i < v2.size(); i++)
  30.     v2[i] = i + 3;
  31.   if(includes(v1.begin(), v1.end(), v2.begin(), v2.end()))
  32.     cout << "v1 includes v2" << endl;
  33.   else
  34.     cout << "v1 does not include v2" << endl;
  35.   return 0;
  36. }
  37.