PX4 Firmware
PX4 Autopilot Software http://px4.io
uORBTest_UnitTest.cpp File Reference
#include "uORBTest_UnitTest.hpp"
#include "../uORBCommon.hpp"
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/time.h>
#include <stdio.h>
#include <errno.h>
#include <poll.h>
#include <math.h>
#include <lib/cdev/CDev.hpp>
Include dependency graph for uORBTest_UnitTest.cpp:

Go to the source code of this file.

Macros

#define CHECK_UPDATED(element)
 
#define CHECK_NOT_UPDATED(element)
 
#define CHECK_COPY(i_got, i_correct)
 

Functions

 ORB_DEFINE (orb_test, struct orb_test, sizeof(orb_test), "ORB_TEST:int val;hrt_abstime time;")
 
 ORB_DEFINE (orb_multitest, struct orb_test, sizeof(orb_test), "ORB_MULTITEST:int val;hrt_abstime time;")
 
 ORB_DEFINE (orb_test_medium, struct orb_test_medium, sizeof(orb_test_medium), "ORB_TEST_MEDIUM:int val;hrt_abstime time;char[64] junk;")
 
 ORB_DEFINE (orb_test_medium_multi, struct orb_test_medium, sizeof(orb_test_medium), "ORB_TEST_MEDIUM_MULTI:int val;hrt_abstime time;char[64] junk;")
 
 ORB_DEFINE (orb_test_medium_queue, struct orb_test_medium, sizeof(orb_test_medium), "ORB_TEST_MEDIUM_MULTI:int val;hrt_abstime time;char[64] junk;")
 
 ORB_DEFINE (orb_test_medium_queue_poll, struct orb_test_medium, sizeof(orb_test_medium), "ORB_TEST_MEDIUM_MULTI:int val;hrt_abstime time;char[64] junk;")
 
 ORB_DEFINE (orb_test_large, struct orb_test_large, sizeof(orb_test_large), "ORB_TEST_LARGE:int val;hrt_abstime time;char[512] junk;")
 

Macro Definition Documentation

◆ CHECK_COPY

#define CHECK_COPY (   i_got,
  i_correct 
)
Value:
orb_copy(ORB_ID(orb_test_medium_queue), sfd, &u); \
if (i_got != i_correct) { \
return test_fail("got wrong element from the queue (got %i, should be %i)", i_got, i_correct); \
}
int orb_copy(const struct orb_metadata *meta, int handle, void *buffer)
Definition: uORB.cpp:90
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
Definition: uORB.h:87

Referenced by uORBTest::UnitTest::test_queue().

◆ CHECK_NOT_UPDATED

#define CHECK_NOT_UPDATED (   element)
Value:
orb_check(sfd, &updated); \
if (updated) { \
return test_fail("update flag set, element %i", element); \
}
int orb_check(int handle, bool *updated)
Definition: uORB.cpp:95

Referenced by uORBTest::UnitTest::test_queue().

◆ CHECK_UPDATED

#define CHECK_UPDATED (   element)
Value:
orb_check(sfd, &updated); \
if (!updated) { \
return test_fail("update flag not set, element %i", element); \
}
int orb_check(int handle, bool *updated)
Definition: uORB.cpp:95

Referenced by uORBTest::UnitTest::test_queue().

Function Documentation

◆ ORB_DEFINE() [1/7]

ORB_DEFINE ( orb_test  ,
struct orb_test  ,
sizeof(orb_test ,
"ORB_TEST:int val;hrt_abstime time;"   
)

◆ ORB_DEFINE() [2/7]

ORB_DEFINE ( orb_multitest  ,
struct orb_test  ,
sizeof(orb_test ,
"ORB_MULTITEST:int val;hrt_abstime time;"   
)

◆ ORB_DEFINE() [3/7]

ORB_DEFINE ( orb_test_medium  ,
struct orb_test_medium  ,
sizeof(orb_test_medium ,
"ORB_TEST_MEDIUM:int val;hrt_abstime time;char junk;"  [64] 
)

◆ ORB_DEFINE() [4/7]

ORB_DEFINE ( orb_test_medium_multi  ,
struct orb_test_medium  ,
sizeof(orb_test_medium ,
"ORB_TEST_MEDIUM_MULTI:int val;hrt_abstime time;char junk;"  [64] 
)

◆ ORB_DEFINE() [5/7]

ORB_DEFINE ( orb_test_medium_queue  ,
struct orb_test_medium  ,
sizeof(orb_test_medium ,
"ORB_TEST_MEDIUM_MULTI:int val;hrt_abstime time;char junk;"  [64] 
)

◆ ORB_DEFINE() [6/7]

ORB_DEFINE ( orb_test_medium_queue_poll  ,
struct orb_test_medium  ,
sizeof(orb_test_medium ,
"ORB_TEST_MEDIUM_MULTI:int val;hrt_abstime time;char junk;"  [64] 
)

◆ ORB_DEFINE() [7/7]

ORB_DEFINE ( orb_test_large  ,
struct orb_test_large  ,
sizeof(orb_test_large ,
"ORB_TEST_LARGE:int val;hrt_abstime time;char junk;"  [512] 
)