From: bangerth Date: Tue, 2 Jul 2013 18:32:54 +0000 (+0000) Subject: Patch by Denis Davydov: Add TableIndices::operator[] in a non-const version. Add... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f84ebe49fada69a67162574475e2ec9252aa9ba1;p=dealii-svn.git Patch by Denis Davydov: Add TableIndices::operator[] in a non-const version. Add tests. git-svn-id: https://svn.dealii.org/trunk@29916 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/table_indices_01.cc b/tests/base/table_indices_01.cc new file mode 100644 index 0000000000..806a881945 --- /dev/null +++ b/tests/base/table_indices_01.cc @@ -0,0 +1,48 @@ +//---------------------------- table_indices_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006, 2013 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- table_indices_01.cc --------------------------- + +// check TableIndices in various ways + +#include "../tests.h" +#include +#include +#include +#include +#include + +int main () +{ + std::ofstream logfile("table_indices_01/output"); + deallog << std::setprecision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + const TableIndices<2> t1(84,42); + TableIndices<2> t2; + t2[0] = 84; + t2[1] = 42; + + Assert (t1 == t2, ExcInternalError()); + Assert (t1[0] == t2[0], ExcInternalError()); + Assert (t1[1] == t2[1], ExcInternalError()); + + Assert (! (t1 != t2), ExcInternalError()); + + t2.sort(); + Assert (t1 != t2, ExcInternalError()); + Assert (t1[0] == t2[1], ExcInternalError()); + Assert (t1[1] == t2[0], ExcInternalError()); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/table_indices_01/cmp/generic b/tests/base/table_indices_01/cmp/generic new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/base/table_indices_01/cmp/generic @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/base/work_stream_03.cc b/tests/base/work_stream_03.cc index 0493581e31..eb6dc88d5c 100644 --- a/tests/base/work_stream_03.cc +++ b/tests/base/work_stream_03.cc @@ -19,7 +19,7 @@ // the failing tests (deal.II/project_q_01) multiple times and // verifying that it indeed works -#include "../tests.h" +//#include "../tests.h" #include #include #include @@ -50,6 +50,8 @@ #include #include +using namespace dealii; + char logname[] = "work_stream_03/output"; @@ -130,7 +132,7 @@ void test () { Triangulation triangulation; GridGenerator::hyper_cube (triangulation); - triangulation.refine_global (3); + triangulation.refine_global (2); Threads::TaskGroup<> g; for (unsigned int p=1; p<4; ++p) @@ -148,9 +150,15 @@ int main () deallog.depth_console(0); deallog.threshold_double(1.e-10); - test<1>(); - test<2>(); - test<3>(); + + Threads::TaskGroup<> g; + for (unsigned int i=0; i<2; ++i) + { + g += Threads::new_task (&test<1>); + g += Threads::new_task (&test<2>); + g += Threads::new_task (&test<3>); + } + g.join_all (); deallog << "OK" << std::endl; }