From f053d21174d221d66c50b74a1cfe7194e7a97d00 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 13 Jun 2011 17:52:28 +0000 Subject: [PATCH] Compare pointers for equality by the object pointed to. git-svn-id: https://svn.dealii.org/trunk@23809 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/serialization/serialization.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/serialization/serialization.h b/tests/serialization/serialization.h index 89b2682bb0..fd4ac60754 100644 --- a/tests/serialization/serialization.h +++ b/tests/serialization/serialization.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2010 by the deal.II authors +// Copyright (C) 2010, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -22,6 +22,23 @@ #include +// compare objects for equality and pointers for equality of the object +// pointed to +template +bool compare (T t1, + T t2) +{ + return t1 == t2; +} + +template +bool compare (T *t1, + T *t2) +{ + return *t1 == *t2; +} + + template void verify (const T &t1, T &t2) @@ -45,7 +62,7 @@ void verify (const T &t1, ia >> t2; - Assert (t1 == t2, ExcInternalError()); + Assert (compare (t1, t2), ExcInternalError()); } } -- 2.39.5