From edbe145771c9f5d89184b3c0e924137d12f97ba9 Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Thu, 30 May 2013 14:52:08 +0200 Subject: [PATCH] Fixing assertions. --- src/core/tnlAssert.h | 2 +- src/implementation/core/tnlMultiArray2D_impl.h | 2 +- src/implementation/core/tnlMultiArray3D_impl.h | 4 ++-- src/implementation/core/tnlMultiArray4D_impl.h | 4 ++-- src/matrix/tnlMultiDiagonalMatrix.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/tnlAssert.h b/src/core/tnlAssert.h index 7489fccc62..2c0fbaaf61 100644 --- a/src/core/tnlAssert.h +++ b/src/core/tnlAssert.h @@ -7,7 +7,7 @@ #ifndef TNLASSERT_H_ -#ifdef DEBUG +#ifndef NDEBUG #include <iostream> #include <stdlib.h> diff --git a/src/implementation/core/tnlMultiArray2D_impl.h b/src/implementation/core/tnlMultiArray2D_impl.h index b15153e14f..83792229b1 100644 --- a/src/implementation/core/tnlMultiArray2D_impl.h +++ b/src/implementation/core/tnlMultiArray2D_impl.h @@ -50,7 +50,7 @@ template< typename Element, typename Device, typename Index > bool tnlMultiArray< 2, Element, Device, Index > :: setDimensions( const Index jSize, const Index iSize ) { - tnlAssert( xSize > 0 && ySize > 0, + tnlAssert( iSize > 0 && jSize > 0, cerr << "iSize = " << iSize << "jSize = " << jSize ); diff --git a/src/implementation/core/tnlMultiArray3D_impl.h b/src/implementation/core/tnlMultiArray3D_impl.h index a2f84d579e..f26325348f 100644 --- a/src/implementation/core/tnlMultiArray3D_impl.h +++ b/src/implementation/core/tnlMultiArray3D_impl.h @@ -106,8 +106,8 @@ Index tnlMultiArray< 3, Element, Device, Index > :: getElementIndex( const Index const Index i ) const { tnlAssert( i >= 0 && i < this -> dimensions[ 0 ] && - j >= 0 && j < this -> dimensions[ 1 ] &&, - k >= 0 && k < this -> dimensions[ 2 ] + j >= 0 && j < this -> dimensions[ 1 ] && + k >= 0 && k < this -> dimensions[ 2 ], cerr << " i = " << i << " j = " << j << " k = " << k diff --git a/src/implementation/core/tnlMultiArray4D_impl.h b/src/implementation/core/tnlMultiArray4D_impl.h index d1998d4ea7..335853ca9d 100644 --- a/src/implementation/core/tnlMultiArray4D_impl.h +++ b/src/implementation/core/tnlMultiArray4D_impl.h @@ -114,9 +114,9 @@ Index tnlMultiArray< 4, Element, Device, Index > :: getElementIndex( const Index const Index i ) const { tnlAssert( i >= 0 && i < this -> dimensions[ 0 ] && - j >= 0 && j < this -> dimensions[ 1 ] &&, + j >= 0 && j < this -> dimensions[ 1 ] && k >= 0 && k < this -> dimensions[ 2 ] && - l >= 0 && l < this -> dimensions[ 3 ] + l >= 0 && l < this -> dimensions[ 3 ], cerr << " i = " << i << " j = " << j << " k = " << k diff --git a/src/matrix/tnlMultiDiagonalMatrix.h b/src/matrix/tnlMultiDiagonalMatrix.h index b9844b99f9..5b6364a083 100644 --- a/src/matrix/tnlMultiDiagonalMatrix.h +++ b/src/matrix/tnlMultiDiagonalMatrix.h @@ -195,7 +195,7 @@ Index tnlMultiDiagonalMatrix< Real, Device, Index > :: getNonzeroElements() cons template< typename Real, typename Device, typename Index > void tnlMultiDiagonalMatrix< Real, Device, Index > :: setDiagonalsOffsets( const tnlVector< Index, Device, Index >& diagonalsOffsets ) { - tnlAssert( diagonalsOffsets. getSize() == this -> diagonalsOffsest. getSize(), + tnlAssert( diagonalsOffsets. getSize() == this -> diagonalsOffsets. getSize(), cerr << "diagonalsOffsets. getSize() = " << diagonalsOffsets. getSize() << " this -> diagonalsOffsets. getSize() = " << this -> diagonalsOffsets. getSize() << endl; ); this -> diagonalsOffsets = diagonalsOffsets; -- GitLab