]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Testsuite: Port some tests to the CMake style config.h.in
authorMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 5 Dec 2012 14:09:05 +0000 (14:09 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 5 Dec 2012 14:09:05 +0000 (14:09 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27761 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/mutex_01.cc
tests/bits/data_out_curved_cells.cc
tests/bits/fe_system.cc

index 856df038e214359d944e89275efeb2673d94795c..7ee33043a9dd179e6a7ae00fae793105cb09e1b2 100644 (file)
 Threads::ThreadMutex mutex;
 
 
-void test () 
+void test ()
 {
-                                   // get the mutex, but note that it is first
-                                   // held by main() which will therefore
-                                   // usually get to write to deallog first
+  // get the mutex, but note that it is first
+  // held by main() which will therefore
+  // usually get to write to deallog first
   mutex.acquire();
   deallog << "2" << std::endl;
 }
 
-  
+
 int main()
 {
   std::ofstream logfile("mutex_01/output");
@@ -41,30 +41,27 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  if (DEAL_II_USE_MT != 0)
-    {
-      mutex.acquire ();
-  
-      Threads::Thread<> t = Threads::new_thread (&test);
-
-      sleep (2);
-      deallog << "1" << std::endl;
-  
-      mutex.release ();
-      t.join ();
-
-                                      // the other thread should now have
-                                      // acquired the mutex, so release
-                                      // it again (destroying an acquired
-                                      // lock invokes undefined behavior
-                                      // in pthread_mutex_destroy)
-      mutex.release ();
-    }
-  else
-    {
-                                      // make sure the test also
-                                      // works in non-MT mode
-      deallog << "1" << std::endl;
-      deallog << "2" << std::endl;
-    }
+#ifdef DEAL_II_USE_MT
+
+  mutex.acquire ();
+
+  Threads::Thread<> t = Threads::new_thread (&test);
+
+  sleep (2);
+  deallog << "1" << std::endl;
+
+  mutex.release ();
+  t.join ();
+
+  // the other thread should now have acquired the mutex, so release it
+  // again (destroying an acquired lock invokes undefined behavior in
+  // pthread_mutex_destroy)
+  mutex.release ();
+
+#else
+
+  // make sure the test also works in non-MT mode
+  deallog << "1" << std::endl;
+  deallog << "2" << std::endl;
+#endif
 }
index 70940c193d197054a036cc9714ab0306e92828af..663b4c67bb2a94e6bee4cc1e4ddc5619bf2f30d0 100644 (file)
@@ -256,7 +256,7 @@ int main ()
                                   // to me, appears to deadlock at
                                   // times. make sure we kill it
                                   // after some time
-#if DEAL_II_USE_MT == 1
+#ifdef DEAL_II_USE_MT
   DeadlockKiller killer;
 #endif
 
index 773adcfc1b2e11f1dd01cb231174bcfcb12949b5..dea26d124f62b996e269d10d467ec98bef4fd13c 100644 (file)
@@ -40,7 +40,7 @@
 template<int dim>
 void test()
 {
-  #if DEAL_II_USE_MT == 1
+  #ifdef DEAL_II_USE_MT
 
   DeadlockKiller killer;
   #endif

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.