Commit 8628e411 authored by Müller, Felix's avatar Müller, Felix
Browse files

Added unit test for AdaptInfo

parent 9e6755b4
#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
dune_add_test(SOURCES ClonablePtrTest.cpp
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment