From a334cecfa7aec158331d294042be770851d19cd3 Mon Sep 17 00:00:00 2001 From: jgoppert Date: Thu, 12 Nov 2015 10:07:09 -0500 Subject: [PATCH] Forced function instantiation for coverage testing. --- matrix/filter.hpp | 3 ++- test/filter.cpp | 10 +++++++++- test/integration.cpp | 8 ++++++++ test/vector2.cpp | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/matrix/filter.hpp b/matrix/filter.hpp index 53fc99d92a..d075fc0f01 100644 --- a/matrix/filter.hpp +++ b/matrix/filter.hpp @@ -5,7 +5,7 @@ namespace matrix { template -void kalman_correct( +int kalman_correct( const SquareMatrix & P, const Matrix & C, const SquareMatrix & R, @@ -20,6 +20,7 @@ void kalman_correct( dx = K*r; beta = Scalar(r.T()*S_I*r); dP = K*C*P*(-1); + return 0; } }; // namespace matrix diff --git a/test/filter.cpp b/test/filter.cpp index b3b137cdcd..3470e5f4d4 100644 --- a/test/filter.cpp +++ b/test/filter.cpp @@ -5,7 +5,15 @@ using namespace matrix; -template class Vector; +template int kalman_correct( + const SquareMatrix & P, + const Matrix & C, + const SquareMatrix & R, + const Vector &r, + Vector & dx, + SquareMatrix & dP, + float & beta +); int main() { diff --git a/test/integration.cpp b/test/integration.cpp index e8b3889420..c1dea3b81d 100644 --- a/test/integration.cpp +++ b/test/integration.cpp @@ -5,6 +5,14 @@ using namespace matrix; +// instantiate template to ensure coverage check +template int integrate_rk4( + Vector (*f)(float, Vector), + Vector & y, + float & t, + float h +); + Vector f(float t, Vector y); Vector f(float t, Vector y) { diff --git a/test/vector2.cpp b/test/vector2.cpp index e1d122fbde..d9c63ed71f 100644 --- a/test/vector2.cpp +++ b/test/vector2.cpp @@ -5,7 +5,7 @@ using namespace matrix; -template class Vector; +template class Vector; int main() {