Skip to content
Snippets Groups Projects
Commit 554aa9b3 authored by Gael Guennebaud's avatar Gael Guennebaud
Browse files

Add failtests for Ref<SparseMatrix>

parent 3af29caa
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,12 @@ ei_add_failtest("ref_5") ...@@ -41,6 +41,12 @@ ei_add_failtest("ref_5")
ei_add_failtest("swap_1") ei_add_failtest("swap_1")
ei_add_failtest("swap_2") ei_add_failtest("swap_2")
ei_add_failtest("sparse_ref_1")
ei_add_failtest("sparse_ref_2")
ei_add_failtest("sparse_ref_3")
ei_add_failtest("sparse_ref_4")
ei_add_failtest("sparse_ref_5")
if (EIGEN_FAILTEST_FAILURE_COUNT) if (EIGEN_FAILTEST_FAILURE_COUNT)
message(FATAL_ERROR message(FATAL_ERROR
"${EIGEN_FAILTEST_FAILURE_COUNT} out of ${EIGEN_FAILTEST_COUNT} failtests FAILED. " "${EIGEN_FAILTEST_FAILURE_COUNT} out of ${EIGEN_FAILTEST_COUNT} failtests FAILED. "
......
#include "../Eigen/Sparse"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define CV_QUALIFIER const
#else
#define CV_QUALIFIER
#endif
using namespace Eigen;
void call_ref(Ref<SparseMatrix<float> > a) { }
int main()
{
SparseMatrix<float> a(10,10);
CV_QUALIFIER SparseMatrix<float>& ac(a);
call_ref(ac);
}
#include "../Eigen/Sparse"
using namespace Eigen;
void call_ref(Ref<SparseMatrix<float> > a) { }
int main()
{
SparseMatrix<float> A(10,10);
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
call_ref(A.row(3));
#else
call_ref(A.col(3));
#endif
}
#include "../Eigen/Sparse"
using namespace Eigen;
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
void call_ref(Ref<SparseMatrix<float> > a) { }
#else
void call_ref(const Ref<const SparseMatrix<float> > &a) { }
#endif
int main()
{
SparseMatrix<float> a(10,10);
call_ref(a+a);
}
#include "../Eigen/Sparse"
using namespace Eigen;
void call_ref(Ref<SparseMatrix<float> > a) {}
int main()
{
SparseMatrix<float> A(10,10);
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
call_ref(A.transpose());
#else
call_ref(A);
#endif
}
#include "../Eigen/Sparse"
using namespace Eigen;
void call_ref(Ref<SparseMatrix<float> > a) { }
int main()
{
SparseMatrix<float> a(10,10);
SparseMatrixBase<SparseMatrix<float> > &ac(a);
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
call_ref(ac);
#else
call_ref(ac.derived());
#endif
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment