FEI Package Browser (Single Doxygen Collection)
Version of the Day
Loading...
Searching...
No Matches
test_utils
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
>
11
#include <
test_utils/test_Database.hpp
>
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
20
test_Database::test_Database
(
MPI_Comm
comm)
21
:
tester
(comm)
22
{
23
}
24
25
test_Database::~test_Database
()
26
{
27
}
28
29
void
test_MapContig_1
()
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
45
snl_fei::MapContig<int>::iterator
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
70
int
test_Database::runtests
()
71
{
72
if
(
numProcs_
> 1)
return
(0);
73
74
test_MapContig_1
();
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
88
int
test_Database::test1
()
89
{
90
return
(0);
91
}
92
93
int
test_Database::test2
()
94
{
95
return
(0);
96
}
97
98
int
test_Database::test3
()
99
{
100
return
(0);
101
}
102
103
int
test_Database::test4
()
104
{
105
106
return
(0);
107
}
108
109
int
test_Database::test5
()
110
{
111
112
return
(0);
113
}
114
115
int
test_Database::test6
()
116
{
117
118
return
(0);
119
}
120
121
int
test_Database::test7
()
122
{
123
124
return
(0);
125
}
126
127
int
test_Database::test8
()
128
{
129
130
return
(0);
131
}
snl_fei::MapContig::iterator
Definition:
snl_fei_MapContig.hpp:38
snl_fei::MapContig
Definition:
snl_fei_MapContig.hpp:19
snl_fei::MapContig::insert
std::pair< iterator, bool > insert(value_type val)
snl_fei::MapContig::begin
iterator begin()
Definition:
snl_fei_MapContig.hpp:174
snl_fei::MapContig::end
iterator & end()
Definition:
snl_fei_MapContig.hpp:180
test_Database::test5
int test5()
Definition:
test_Database.cpp:109
test_Database::test8
int test8()
Definition:
test_Database.cpp:127
test_Database::runtests
int runtests()
Definition:
test_Database.cpp:70
test_Database::test_Database
test_Database(MPI_Comm comm)
Definition:
test_Database.cpp:20
test_Database::test7
int test7()
Definition:
test_Database.cpp:121
test_Database::test3
int test3()
Definition:
test_Database.cpp:98
test_Database::test6
int test6()
Definition:
test_Database.cpp:115
test_Database::test1
int test1()
Definition:
test_Database.cpp:88
test_Database::test2
int test2()
Definition:
test_Database.cpp:93
test_Database::~test_Database
virtual ~test_Database()
Definition:
test_Database.cpp:25
test_Database::test4
int test4()
Definition:
test_Database.cpp:103
tester
Definition:
tester.hpp:22
tester::numProcs_
int numProcs_
Definition:
tester.hpp:38
fei_ErrMacros.hpp
CHK_ERR
#define CHK_ERR(a)
Definition:
fei_ErrMacros.hpp:26
FEI_ENDL
#define FEI_ENDL
Definition:
fei_iostream.hpp:34
FEI_COUT
#define FEI_COUT
Definition:
fei_iostream.hpp:33
fei_macros.hpp
fei_mpi.h
MPI_Comm
#define MPI_Comm
Definition:
fei_mpi.h:56
snl_fei_MapContig.hpp
snl_fei_Utils.hpp
test_MapContig_1
void test_MapContig_1()
Definition:
test_Database.cpp:29
test_Database.hpp
Generated by
1.9.6