From cc6532ef1b395f5eb67f55a9678e79fe14c89c16 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 17 Jul 2015 07:04:46 -0500 Subject: [PATCH] Make test work on clang. 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 | 17 +++++++++++++---- tests/algorithms/any_data_01.output | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/algorithms/any_data_01.cc b/tests/algorithms/any_data_01.cc index fd0c47fae9..88200b64e4 100644 --- a/tests/algorithms/any_data_01.cc +++ b/tests/algorithms/any_data_01.cc @@ -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(" d 17.") << std::endl - << data.try_read(" d 17.") << std::endl - << data.try_read("does not exist") << std::endl; + deallog << *data.try_read(" d 17.") << std::endl; + + if (data.try_read(" d 17.") == 0) + deallog << "(nil)" << std::endl; + else + AssertThrow (false, ExcInternalError()); + + if (data.try_read("does not exist") == 0) + deallog << "(nil)" << std::endl; + else + AssertThrow (false, ExcInternalError()); + // try // { // double* p3a = data.entry("cd* 17."); diff --git a/tests/algorithms/any_data_01.output b/tests/algorithms/any_data_01.output index 9e180107c2..a0c2345350 100644 --- a/tests/algorithms/any_data_01.output +++ b/tests/algorithms/any_data_01.output @@ -13,5 +13,5 @@ DEAL::17.0000 DEAL::18.0000 DEAL::18.0000 DEAL::17.0000 -DEAL::0 -DEAL::0 +DEAL::(nil) +DEAL::(nil) -- 2.39.5