test_Database.cpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #include <fei_macros.hpp>
00010 #include <fei_mpi.h>
00011 #include <test_utils/test_Database.hpp>
00012 #include <snl_fei_Utils.hpp>
00013 #include <snl_fei_MapContig.hpp>
00014 
00015 #undef fei_file
00016 #define fei_file "test_Database.cpp"
00017 
00018 #include <fei_ErrMacros.hpp>
00019 
00020 test_Database::test_Database(MPI_Comm comm)
00021  : tester(comm)
00022 {
00023 }
00024 
00025 test_Database::~test_Database()
00026 {
00027 }
00028 
00029 void test_MapContig_1()
00030 {
00031   FEI_COUT << "testing snl_fei::MapContig...";
00032 
00033   snl_fei::MapContig<int> mc(0, 3);
00034 
00035   std::pair<snl_fei::MapContig<int>::iterator,bool> mpair = mc.insert(std::pair<int,int>(1, 2));
00036 
00037   snl_fei::MapContig<int>::iterator miter = mpair.first;
00038 
00039   if ((*miter).second != 2) {
00040     throw std::runtime_error("MapContig insert iter test 1 failed.");
00041   }
00042 
00043   mc.insert(std::pair<int,int>(0,1));
00044 
00045   snl_fei::MapContig<int>::iterator
00046     m_iter = mc.begin(),
00047     m_end = mc.end();
00048 
00049   if ((*m_iter).first != 0) {
00050     throw std::runtime_error("MapContig iter test 1 failed.");
00051   }
00052 
00053   if ((*m_iter).second != 1) {
00054     throw std::runtime_error("MapContig iter test 2 failed.");
00055   }
00056 
00057   ++m_iter;
00058 
00059   if ((*m_iter).first != 1) {
00060     throw std::runtime_error("MapContig iter test 3 failed.");
00061   }
00062 
00063   if ((*m_iter).second != 2) {
00064     throw std::runtime_error("MapContig iter test 4 failed.");
00065   }
00066 
00067   FEI_COUT << "ok"<<FEI_ENDL;
00068 }
00069 
00070 int test_Database::runtests()
00071 {
00072   if (numProcs_ > 1) return(0);
00073 
00074   test_MapContig_1();
00075 
00076   CHK_ERR( test1() );
00077   CHK_ERR( test2() );
00078   CHK_ERR( test3() );
00079   CHK_ERR( test4() );
00080   CHK_ERR( test5() );
00081   CHK_ERR( test6() );
00082   CHK_ERR( test7() );
00083   CHK_ERR( test8() );
00084 
00085   return(0);
00086 }
00087 
00088 int test_Database::test1()
00089 {
00090   return(0);
00091 }
00092 
00093 int test_Database::test2()
00094 {
00095   return(0);
00096 }
00097 
00098 int test_Database::test3()
00099 {
00100   return(0);
00101 }
00102 
00103 int test_Database::test4()
00104 {
00105 
00106   return(0);
00107 }
00108 
00109 int test_Database::test5()
00110 {
00111 
00112   return(0);
00113 }
00114 
00115 int test_Database::test6()
00116 {
00117 
00118   return(0);
00119 }
00120 
00121 int test_Database::test7()
00122 {
00123 
00124   return(0);
00125 }
00126 
00127 int test_Database::test8()
00128 {
00129 
00130   return(0);
00131 }

Generated on Wed May 12 21:30:42 2010 for FEI by  doxygen 1.4.7