aboutsummaryrefslogtreecommitdiffhomepage
path: root/failtest
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2011-02-06 01:44:51 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2011-02-06 01:44:51 -0500
commit9ce08b352fffb75769c91fa5e6eb619221ff2453 (patch)
tree4a316c82c67a4d67b13ed049c84bf3045a3e873d /failtest
parent9b13e9aeceffd56fb1560a8aef51079ae65f13c4 (diff)
add more failtests
Diffstat (limited to 'failtest')
-rw-r--r--failtest/CMakeLists.txt12
-rw-r--r--failtest/const_qualified_block_method_retval_0.cpp15
-rw-r--r--failtest/const_qualified_block_method_retval_1.cpp15
-rw-r--r--failtest/const_qualified_diagonal_method_retval.cpp15
-rw-r--r--failtest/const_qualified_transpose_method_retval.cpp15
-rw-r--r--failtest/map_nonconst_ctor_on_const_ptr_0.cpp15
-rw-r--r--failtest/map_nonconst_ctor_on_const_ptr_1.cpp15
-rw-r--r--failtest/map_nonconst_ctor_on_const_ptr_2.cpp15
-rw-r--r--failtest/map_nonconst_ctor_on_const_ptr_3.cpp15
9 files changed, 132 insertions, 0 deletions
diff --git a/failtest/CMakeLists.txt b/failtest/CMakeLists.txt
index 424ce1795..b6e26d5a8 100644
--- a/failtest/CMakeLists.txt
+++ b/failtest/CMakeLists.txt
@@ -1,12 +1,24 @@
message(STATUS "Running the failtests")
ei_add_failtest("failtest_sanity_check")
+
ei_add_failtest("block_nonconst_ctor_on_const_xpr_0")
ei_add_failtest("block_nonconst_ctor_on_const_xpr_1")
ei_add_failtest("block_nonconst_ctor_on_const_xpr_2")
ei_add_failtest("transpose_nonconst_ctor_on_const_xpr")
ei_add_failtest("diagonal_nonconst_ctor_on_const_xpr")
+ei_add_failtest("const_qualified_block_method_retval_0")
+ei_add_failtest("const_qualified_block_method_retval_1")
+ei_add_failtest("const_qualified_transpose_method_retval")
+ei_add_failtest("const_qualified_diagonal_method_retval")
+
+ei_add_failtest("map_nonconst_ctor_on_const_ptr_0")
+ei_add_failtest("map_nonconst_ctor_on_const_ptr_1")
+ei_add_failtest("map_nonconst_ctor_on_const_ptr_2")
+ei_add_failtest("map_nonconst_ctor_on_const_ptr_3")
+
+
if (EIGEN_FAILTEST_FAILURE_COUNT)
message(FATAL_ERROR "${EIGEN_FAILTEST_FAILURE_COUNT} out of ${EIGEN_FAILTEST_COUNT} failtests FAILED. "
"Failtests succeed when they generate build errors. "
diff --git a/failtest/const_qualified_block_method_retval_0.cpp b/failtest/const_qualified_block_method_retval_0.cpp
new file mode 100644
index 000000000..a6bd5fee2
--- /dev/null
+++ b/failtest/const_qualified_block_method_retval_0.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ Block<Matrix3d,3,3> b(m.block<3,3>(0,0));
+}
+
+int main() {}
diff --git a/failtest/const_qualified_block_method_retval_1.cpp b/failtest/const_qualified_block_method_retval_1.cpp
new file mode 100644
index 000000000..ef40c247c
--- /dev/null
+++ b/failtest/const_qualified_block_method_retval_1.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ Block<Matrix3d> b(m.block(0,0,3,3));
+}
+
+int main() {}
diff --git a/failtest/const_qualified_diagonal_method_retval.cpp b/failtest/const_qualified_diagonal_method_retval.cpp
new file mode 100644
index 000000000..809594aab
--- /dev/null
+++ b/failtest/const_qualified_diagonal_method_retval.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ Diagonal<Matrix3d> b(m.diagonal());
+}
+
+int main() {}
diff --git a/failtest/const_qualified_transpose_method_retval.cpp b/failtest/const_qualified_transpose_method_retval.cpp
new file mode 100644
index 000000000..2d7f19cab
--- /dev/null
+++ b/failtest/const_qualified_transpose_method_retval.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ Transpose<Matrix3d> b(m.transpose());
+}
+
+int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_0.cpp b/failtest/map_nonconst_ctor_on_const_ptr_0.cpp
new file mode 100644
index 000000000..d75686f58
--- /dev/null
+++ b/failtest/map_nonconst_ctor_on_const_ptr_0.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER float *ptr){
+ Map<Matrix3f> m(ptr);
+}
+
+int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_1.cpp b/failtest/map_nonconst_ctor_on_const_ptr_1.cpp
new file mode 100644
index 000000000..eda134dc8
--- /dev/null
+++ b/failtest/map_nonconst_ctor_on_const_ptr_1.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER float *ptr, DenseIndex size){
+ Map<ArrayXf> m(ptr, size);
+}
+
+int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_2.cpp b/failtest/map_nonconst_ctor_on_const_ptr_2.cpp
new file mode 100644
index 000000000..06b4b6275
--- /dev/null
+++ b/failtest/map_nonconst_ctor_on_const_ptr_2.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols){
+ Map<MatrixXf> m(ptr, rows, cols);
+}
+
+int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_3.cpp b/failtest/map_nonconst_ctor_on_const_ptr_3.cpp
new file mode 100644
index 000000000..830f6f0c9
--- /dev/null
+++ b/failtest/map_nonconst_ctor_on_const_ptr_3.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols){
+ Map<MatrixXf, Aligned, InnerStride<2> > m(ptr, rows, cols, InnerStride<2>());
+}
+
+int main() {}