From 5475f5edf549ad540bb4fd0bf70d5c3431b15f45 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 27 Feb 2014 10:02:26 +0000 Subject: [PATCH] Simplify test code git-svn-id: https://svn.dealii.org/trunk@32565 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/matrix_free/thread_correctness_hp.cc | 44 ++++++++-------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/tests/matrix_free/thread_correctness_hp.cc b/tests/matrix_free/thread_correctness_hp.cc index 0d9015d9bb..88d85f98e3 100644 --- a/tests/matrix_free/thread_correctness_hp.cc +++ b/tests/matrix_free/thread_correctness_hp.cc @@ -49,35 +49,21 @@ public: { // Ask MatrixFree for cell_range for different // orders - std::pair subrange_deg = - data.create_cell_subrange_hp (cell_range, 1); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); - subrange_deg = data.create_cell_subrange_hp (cell_range, 2); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); - subrange_deg = data.create_cell_subrange_hp (cell_range, 3); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); - subrange_deg = data.create_cell_subrange_hp (cell_range, 4); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); - subrange_deg = data.create_cell_subrange_hp (cell_range, 5); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); - subrange_deg = data.create_cell_subrange_hp (cell_range, 6); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); - subrange_deg = data.create_cell_subrange_hp (cell_range, 7); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator > (data, dst, src, - subrange_deg); + std::pair subrange_deg; +#define CALL_METHOD(degree) \ + subrange_deg = data.create_cell_subrange_hp(cell_range, degree); \ + if (subrange_deg.second > subrange_deg.first) \ + helmholtz_operator > (data, dst, src, subrange_deg) + + CALL_METHOD(1); + CALL_METHOD(2); + CALL_METHOD(3); + CALL_METHOD(4); + CALL_METHOD(5); + CALL_METHOD(6); + CALL_METHOD(7); + +#undef CALL_METHOD } void vmult (Vector &dst, -- 2.39.5