]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make test work on clang. 1150/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 17 Jul 2015 12:04:46 +0000 (07:04 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 17 Jul 2015 12:04:46 +0000 (07:04 -0500)
clang outputs '(nil)' when printing a null pointer, rather than '0'. This is not a bad
idea I suppose, but it is incompatible with other compilers. Change the test to just always
do it.

tests/algorithms/any_data_01.cc
tests/algorithms/any_data_01.output

index fd0c47fae985365c615cddca9d8fbdfb00778b65..88200b64e4a02fa05b7badcd6144d0a9416a871e 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -62,9 +62,18 @@ void extract(const AnyData& data)
          << *p2 << std::endl
          << *p3 << std::endl;
 
-  deallog << *data.try_read<double>(" d  17.") << std::endl
-         << data.try_read<char *>(" d  17.") << std::endl
-         << data.try_read<double>("does not exist") << std::endl;
+  deallog << *data.try_read<double>(" d  17.") << std::endl;
+
+  if (data.try_read<char *>(" d  17.") == 0)
+    deallog << "(nil)" << std::endl;
+  else
+    AssertThrow (false, ExcInternalError());
+
+  if (data.try_read<double>("does not exist") == 0)
+    deallog << "(nil)" << std::endl;
+  else
+    AssertThrow (false, ExcInternalError());
+  
 // try
   //   {
   //     double* p3a = data.entry<double*>("cd* 17.");
index 9e180107c237b74638ce9d9d28ddf6f5b55106c8..a0c234535075ea0f0fa7d1e0c7db31454e3b018c 100644 (file)
@@ -13,5 +13,5 @@ DEAL::17.0000
 DEAL::18.0000
 DEAL::18.0000
 DEAL::17.0000
-DEAL::0
-DEAL::0
+DEAL::(nil)
+DEAL::(nil)

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.