]> https://gitweb.dealii.org/ - dealii.git/commitdiff
*sigh*
authorMatthias Maier <tamiko@kyomu.43-1.org>
Sat, 7 Dec 2013 22:09:42 +0000 (22:09 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Sat, 7 Dec 2013 22:09:42 +0000 (22:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@31926 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/thread_local_storage_04.cc [new file with mode: 0644]
tests/base/thread_local_storage_04.output [deleted file]
tests/base/thread_local_storage_04.with_threads=on.output

diff --git a/tests/base/thread_local_storage_04.cc b/tests/base/thread_local_storage_04.cc
new file mode 100644 (file)
index 0000000..84e3aea
--- /dev/null
@@ -0,0 +1,82 @@
+// ---------------------------------------------------------------------
+// $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 ThreadLocalStorage::operator= (const T&)
+
+#include "../tests.h"
+#include <iomanip>
+#include <fstream>
+
+#include <deal.II/base/thread_management.h>
+#include <deal.II/base/thread_local_storage.h>
+
+int counter = 10;
+
+struct X
+{
+  Threads::ThreadLocalStorage<int> tls_data;
+
+  X ()
+    :
+    tls_data (42)
+  {}
+
+  int f ()
+  {
+    // use TLS::operator=
+    tls_data = counter++;
+    // access TLS data and have it
+    // converted to the right data type
+    // without the need to call
+    // tls_data.get()
+    return tls_data;
+  }
+};
+
+
+void test ()
+{
+  X x;
+  {
+    Threads::Thread<int> t;
+    t = Threads::new_thread (&X::f, x);
+    AssertThrow (t.return_value() == 10,
+            ExcInternalError());
+  }
+  {
+    Threads::Thread<int> t;
+    t = Threads::new_thread (&X::f, x);
+    AssertThrow (t.return_value() == 11,
+            ExcInternalError());
+  }
+
+  AssertThrow (counter == 12, ExcInternalError());
+}
+
+
+
+
+int main()
+{
+  std::ofstream logfile("output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test ();
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/thread_local_storage_04.output b/tests/base/thread_local_storage_04.output
deleted file mode 100644 (file)
index 0fd8fc1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-DEAL::OK
index 84e3aea0c1ef61806481f840e89f14da8f75b344..0fd8fc12f0b442283edd8868867114c242b04d11 100644 (file)
@@ -1,82 +1,2 @@
-// ---------------------------------------------------------------------
-// $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 ThreadLocalStorage::operator= (const T&)
-
-#include "../tests.h"
-#include <iomanip>
-#include <fstream>
-
-#include <deal.II/base/thread_management.h>
-#include <deal.II/base/thread_local_storage.h>
-
-int counter = 10;
-
-struct X
-{
-  Threads::ThreadLocalStorage<int> tls_data;
-
-  X ()
-    :
-    tls_data (42)
-  {}
-
-  int f ()
-  {
-    // use TLS::operator=
-    tls_data = counter++;
-    // access TLS data and have it
-    // converted to the right data type
-    // without the need to call
-    // tls_data.get()
-    return tls_data;
-  }
-};
-
-
-void test ()
-{
-  X x;
-  {
-    Threads::Thread<int> t;
-    t = Threads::new_thread (&X::f, x);
-    AssertThrow (t.return_value() == 10,
-            ExcInternalError());
-  }
-  {
-    Threads::Thread<int> t;
-    t = Threads::new_thread (&X::f, x);
-    AssertThrow (t.return_value() == 11,
-            ExcInternalError());
-  }
-
-  AssertThrow (counter == 12, ExcInternalError());
-}
-
-
-
-
-int main()
-{
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
-  deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
-
-  test ();
-  deallog << "OK" << std::endl;
-}
+DEAL::OK

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.