diff --git a/amdis/gridfunctions/test/ComposerVectorGridFunction.cpp b/amdis/gridfunctions/test/ComposerVectorGridFunction.cpp index 7c619742dc7406e70b38aa2f01c130757522c533..238a26cef3b1f32e7c70ec2e5394a9a18b61d7fe 100644 --- a/amdis/gridfunctions/test/ComposerVectorGridFunction.cpp +++ b/amdis/gridfunctions/test/ComposerVectorGridFunction.cpp @@ -42,7 +42,7 @@ int main(int argc, char** argv) auto vec_gf = makeComposerVectorGridFunction(f, gridView, std::vector{gf0,gf1}); static_assert(Concepts::GridFunction<TYPEOF(vec_gf)>); - FieldVector<double,2> x = {0.5, 0.5}; + [[maybe_unused]] FieldVector<double,2> x = {0.5, 0.5}; assert(almost_equal(gf0(x)+gf1(x), vec_gf(x))); auto lf0 = localFunction(gf0); @@ -54,8 +54,8 @@ int main(int argc, char** argv) lf1.bind(e); vec_lf.bind(e); - auto refElem = referenceElement(e); - auto local = refElem.position(0,0); + [[maybe_unused]] auto refElem = referenceElement(e); + [[maybe_unused]] auto local = refElem.position(0,0); assert(almost_equal(lf0(local)+lf1(local), vec_lf(local))); lf0.unbind(); diff --git a/amdis/gridfunctions/test/CoordGridFunction.cpp b/amdis/gridfunctions/test/CoordGridFunction.cpp index 23084c367b955c4a41203c7e95439328808948c5..5712015e1b3c51022b40e56332b1667014de20ce 100644 --- a/amdis/gridfunctions/test/CoordGridFunction.cpp +++ b/amdis/gridfunctions/test/CoordGridFunction.cpp @@ -32,7 +32,7 @@ int main(int argc, char** argv) auto gf0 = makeGridFunction(pgf0, gridView); auto gf1 = makeGridFunction(pgf1, gridView); - FieldVector<double,2> x = {0.2, 0.6}; + [[maybe_unused]] FieldVector<double,2> x = {0.2, 0.6}; assert(almost_equal(gf0(x), x[0])); assert(almost_equal(gf1(x), x[1])); @@ -45,8 +45,8 @@ int main(int argc, char** argv) auto refElem = referenceElement(e); auto geo = e.geometry(); - auto local = refElem.position(0,0); - auto global = geo.global(local); + [[maybe_unused]] auto local = refElem.position(0,0); + [[maybe_unused]] auto global = geo.global(local); assert(almost_equal(lf0(local), global[0])); assert(almost_equal(lf1(local), global[1])); diff --git a/test/DataTransferTest2d.cpp b/test/DataTransferTest2d.cpp index 6339d6a5181d954c1a46fe659dedb66912c83291..ee342b5722de66d73b7766da9d20e6006edba21c 100644 --- a/test/DataTransferTest2d.cpp +++ b/test/DataTransferTest2d.cpp @@ -15,16 +15,16 @@ int main(int argc, char** argv) using Domain = typename Dune::FieldVector<double, 2>; // polynomial of order 1 - auto p1 = [](const Domain& x) -> double { return {0.5 + 0.25*(x[0]+x[1])}; }; + auto p1 = [](const Domain& x) -> double { return 0.5 + 0.25*(x[0]+x[1]); }; // polynomial of order 2 - auto p2 = [](const Domain& x) -> double { return {0.5 + 0.25*(2*std::pow(x[0],2) + x[0]*x[1] - std::pow(x[1],2))}; }; + auto p2 = [](const Domain& x) -> double { return 0.5 + 0.25*(2*std::pow(x[0],2) + x[0]*x[1] - std::pow(x[1],2)); }; // polynomial of order 3 - auto p3 = [](const Domain& x) -> double { return {0.5 + 0.25*(2*std::pow(x[0],3) + x[0]*x[1] - std::pow(x[1],3))}; }; + auto p3 = [](const Domain& x) -> double { return 0.5 + 0.25*(2*std::pow(x[0],3) + x[0]*x[1] - std::pow(x[1],3)); }; // analytic function - auto f = [](const Domain& x) -> double { return {0.5 + 0.25*(std::sin(2*pi*x[0]) + 0.25*std::cos(6*pi*x[1]))}; }; + auto f = [](const Domain& x) -> double { return 0.5 + 0.25*(std::sin(2*pi*x[0]) + 0.25*std::cos(6*pi*x[1])); }; AMDIS_TEST( (unchanged_test< Lagrange3<Grid> >({f})) ); AMDIS_TEST( (coarsen_test< Lagrange3<Grid> >({f})) ); diff --git a/test/FieldMatVecTest.cpp b/test/FieldMatVecTest.cpp index 53ea56a4695e1e0f73ed1f46ae4f459fe49efe0e..6587520bd97753bf1b179bf775196f8bc92525cc 100644 --- a/test/FieldMatVecTest.cpp +++ b/test/FieldMatVecTest.cpp @@ -89,7 +89,7 @@ void test2() V a{1.0, 2.0, 3.0}; - V b{2.0, 3.0, 4.0}; + // V b{2.0, 3.0, 4.0}; // AMDIS_TEST_EQ( outer(a, b), (M{ {2.0, 3.0, 4.0}, {4.0, 6.0, 8.0}, {6.0, 9.0, 12.0} }) ); // AMDIS_TEST_EQ( diagonal(a), (M{ {1.0, 0.0, 0.0}, {0.0, 2.0, 0.0}, {0.0, 0.0, 3.0} }) ); diff --git a/test/FilesystemTest.cpp b/test/FilesystemTest.cpp index 2a9e7f53341350c557fb2f31e2c3c3b735d7ea82..214d321b3b71fb1ad683241315f8d845bd23f299 100644 --- a/test/FilesystemTest.cpp +++ b/test/FilesystemTest.cpp @@ -5,14 +5,17 @@ using namespace AMDiS; +#define AMDIS_TEST_EQ_PATH(A,B) \ + AMDIS_TEST_EQ(A.string(), B.string()) + // --------------------------------------------------------------------------------------- void test0() { using namespace AMDiS::filesystem; - AMDIS_TEST_EQ( path("a/b/c").parent_path(), path("a/b") ); - AMDIS_TEST_EQ( path("a/b/c.txt").parent_path(), path("a/b") ); - AMDIS_TEST_EQ( path("a/b/c.txt").filename(), path("c.txt") ); - AMDIS_TEST_EQ( path("a/b/c.txt").stem(), path("c") ); + AMDIS_TEST_EQ_PATH( path("a/b/c").parent_path(), path("a/b") ); + AMDIS_TEST_EQ_PATH( path("a/b/c.txt").parent_path(), path("a/b") ); + AMDIS_TEST_EQ_PATH( path("a/b/c.txt").filename(), path("c.txt") ); + AMDIS_TEST_EQ_PATH( path("a/b/c.txt").stem(), path("c") ); AMDIS_TEST_EQ( path("a/b/c.txt").extension().string(), ".txt" ); AMDIS_TEST_EQ( path("a/b/c.").extension().string(), "." ); @@ -38,7 +41,7 @@ void test0() AMDIS_TEST_EQ( path("a/b/./c").string(), "a/b/c" ); AMDIS_TEST_EQ( path("../a/b/c").string(), "../a/b/c" ); AMDIS_TEST_EQ( path("./a/b/c").string(), "a/b/c" ); - AMDIS_TEST_EQ( path("a/b") /= path("c"), path("a/b/c") ); + AMDIS_TEST_EQ_PATH( path("a/b") /= path("c"), path("a/b/c") ); } void test1() diff --git a/test/ParallelIndexSetTest.cpp b/test/ParallelIndexSetTest.cpp index 592ef1a38694defcd1f18b49c74518d5c9ef966d..db6ba0b504eced21f6209a2ad2639e30a2c24cc8 100644 --- a/test/ParallelIndexSetTest.cpp +++ b/test/ParallelIndexSetTest.cpp @@ -46,7 +46,7 @@ void test_basis(Basis const& basis, std::string gridName, std::string basisName) using Attribute = typename AttributeSet<ParallelIndexSet>::type; std::vector<std::vector<std::pair<IdType,Attribute>>> data(world.size()); - std::size_t owner = 0, notOwner = 0; + [[maybe_unused]] std::size_t owner = 0, notOwner = 0; data[world.rank()].reserve(pis.size()); for (auto const& localPair : pis) { data[world.rank()].push_back({localPair.global(), localPair.local().attribute()});