aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-08-19 11:06:40 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-08-19 11:06:40 +0000
commita6d387a359354c8f75f9a0dfe623600e6a303c8c (patch)
tree1244e7a577402f86233b5d2e72e50562a3eb3c13 /test
parent9466e5f94edbff1219cd48639fd0ef80e11b85a9 (diff)
Various compilation fixes for MSVC 9. All tests compile but some
still fail at runtime in ei_aligned_free() (even without vectorization).
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt14
-rw-r--r--test/adjoint.cpp1
2 files changed, 8 insertions, 7 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 407893e3e..b853e65e1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,5 +1,6 @@
IF(BUILD_TESTS)
+
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_SYSTEM_NAME MATCHES Linux)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g2")
@@ -7,6 +8,9 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-inline-functions")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g2")
ENDIF(CMAKE_SYSTEM_NAME MATCHES Linux)
+ SET(EI_OFLAG "-O2")
+ELSE(CMAKE_COMPILER_IS_GNUCXX)
+ SET(EI_OFLAG "")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
OPTION(EIGEN_NO_ASSERTION_CHECKING "Disable checking of assertions" OFF)
@@ -38,11 +42,7 @@ MACRO(EI_ADD_TEST testname)
SET(targetname test_${testname})
-# IF(${ARGC} EQUAL 2)
-# SET(filename ${ARGV1})
-# ELSE(${ARGC} EQUAL 2)
- SET(filename ${testname}.cpp)
-# ENDIF(${ARGC} EQUAL 2)
+ SET(filename ${testname}.cpp)
ADD_EXECUTABLE(${targetname} ${filename})
IF(NOT EIGEN_NO_ASSERTION_CHECKING)
@@ -90,7 +90,7 @@ EI_ADD_TEST(basicstuff)
EI_ADD_TEST(linearstructure)
EI_ADD_TEST(cwiseop)
EI_ADD_TEST(product_small)
-EI_ADD_TEST(product_large "-O2")
+EI_ADD_TEST(product_large ${EI_OFLAG})
EI_ADD_TEST(adjoint)
EI_ADD_TEST(submatrices)
EI_ADD_TEST(miscmatrices)
@@ -99,7 +99,7 @@ EI_ADD_TEST(map)
EI_ADD_TEST(array)
EI_ADD_TEST(triangular)
EI_ADD_TEST(cholesky)
-EI_ADD_TEST(lu "-O2")
+EI_ADD_TEST(lu ${EI_OFLAG})
EI_ADD_TEST(determinant)
EI_ADD_TEST(inverse)
EI_ADD_TEST(qr)
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index 3b779f14e..50ebb70dc 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -72,6 +72,7 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
VERIFY_IS_MUCH_SMALLER_THAN(vzero.norm(), static_cast<RealScalar>(1));
// check compatibility of dot and adjoint
+ // FIXME this line failed with MSVC and complex<double> in the ei_aligned_free()
VERIFY_IS_APPROX(v1.dot(square * v2), (square.adjoint() * v1).dot(v2));
// like in testBasicStuff, test operator() to check const-qualification