Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
1bf4708f
Commit
1bf4708f
authored
May 23, 2018
by
Müller, Felix
Committed by
Praetorius, Simon
May 23, 2018
Browse files
Added unit test for AdaptInfo
parent
ec7ad61e
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/AdaptInfoTest.cpp
0 → 100644
View file @
1bf4708f
#include
<amdis/AdaptInfo.cpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/common/Literals.hpp>
#include
<amdis/utility/TreePath.hpp>
#include
"Tests.hpp"
using
namespace
AMDiS
;
int
main
()
{
AdaptInfo
adaptInfo
(
"adapt"
);
auto
root_tp
=
treepath
();
auto
tp
=
treepath
(
0
_c
);
std
::
string
str
=
"0"
;
adaptInfo
.
setEstSum
(
0.1
,
tp
);
AMDIS_TEST_EQ
(
adaptInfo
.
getEstSum
(
tp
),
0.1
);
adaptInfo
.
setEstSum
(
0.2
,
root_tp
);
AMDIS_TEST_EQ
(
adaptInfo
.
getEstSum
(
root_tp
),
0.2
);
AMDIS_TEST_EQ
(
adaptInfo
.
getSize
(),
2
);
adaptInfo
.
setEstSum
(
0.3
,
"0"
);
AMDIS_TEST_EQ
(
adaptInfo
.
getEstSum
(
tp
),
0.3
);
adaptInfo
.
setEstSum
(
0.4
,
0
_c
);
AMDIS_TEST_EQ
(
adaptInfo
.
getEstSum
(
tp
),
0.4
);
adaptInfo
.
setEstSum
(
0.5
,
str
);
AMDIS_TEST_EQ
(
adaptInfo
.
getEstSum
(
tp
),
0.5
);
return
report_errors
();
}
\ No newline at end of file
test/CMakeLists.txt
View file @
1bf4708f
dune_add_test
(
SOURCES AdaptInfoTest.cpp
LINK_LIBRARIES amdis
)
dune_add_test
(
SOURCES ClonablePtrTest.cpp
dune_add_test
(
SOURCES ClonablePtrTest.cpp
LINK_LIBRARIES amdis
)
LINK_LIBRARIES amdis
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment