qpOASES  3.2.1
An Implementation of the Online Active Set Strategy
Defines
include/qpOASES/UnitTesting.hpp File Reference

Go to the source code of this file.

Defines

#define TEST_TOL_FACTOR   1
#define TEST_PASSED   0
#define TEST_FAILED   1
#define TEST_DATA_NOT_FOUND   99
#define QPOASES_TEST_FOR_EQUAL(x, y)   if ( REFER_NAMESPACE_QPOASES isEqual( (x),(y) ) == BT_FALSE ) { return TEST_FAILED; }
#define QPOASES_TEST_FOR_NEAR(x, y)   if ( REFER_NAMESPACE_QPOASES getAbs((x)-(y)) / REFER_NAMESPACE_QPOASES getMax( 1.0,REFER_NAMESPACE_QPOASES getAbs(x) ) >= 1e-10 ) { return TEST_FAILED; }
#define QPOASES_TEST_FOR_TOL(x, tol)   if ( (x) > (tol)*(TEST_TOL_FACTOR) ) { return TEST_FAILED; }
#define QPOASES_TEST_FOR_TRUE(x)   if ( (x) == false ) { return TEST_FAILED; }

Detailed Description

Author:
Hans Joachim Ferreau
Version:
3.2
Date:
2014-2017

Definition of auxiliary functions/macros for unit testing.


Define Documentation

#define QPOASES_TEST_FOR_EQUAL (   x,
 
)    if ( REFER_NAMESPACE_QPOASES isEqual( (x),(y) ) == BT_FALSE ) { return TEST_FAILED; }

Macro verifying that two numerical values are equal in order to pass unit test.

#define QPOASES_TEST_FOR_NEAR (   x,
 
)    if ( REFER_NAMESPACE_QPOASES getAbs((x)-(y)) / REFER_NAMESPACE_QPOASES getMax( 1.0,REFER_NAMESPACE_QPOASES getAbs(x) ) >= 1e-10 ) { return TEST_FAILED; }

Macro verifying that two numerical values are close to each other in order to pass unit test.

#define QPOASES_TEST_FOR_TOL (   x,
  tol 
)    if ( (x) > (tol)*(TEST_TOL_FACTOR) ) { return TEST_FAILED; }

Macro verifying that first quantity is lower or equal than second one in order to pass unit test.

#define QPOASES_TEST_FOR_TRUE (   x)    if ( (x) == false ) { return TEST_FAILED; }

Macro verifying that a logical expression holds in order to pass unit test.

#define TEST_DATA_NOT_FOUND   99

Return value for tests that could not run due to missing external data.

#define TEST_FAILED   1

Return value for tests that failed.

#define TEST_PASSED   0

Return value for tests that passed.