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

Go to the source code of this file.

Macros

#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)
 
#define QPOASES_TEST_FOR_NEAR(x, y)
 
#define QPOASES_TEST_FOR_TOL(x, tol)
 
#define QPOASES_TEST_FOR_TRUE(x)
 

Detailed Description

Author
Hans Joachim Ferreau
Version
3.2
Date
2014-2017

Definition of auxiliary functions/macros for unit testing.

Macro Definition Documentation

◆ QPOASES_TEST_FOR_EQUAL

#define QPOASES_TEST_FOR_EQUAL ( x,
y )
Value:
if ( REFER_NAMESPACE_QPOASES isEqual( (x),(y) ) == BT_FALSE ) { return TEST_FAILED; }
@ BT_FALSE
Definition Types.hpp:205
#define REFER_NAMESPACE_QPOASES
Definition Types.hpp:116
#define TEST_FAILED
Definition UnitTesting.hpp:48
BooleanType isEqual(real_t x, real_t y, real_t TOL=ZERO)
Definition Utils.ipp:45

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

◆ QPOASES_TEST_FOR_NEAR

#define QPOASES_TEST_FOR_NEAR ( x,
y )
Value:
int_t getMax(int_t x, int_t y)
Definition Utils.ipp:88
real_t getAbs(real_t x)
Definition Utils.ipp:143

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

◆ QPOASES_TEST_FOR_TOL

#define QPOASES_TEST_FOR_TOL ( x,
tol )
Value:
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.

◆ QPOASES_TEST_FOR_TRUE

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

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

◆ TEST_DATA_NOT_FOUND

#define TEST_DATA_NOT_FOUND   99

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

◆ TEST_FAILED

#define TEST_FAILED   1

Return value for tests that failed.

◆ TEST_PASSED

#define TEST_PASSED   0

Return value for tests that passed.