PX4 Firmware
PX4 Autopilot Software http://px4.io
test_mathlib.cpp File Reference

Tests for the PX4 math library. More...

#include <unit_test.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <math.h>
#include <px4_platform_common/px4_config.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <px4_platform_common/log.h>
#include <string.h>
#include <time.h>
#include <mathlib/mathlib.h>
#include <systemlib/err.h>
#include <drivers/drv_hrt.h>
#include <matrix/math.hpp>
#include "tests_main.h"
Include dependency graph for test_mathlib.cpp:

Go to the source code of this file.

Classes

class  MathlibTest
 

Macros

#define TEST_OP(_title, _op)   { unsigned int n = 30000; hrt_abstime t0, t1; t0 = hrt_absolute_time(); for (unsigned int j = 0; j < n; j++) { _op; }; t1 = hrt_absolute_time(); PX4_INFO(_title ": %.6fus", (double)(t1 - t0) / n); }
 

Detailed Description

Tests for the PX4 math library.

Definition in file test_mathlib.cpp.

Macro Definition Documentation

◆ TEST_OP

#define TEST_OP (   _title,
  _op 
)    { unsigned int n = 30000; hrt_abstime t0, t1; t0 = hrt_absolute_time(); for (unsigned int j = 0; j < n; j++) { _op; }; t1 = hrt_absolute_time(); PX4_INFO(_title ": %.6fus", (double)(t1 - t0) / n); }