Skip to content
Snippets Groups Projects
Commit 1bf4708f authored by Müller, Felix's avatar Müller, Felix Committed by Praetorius, Simon
Browse files

Added unit test for AdaptInfo

parent ec7ad61e
No related branches found
No related tags found
No related merge requests found
#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
dune_add_test(SOURCES AdaptInfoTest.cpp
LINK_LIBRARIES amdis)
dune_add_test(SOURCES ClonablePtrTest.cpp
LINK_LIBRARIES amdis)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment