From: David Wells Date: Sun, 14 Aug 2016 22:56:24 +0000 (-0400) Subject: Add some missing error code asserts. X-Git-Tag: v8.5.0-rc1~769^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d8f40404763bf787b43628e53938828f7b67404;p=dealii.git Add some missing error code asserts. These were caught by cppcheck. --- diff --git a/source/base/mpi.cc b/source/base/mpi.cc index e78b50806f..5d7b098277 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -247,6 +247,7 @@ namespace Utilities AssertThrow(ierr == MPI_SUCCESS, ExcInternalError()); ierr = MPI_Type_commit(&type); + AssertThrow(ierr == MPI_SUCCESS, ExcInternalError()); ierr = MPI_Allreduce (&in, &result, 1, type, op, mpi_communicator); AssertThrow(ierr == MPI_SUCCESS, ExcInternalError()); diff --git a/source/lac/petsc_matrix_free.cc b/source/lac/petsc_matrix_free.cc index 40e4034839..3a3e35d68f 100644 --- a/source/lac/petsc_matrix_free.cc +++ b/source/lac/petsc_matrix_free.cc @@ -192,6 +192,7 @@ namespace PETScWrappers // dealii::PETScWrappers::*::Vector: const char *vec_type; int ierr = VecGetType (src, &vec_type); + AssertThrow (ierr == 0, ExcPETScError(ierr)); PetscInt local_size; ierr = VecGetLocalSize (src, &local_size); diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index 6e1892c4d4..0f146f59c1 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -322,6 +322,7 @@ namespace PETScWrappers PetscInt begin, end; ierr = VecGetOwnershipRange (vector, &begin, &end); + AssertThrow (ierr == 0, ExcPETScError(ierr)); Assert(local_size==(size_type)(end-begin), ExcInternalError());