]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test WorkStream with empty functions
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 26 Aug 2013 10:33:56 +0000 (10:33 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 26 Aug 2013 10:33:56 +0000 (10:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@30495 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/work_stream_04.cc [new file with mode: 0644]
tests/base/work_stream_04/cmp/generic [new file with mode: 0644]

diff --git a/tests/base/work_stream_04.cc b/tests/base/work_stream_04.cc
new file mode 100644 (file)
index 0000000..50a6cc6
--- /dev/null
@@ -0,0 +1,58 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2008 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// test WorkStream with empty functions
+
+#include "../tests.h"
+#include <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+
+#include <deal.II/base/work_stream.h>
+
+
+struct ScratchData
+{};
+
+
+void test ()
+{
+  std::vector<unsigned int> v;
+  for (unsigned int i=0; i<20; ++i)
+    v.push_back (i);
+
+  WorkStream::run (v.begin(), v.end(),
+                   std_cxx1x::function<void(const std::vector<unsigned int>::iterator,
+                                            ScratchData&,unsigned int&)>(),
+                   std_cxx1x::function<void(const unsigned int&)>(),
+                   ScratchData(),
+                   0U);
+}
+
+
+
+
+int main()
+{
+  std::ofstream logfile("work_stream_04/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test ();
+}
diff --git a/tests/base/work_stream_04/cmp/generic b/tests/base/work_stream_04/cmp/generic
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.