diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 82bc31b7a3f9b06f6c17f75c590d8e96bff22789..3eef3b941528456f55ae2f2273e23db5324d284b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,6 +24,9 @@ dune_add_test(SOURCES DiscreteFunctionTest.cpp dune_add_test(SOURCES ExpressionsTest.cpp LINK_LIBRARIES amdis) +dune_add_test(SOURCES FakeContainerTest.cpp + LINK_LIBRARIES amdis) + dune_add_test(SOURCES FieldMatVecTest.cpp LINK_LIBRARIES amdis) diff --git a/test/FakeContainerTest.cpp b/test/FakeContainerTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..758e158f71b49d4c807489e7612bada19b232e2c --- /dev/null +++ b/test/FakeContainerTest.cpp @@ -0,0 +1,37 @@ +#include <amdis/AMDiS.hpp> +#include <amdis/common/FakeContainer.hpp> + +#include "Tests.hpp" + +using namespace AMDiS; + +int main(int argc, char** argv) +{ + // Environment env(argc, argv); + + FakeContainer vec1; + FakeContainer vec2(vec1); + FakeContainer vec3(std::move(vec2)); + + FakeContainer vec4 = vec1; + FakeContainer vec5 = std::move(vec3); + + vec1.reserve(7); + vec1.resize(1); + vec4.resize(1); + + vec1[0] = 0.0; + vec4[1] = vec1[0]; + + vec1.push_back(42); + vec1.emplace_back(42); + + AMDIS_TEST(vec1.empty()); + AMDIS_TEST(vec1.size() == 0u); + + vec1.front() = 1; + front(vec4) = 2; + back(vec4) = vec1.back(); + + return 0; +}