PX4 Firmware
PX4 Autopilot Software http://px4.io
uORBTest::UnitTest Class Reference

#include <uORBTest_UnitTest.hpp>

Collaboration diagram for uORBTest::UnitTest:

Public Member Functions

 ~UnitTest ()=default
 
int test ()
 
template<typename S >
int latency_test (orb_id_t T, bool print)
 
int info ()
 
 UnitTest (const uORBTest::UnitTest &)=delete
 

Static Public Member Functions

static uORBTest::UnitTestinstance ()
 

Private Member Functions

 UnitTest ()
 
int pubsublatency_main ()
 
int pub_test_multi2_main ()
 
int test_single ()
 
int test_multi ()
 
int test_multi_reversed ()
 
int test_unadvertise ()
 
int test_multi2 ()
 
int test_queue ()
 
int pub_test_queue_main ()
 
int test_queue_poll_notify ()
 
int test_fail (const char *fmt,...)
 
int test_note (const char *fmt,...)
 

Static Private Member Functions

static int pubsubtest_threadEntry (int argc, char *argv[])
 
static int pub_test_multi2_entry (int argc, char *argv[])
 
static int pub_test_queue_entry (int argc, char *argv[])
 

Private Attributes

volatile bool _thread_should_exit
 
bool pubsubtest_passed
 
bool pubsubtest_print
 
int pubsubtest_res = OK
 
orb_advert_t _pfd [4]
 used for test_multi and test_multi_reversed More...
 
volatile int _num_messages_sent = 0
 

Detailed Description

Definition at line 73 of file uORBTest_UnitTest.hpp.

Constructor & Destructor Documentation

◆ ~UnitTest()

uORBTest::UnitTest::~UnitTest ( )
default

◆ UnitTest() [1/2]

uORBTest::UnitTest::UnitTest ( const uORBTest::UnitTest )
delete

◆ UnitTest() [2/2]

uORBTest::UnitTest::UnitTest ( )
inlineprivate

Definition at line 88 of file uORBTest_UnitTest.hpp.

Member Function Documentation

◆ info()

int UnitTest::info ( )

Definition at line 263 of file uORBTest_UnitTest.cpp.

References OK.

◆ instance()

uORBTest::UnitTest & UnitTest::instance ( )
static

Definition at line 59 of file uORBTest_UnitTest.cpp.

Referenced by pub_test_multi2_entry(), pub_test_queue_entry(), pubsubtest_threadEntry(), and uorb_tests_main().

Here is the caller graph for this function:

◆ latency_test()

template<typename S >
int UnitTest::latency_test ( orb_id_t  T,
bool  print 
)

Definition at line 125 of file uORBTest_UnitTest.hpp.

References hrt_absolute_time(), orb_advert_t, orb_advertise(), orb_publish(), orb_unadvertise(), and pubsubtest_threadEntry().

Referenced by uorb_tests_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pub_test_multi2_entry()

int UnitTest::pub_test_multi2_entry ( int  argc,
char *  argv[] 
)
staticprivate

Definition at line 433 of file uORBTest_UnitTest.cpp.

References instance(), and pub_test_multi2_main().

Referenced by test_multi2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pub_test_multi2_main()

int UnitTest::pub_test_multi2_main ( )
private

Definition at line 439 of file uORBTest_UnitTest.cpp.

References _thread_should_exit, hrt_absolute_time(), orb_advert_t, orb_advertise_multi(), ORB_ID, ORB_PRIO_DEFAULT, orb_publish(), orb_unadvertise(), orb_test_medium::time, and orb_test_medium::val.

Referenced by pub_test_multi2_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pub_test_queue_entry()

int UnitTest::pub_test_queue_entry ( int  argc,
char *  argv[] 
)
staticprivate

Definition at line 739 of file uORBTest_UnitTest.cpp.

References instance(), and pub_test_queue_main().

Referenced by test_queue_poll_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pub_test_queue_main()

int UnitTest::pub_test_queue_main ( )
private

Definition at line 745 of file uORBTest_UnitTest.cpp.

References _num_messages_sent, _thread_should_exit, orb_advert_t, orb_advertise_queue(), ORB_ID, orb_publish(), orb_unadvertise(), test_fail(), and orb_test_medium::val.

Referenced by pub_test_queue_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pubsublatency_main()

int UnitTest::pubsublatency_main ( )
private

Definition at line 65 of file uORBTest_UnitTest.cpp.

References f(), hrt_elapsed_time_atomic(), orb_copy(), ORB_ID, orb_subscribe_multi(), orb_unsubscribe(), pubsubtest_passed, pubsubtest_print, pubsubtest_res, px4_poll(), orb_test_large::time, and orb_test_large::val.

Referenced by pubsubtest_threadEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pubsubtest_threadEntry()

int UnitTest::pubsubtest_threadEntry ( int  argc,
char *  argv[] 
)
staticprivate

Definition at line 874 of file uORBTest_UnitTest.cpp.

References instance(), and pubsublatency_main().

Referenced by latency_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test()

int UnitTest::test ( )

Definition at line 189 of file uORBTest_UnitTest.cpp.

References OK, test_multi(), test_multi2(), test_multi_reversed(), test_queue(), test_queue_poll_notify(), test_single(), and test_unadvertise().

Referenced by uorb_tests_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_fail()

int UnitTest::test_fail ( const char *  fmt,
  ... 
)
private

Definition at line 847 of file uORBTest_UnitTest.cpp.

Referenced by pub_test_queue_main(), test_multi(), test_multi2(), test_multi_reversed(), test_queue(), test_queue_poll_notify(), test_single(), and test_unadvertise().

Here is the caller graph for this function:

◆ test_multi()

int UnitTest::test_multi ( )
private

Definition at line 344 of file uORBTest_UnitTest.cpp.

References _pfd, orb_advertise_multi(), orb_copy(), ORB_ID, ORB_PRIO_MAX, ORB_PRIO_MIN, orb_priority(), orb_publish(), orb_subscribe_multi(), orb_unsubscribe(), test_fail(), test_note(), and orb_test::val.

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_multi2()

int UnitTest::test_multi2 ( )
private

Definition at line 490 of file uORBTest_UnitTest.cpp.

References _thread_should_exit, hrt_abstime, orb_check(), orb_copy(), ORB_ID, orb_subscribe_multi(), orb_unsubscribe(), pub_test_multi2_entry(), test_fail(), test_note(), and orb_test_medium::time.

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_multi_reversed()

int UnitTest::test_multi_reversed ( )
private

Definition at line 555 of file uORBTest_UnitTest.cpp.

References _pfd, orb_advertise_multi(), orb_copy(), ORB_ID, ORB_PRIO_MAX, ORB_PRIO_MIN, orb_publish(), orb_subscribe_multi(), test_fail(), test_note(), and orb_test::val.

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_note()

int UnitTest::test_note ( const char *  fmt,
  ... 
)
private

Definition at line 861 of file uORBTest_UnitTest.cpp.

References OK.

Referenced by test_multi(), test_multi2(), test_multi_reversed(), test_queue(), test_queue_poll_notify(), test_single(), and test_unadvertise().

Here is the caller graph for this function:

◆ test_queue()

int UnitTest::test_queue ( )
private

Definition at line 626 of file uORBTest_UnitTest.cpp.

References CHECK_COPY, CHECK_NOT_UPDATED, CHECK_UPDATED, orb_advert_t, orb_advertise_queue(), orb_check(), orb_copy(), ORB_ID, orb_publish(), orb_subscribe(), orb_unadvertise(), test_fail(), test_note(), and orb_test_medium::val.

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_queue_poll_notify()

int UnitTest::test_queue_poll_notify ( )
private

Definition at line 782 of file uORBTest_UnitTest.cpp.

References _num_messages_sent, _thread_should_exit, orb_copy(), ORB_ID, orb_subscribe(), pub_test_queue_entry(), px4_poll(), test_fail(), test_note(), and orb_test_medium::val.

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_single()

int UnitTest::test_single ( )
private

Definition at line 268 of file uORBTest_UnitTest.cpp.

References orb_advert_t, orb_advertise(), orb_check(), orb_copy(), ORB_ID, orb_publish(), orb_subscribe(), orb_unadvertise(), orb_unsubscribe(), test_fail(), test_note(), and orb_test::val.

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_unadvertise()

int UnitTest::test_unadvertise ( )
private

Definition at line 230 of file uORBTest_UnitTest.cpp.

References _pfd, orb_advertise_multi(), ORB_ID, ORB_PRIO_MAX, orb_unadvertise(), test_fail(), and test_note().

Referenced by test().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _num_messages_sent

volatile int uORBTest::UnitTest::_num_messages_sent = 0
private

Definition at line 118 of file uORBTest_UnitTest.hpp.

Referenced by pub_test_queue_main(), and test_queue_poll_notify().

◆ _pfd

orb_advert_t uORBTest::UnitTest::_pfd[4]
private

used for test_multi and test_multi_reversed

Definition at line 102 of file uORBTest_UnitTest.hpp.

Referenced by test_multi(), test_multi_reversed(), and test_unadvertise().

◆ _thread_should_exit

volatile bool uORBTest::UnitTest::_thread_should_exit
private

◆ pubsubtest_passed

bool uORBTest::UnitTest::pubsubtest_passed
private

Definition at line 98 of file uORBTest_UnitTest.hpp.

Referenced by pubsublatency_main().

◆ pubsubtest_print

bool uORBTest::UnitTest::pubsubtest_print
private

Definition at line 99 of file uORBTest_UnitTest.hpp.

Referenced by pubsublatency_main().

◆ pubsubtest_res

int uORBTest::UnitTest::pubsubtest_res = OK
private

Definition at line 100 of file uORBTest_UnitTest.hpp.

Referenced by pubsublatency_main().


The documentation for this class was generated from the following files: