Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
amdis
amdis-core
Commits
1bf4708f
Commit
1bf4708f
authored
6 years ago
by
Müller, Felix
Committed by
Praetorius, Simon
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added unit test for AdaptInfo
parent
ec7ad61e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/AdaptInfoTest.cpp
+38
-0
38 additions, 0 deletions
test/AdaptInfoTest.cpp
test/CMakeLists.txt
+3
-0
3 additions, 0 deletions
test/CMakeLists.txt
with
41 additions
and
0 deletions
test/AdaptInfoTest.cpp
0 → 100644
+
38
−
0
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
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
3
−
0
View file @
1bf4708f
dune_add_test
(
SOURCES AdaptInfoTest.cpp
LINK_LIBRARIES amdis
)
dune_add_test
(
SOURCES ClonablePtrTest.cpp
LINK_LIBRARIES amdis
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment