aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-01-22 00:09:34 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-01-22 00:09:34 +0000
commit9e3c73110af86ccedbb2ba46d6c11e1a2c71c32e (patch)
treea4b0fcdb38fbd166d0905f70092ffc8a9d1742d9 /test
parent4225b7bf5788755246b94073ef194fe130f1f1e2 (diff)
fix a bunch of warnings (actual issues) reported by Frank
Diffstat (limited to 'test')
-rw-r--r--test/lu.cpp3
-rw-r--r--test/meta.cpp2
-rw-r--r--test/nomalloc.cpp2
-rw-r--r--test/sum.cpp2
4 files changed, 5 insertions, 4 deletions
diff --git a/test/lu.cpp b/test/lu.cpp
index fdc10e246..6147419fd 100644
--- a/test/lu.cpp
+++ b/test/lu.cpp
@@ -28,9 +28,10 @@
template<typename Derived>
void doSomeRankPreservingOperations(Eigen::MatrixBase<Derived>& m)
{
+ typedef typename Derived::RealScalar RealScalar;
for(int a = 0; a < 3*(m.rows()+m.cols()); a++)
{
- double d = Eigen::ei_random<double>(-1,1);
+ RealScalar d = Eigen::ei_random<RealScalar>(-1,1);
int i = Eigen::ei_random<int>(0,m.rows()-1); // i is a random row number
int j;
do {
diff --git a/test/meta.cpp b/test/meta.cpp
index 864d806e8..e77e46ba4 100644
--- a/test/meta.cpp
+++ b/test/meta.cpp
@@ -45,9 +45,7 @@ void test_meta()
VERIFY(( ei_is_same_type<float*,ei_unconst<const float*>::type >::ret));
VERIFY(( ei_is_same_type<float&,ei_unconst<const float&>::type >::ret));
- VERIFY(( ei_is_same_type<float&,ei_unconst<const FloatRef>::type >::ret));
VERIFY(( ei_is_same_type<float&,ei_unconst<ConstFloatRef>::type >::ret));
- VERIFY(( ei_is_same_type<float&,ei_unconst<const ConstFloatRef>::type >::ret));
VERIFY(( ei_is_same_type<float&,ei_unconst<float&>::type >::ret));
VERIFY(( ei_is_same_type<float,ei_unref<float&>::type >::ret));
diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp
index 82119e9b3..5497ca339 100644
--- a/test/nomalloc.cpp
+++ b/test/nomalloc.cpp
@@ -24,7 +24,9 @@
// Eigen. If not, see <http://www.gnu.org/licenses/>.
// this hack is needed to make this file compiles with -pedantic (gcc)
+#ifdef __GNUC__
#define throw(X)
+#endif
// discard stack allocation as that too bypasses malloc
#define EIGEN_STACK_ALLOCATION_LIMIT 0
// any heap allocation will raise an assert
diff --git a/test/sum.cpp b/test/sum.cpp
index c13651853..fe707e9b2 100644
--- a/test/sum.cpp
+++ b/test/sum.cpp
@@ -34,7 +34,7 @@ template<typename MatrixType> void matrixSum(const MatrixType& m)
MatrixType m1 = MatrixType::Random(rows, cols);
VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows, cols).sum(), Scalar(1));
- VERIFY_IS_APPROX(MatrixType::Ones(rows, cols).sum(), Scalar(rows*cols));
+ VERIFY_IS_APPROX(MatrixType::Ones(rows, cols).sum(), Scalar(float(rows*cols))); // the float() here to shut up excessive MSVC warning about int->complex conversion being lossy
Scalar x = Scalar(0);
for(int i = 0; i < rows; i++) for(int j = 0; j < cols; j++) x += m1(i,j);
VERIFY_IS_APPROX(m1.sum(), x);