FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_Database.cpp
Go to the documentation of this file.
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #include <fei_macros.hpp>
10 #include <fei_mpi.h>
12 #include <snl_fei_Utils.hpp>
13 #include <snl_fei_MapContig.hpp>
14 
15 #undef fei_file
16 #define fei_file "test_Database.cpp"
17 
18 #include <fei_ErrMacros.hpp>
19 
21  : tester(comm)
22 {
23 }
24 
26 {
27 }
28 
30 {
31  FEI_COUT << "testing snl_fei::MapContig...";
32 
33  snl_fei::MapContig<int> mc(0, 3);
34 
35  std::pair<snl_fei::MapContig<int>::iterator,bool> mpair = mc.insert(std::pair<int,int>(1, 2));
36 
37  snl_fei::MapContig<int>::iterator miter = mpair.first;
38 
39  if ((*miter).second != 2) {
40  throw std::runtime_error("MapContig insert iter test 1 failed.");
41  }
42 
43  mc.insert(std::pair<int,int>(0,1));
44 
46  m_iter = mc.begin(),
47  m_end = mc.end();
48 
49  if ((*m_iter).first != 0) {
50  throw std::runtime_error("MapContig iter test 1 failed.");
51  }
52 
53  if ((*m_iter).second != 1) {
54  throw std::runtime_error("MapContig iter test 2 failed.");
55  }
56 
57  ++m_iter;
58 
59  if ((*m_iter).first != 1) {
60  throw std::runtime_error("MapContig iter test 3 failed.");
61  }
62 
63  if ((*m_iter).second != 2) {
64  throw std::runtime_error("MapContig iter test 4 failed.");
65  }
66 
67  FEI_COUT << "ok"<<FEI_ENDL;
68 }
69 
71 {
72  if (numProcs_ > 1) return(0);
73 
75 
76  CHK_ERR( test1() );
77  CHK_ERR( test2() );
78  CHK_ERR( test3() );
79  CHK_ERR( test4() );
80  CHK_ERR( test5() );
81  CHK_ERR( test6() );
82  CHK_ERR( test7() );
83  CHK_ERR( test8() );
84 
85  return(0);
86 }
87 
89 {
90  return(0);
91 }
92 
94 {
95  return(0);
96 }
97 
99 {
100  return(0);
101 }
102 
104 {
105 
106  return(0);
107 }
108 
110 {
111 
112  return(0);
113 }
114 
116 {
117 
118  return(0);
119 }
120 
122 {
123 
124  return(0);
125 }
126 
128 {
129 
130  return(0);
131 }
#define FEI_COUT
#define MPI_Comm
Definition: fei_mpi.h:56
virtual ~test_Database()
std::pair< iterator, bool > insert(value_type val)
test_Database(MPI_Comm comm)
int numProcs_
Definition: tester.hpp:38
#define FEI_ENDL
void test_MapContig_1()
#define CHK_ERR(a)