FEI Version of the Day
test_Database.cpp
00001 /*
00002 // @HEADER
00003 // ************************************************************************
00004 //             FEI: Finite Element Interface to Linear Solvers
00005 //                  Copyright (2005) Sandia Corporation.
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
00008 // U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Alan Williams (william@sandia.gov) 
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 */
00042 
00043 #include <fei_macros.hpp>
00044 #include <fei_mpi.h>
00045 #include <test_utils/test_Database.hpp>
00046 #include <snl_fei_Utils.hpp>
00047 #include <snl_fei_MapContig.hpp>
00048 
00049 #undef fei_file
00050 #define fei_file "test_Database.cpp"
00051 
00052 #include <fei_ErrMacros.hpp>
00053 
00054 test_Database::test_Database(MPI_Comm comm)
00055  : tester(comm)
00056 {
00057 }
00058 
00059 test_Database::~test_Database()
00060 {
00061 }
00062 
00063 void test_MapContig_1()
00064 {
00065   FEI_COUT << "testing snl_fei::MapContig...";
00066 
00067   snl_fei::MapContig<int> mc(0, 3);
00068 
00069   std::pair<snl_fei::MapContig<int>::iterator,bool> mpair = mc.insert(std::pair<int,int>(1, 2));
00070 
00071   snl_fei::MapContig<int>::iterator miter = mpair.first;
00072 
00073   if ((*miter).second != 2) {
00074     throw std::runtime_error("MapContig insert iter test 1 failed.");
00075   }
00076 
00077   mc.insert(std::pair<int,int>(0,1));
00078 
00079   snl_fei::MapContig<int>::iterator
00080     m_iter = mc.begin(),
00081     m_end = mc.end();
00082 
00083   if ((*m_iter).first != 0) {
00084     throw std::runtime_error("MapContig iter test 1 failed.");
00085   }
00086 
00087   if ((*m_iter).second != 1) {
00088     throw std::runtime_error("MapContig iter test 2 failed.");
00089   }
00090 
00091   ++m_iter;
00092 
00093   if ((*m_iter).first != 1) {
00094     throw std::runtime_error("MapContig iter test 3 failed.");
00095   }
00096 
00097   if ((*m_iter).second != 2) {
00098     throw std::runtime_error("MapContig iter test 4 failed.");
00099   }
00100 
00101   FEI_COUT << "ok"<<FEI_ENDL;
00102 }
00103 
00104 int test_Database::runtests()
00105 {
00106   if (numProcs_ > 1) return(0);
00107 
00108   test_MapContig_1();
00109 
00110   CHK_ERR( test1() );
00111   CHK_ERR( test2() );
00112   CHK_ERR( test3() );
00113   CHK_ERR( test4() );
00114   CHK_ERR( test5() );
00115   CHK_ERR( test6() );
00116   CHK_ERR( test7() );
00117   CHK_ERR( test8() );
00118 
00119   return(0);
00120 }
00121 
00122 int test_Database::test1()
00123 {
00124   return(0);
00125 }
00126 
00127 int test_Database::test2()
00128 {
00129   return(0);
00130 }
00131 
00132 int test_Database::test3()
00133 {
00134   return(0);
00135 }
00136 
00137 int test_Database::test4()
00138 {
00139 
00140   return(0);
00141 }
00142 
00143 int test_Database::test5()
00144 {
00145 
00146   return(0);
00147 }
00148 
00149 int test_Database::test6()
00150 {
00151 
00152   return(0);
00153 }
00154 
00155 int test_Database::test7()
00156 {
00157 
00158   return(0);
00159 }
00160 
00161 int test_Database::test8()
00162 {
00163 
00164   return(0);
00165 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends