Fixed coverage issues.

This commit is contained in:
James Goppert
2016-01-12 01:28:48 -06:00
parent a90484362f
commit f1968f51d6
3 changed files with 22 additions and 2 deletions
+2 -1
View File
@@ -6,8 +6,9 @@
namespace matrix namespace matrix
{ {
template<typename Type> template<typename Type>
float wrap_pi(Type x) Type wrap_pi(Type x)
{ {
if (!isfinite(x)) { if (!isfinite(x)) {
return x; return x;
+1
View File
@@ -13,6 +13,7 @@ set(tests
filter filter
integration integration
squareMatrix squareMatrix
helper
) )
add_custom_target(test_build) add_custom_target(test_build)
+18
View File
@@ -0,0 +1,18 @@
#include <assert.h>
#include <stdio.h>
#include <matrix/helper_functions.hpp>
using namespace matrix;
int main()
{
assert(fabs(wrap_pi(4.0) - (4.0 - 2*M_PI)) < 1e-5);
assert(fabs(wrap_pi(-4.0) - (-4.0 + 2*M_PI)) < 1e-5);
assert(fabs(wrap_pi(3.0) - (3.0)) < 1e-3);
wrap_pi(NAN);
return 0;
}
/* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */