]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix tests 1085/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 6 Jul 2015 07:41:14 +0000 (03:41 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 6 Jul 2015 09:14:32 +0000 (05:14 -0400)
- do not use pow(int, int)
- fix unify_pretty_function()
- replace typenames

tests/base/functions_12.cc
tests/base/number_traits_complex.cc
tests/tests.h

index 8cfbcf1f9e4c9389bfb34e2184289a9e1cbf5158..92b33a989db87c6a04089010b4bb4373212ab14f 100644 (file)
@@ -32,7 +32,7 @@ void check()
 
   std::vector<double> coeffs(n_mon);
   for (unsigned int i = 0; i < n_mon; ++i)
-    coeffs[i] = std::pow(-1,i)*(i+1);
+    coeffs[i] = std::pow(-1.0,i)*(i+1);
 
   Functions::Polynomial<dim> poly(exponents, coeffs);
 
index 61ee16f87548529afdc79869f11d6e5d7e6feceb..8119975055fb92aa0d7397479fd4bb3dea6e6413 100644 (file)
 #include <limits>
 #include <typeinfo>
 
+// replace type names found on MAC OS
+std::string cleanup_type(std::string &in)
+{
+  std::string ret = in;
+  ret = Utilities::replace_in_string(ret, "NSt3__17complexIfEE", "St7complexIfE");
+  ret = Utilities::replace_in_string(ret, "NSt3__17complexIdEE", "St7complexIdE");
+  return ret;
+}
+
 
 template <typename number>
 void check (const number &x)
 {
-  deallog << "typeid(x).name() = " << typeid(x).name()
+  deallog << "typeid(x).name() = "
+          << cleanup_type(typeid(x).name())
           << std::endl;
 
   deallog << "typeid(NumberTraits<number>::real_type).name() = "
index 5b3a6d46193eb59324195419caff80d6616d1269..ddbb10827925c071cc01b227608f4ac2bdfffcb8 100644 (file)
@@ -145,8 +145,9 @@ void sort_file_contents (const std::string &filename)
 std::string unify_pretty_function (const std::string &text)
 {
   std::string t=text;
-  t=Utilities::replace_in_string(t, " &", "& ");
+  t=Utilities::replace_in_string(t, " &", " & ");
   t=Utilities::replace_in_string(t, " & ,", "&,");
+  t=Utilities::replace_in_string(t, " & )", "&)");
   t=Utilities::replace_in_string(t, " & ", "& ");
   t=Utilities::replace_in_string(t, "virtual ", "");
   return t;

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.