From 240e0f6ceb302215573b9c89b7f780fcaa54eda3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 17 Oct 2005 13:37:21 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@11608 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/Makefile | 1 + tests/bits/oliver_01.cc | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 tests/bits/oliver_01.cc diff --git a/tests/bits/Makefile b/tests/bits/Makefile index 00f612717a..f4a3f99f28 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -70,6 +70,7 @@ tests_x = geometry_info_* \ nedelec_* \ get_fe_from_name \ christian_* \ + oliver_* \ accessor_equality* # tests for the hp branch: diff --git a/tests/bits/oliver_01.cc b/tests/bits/oliver_01.cc new file mode 100644 index 0000000000..b3c7357843 --- /dev/null +++ b/tests/bits/oliver_01.cc @@ -0,0 +1,44 @@ +//---------------------------- oliver_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 by the deal.II authors and Oliver Kayser-Herold +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- oliver_01.cc --------------------------- + + +// Oliver found an example, where sparse_matrix_iterator->value=0 didn't work, +// because the iterator->value expects a double on the right hand side, not an +// integer. If the right hand side is zero, it can also be converted to a +// pointer, which leads to an ambiguity. Fix this by having an additional +// operator= in the iterator/reference class + +#include "../tests.h" +#include +#include +#include + + +int main () +{ + std::ofstream logfile("oliver_01.output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + // this test only needs to compile, not run + if (false) + { + SparseMatrix::iterator *i; + (*i)->value () = (int)0; + } + + deallog << "OK" << std::endl; + + return 0; +} -- 2.39.5