From b1476d59c70fd7c2889630228f8e001fd8eb4450 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 9 Feb 2004 14:37:57 +0000 Subject: [PATCH] New test. Presently fails on mainline, but will be fixed on the PETSc branch. git-svn-id: https://svn.dealii.org/trunk@8433 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/vector_equality_1.cc | 80 ++++++++++++++++++++++++++++++++ tests/bits/vector_equality_2.cc | 82 +++++++++++++++++++++++++++++++++ tests/bits/vector_equality_3.cc | 80 ++++++++++++++++++++++++++++++++ tests/bits/vector_equality_4.cc | 82 +++++++++++++++++++++++++++++++++ 4 files changed, 324 insertions(+) create mode 100644 tests/bits/vector_equality_1.cc create mode 100644 tests/bits/vector_equality_2.cc create mode 100644 tests/bits/vector_equality_3.cc create mode 100644 tests/bits/vector_equality_4.cc diff --git a/tests/bits/vector_equality_1.cc b/tests/bits/vector_equality_1.cc new file mode 100644 index 0000000000..d2bd7d9ca6 --- /dev/null +++ b/tests/bits/vector_equality_1.cc @@ -0,0 +1,80 @@ +//---------------------------- vector_equality_1.cc --------------------------- +// petsc_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- vector_equality_1.cc --------------------------- + + +// check Vector::operator==(Vector) for vectors that are not +// equal + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/vector_equality_2.cc b/tests/bits/vector_equality_2.cc new file mode 100644 index 0000000000..46a3d4ccd9 --- /dev/null +++ b/tests/bits/vector_equality_2.cc @@ -0,0 +1,82 @@ +//---------------------------- vector_equality_2.cc --------------------------- +// petsc_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- vector_equality_2.cc --------------------------- + + +// check Vector::operator==(Vector) for vectors that are +// equal + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/vector_equality_3.cc b/tests/bits/vector_equality_3.cc new file mode 100644 index 0000000000..54593a2fba --- /dev/null +++ b/tests/bits/vector_equality_3.cc @@ -0,0 +1,80 @@ +//---------------------------- vector_equality_3.cc --------------------------- +// petsc_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- vector_equality_3.cc --------------------------- + + +// check Vector::operator!=(Vector) for vectors that are not +// equal + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/vector_equality_4.cc b/tests/bits/vector_equality_4.cc new file mode 100644 index 0000000000..741ea0f2de --- /dev/null +++ b/tests/bits/vector_equality_4.cc @@ -0,0 +1,82 @@ +//---------------------------- vector_equality_4.cc --------------------------- +// petsc_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- vector_equality_4.cc --------------------------- + + +// check Vector::operator!=(Vector) for vectors that are +// equal + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} -- 2.39.5