Commit Graph

68 Commits

Author SHA1 Message Date
Mara Bos
e9fb17c51a Always use FILE* for standard output.
The threads running commands for clients through the Posix daemon used
to write to a char buffer through snprintf (etc.) which was then written
directly to the file descriptor, whereas in the other case printf
(etc.) was used to write to stdout (FILE*). Both versions used some
macro's and repeated code to have the same output.

This change unifies these two cases by using a FILE* in both cases. The
(line) buffering is done by the standard C library's implementation
(just like with stdout), and px4_log.c now uses the same code in all
cases (using fprintf, etc.) for printing (colored) output.
2018-11-23 12:15:41 +01:00
Beat Küng
5363aff879 fixes for integration and unit tests
Move ros logs dir so that .ulg files are not in the same directory
(mission_test.py:: get_last_log() fails otherwise)
2018-08-08 21:09:39 +02:00
Beat Küng
20f2303e8a test_mixer: fix resource leak (unclosed dp) 2018-06-13 16:19:34 +02:00
Daniel Agar
e468a9bbcc move systemlib/pwm_limit to standalone lib 2018-06-12 09:06:30 +02:00
Beat Küng
f2092dd690 mixer_test: use snprintf instead of strncpy to fix compiler warning
compiler warning:
../../src/systemcmds/tests/test_mixer.cpp: In member function ‘bool MixerTest::loadAllTest()’:
../../src/systemcmds/tests/test_mixer.cpp:202:18: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 1 byte from a string of the same length [-Werror=stringop-truncation]
     (void)strncpy(&buf[strlen(MIXER_ONBOARD_PATH)], "/", 1);
2018-05-09 07:59:46 +02:00
Daniel Agar
d2abd53692 mixer lib remove custom constrain and cleanup includes 2018-04-12 00:14:50 -04:00
Daniel Agar
08cc963de3 px4iofirmware use std NAN instead of undefined 0.0f/0.0f
- closes #9277
2018-04-12 00:14:50 -04:00
Daniel Agar
45eb9cb518 fix typo PX4IO_MAX_MIXER_LENGHT -> PX4IO_MAX_MIXER_LENGTH 2018-04-09 02:23:26 -04:00
Julien Lecoeur
89642a9203 Move src/module/systemlib/mixer to src/lib/mixer 2017-11-15 09:56:10 +01:00
acfloria
3929afd617 Fix format in test_mixer.cpp 2017-10-12 12:03:22 +02:00
acfloria
9d2da611f6 Fix mixer issue with undefined return in callback and non value initialized variables. 2017-10-12 12:03:22 +02:00
Daniel Agar
26f00609ac multirotor_motor_limits only publish for MC 2017-09-19 02:25:30 +01:00
Daniel Agar
a02caff1bc unit_test inline implementation and remove module build 2017-08-23 08:06:55 +02:00
Beat Küng
5a2723ab9c test_mixer.cpp: remove bogus comments 2017-07-21 19:59:45 +02:00
Daniel Agar
0d0cbd8243 clang-tidy ignore cert-flp30-c only in tests 2017-06-02 19:35:18 -04:00
Daniel Agar
5d626bd940 clang-tidy remove redundant init 2017-06-02 19:35:18 -04:00
Daniel Agar
6631e72d6f clang-tidy modernize-redundant-void-arg 2017-02-01 22:15:50 -05:00
Daniel Agar
e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
David Sidrane
93bc8f6467 Combined ifdess and made positive logic
We still allow CONFIG_ARCH_BOARD_SITL in the code base, but
  use positive logic and less #ifdefs
2017-01-21 11:45:36 +01:00
Beat Küng
e7db0ed098 test_mixer & mixer: use memmove instead of memcpy
Both, src & dst use the same array, thus potentially overlapping.
Behavior of memcpy in that case is undefined.
2017-01-18 18:23:42 +01:00
Lorenz Meier
b6e18a1479 Mixer test: More instrumentation to catch repro cases in CI 2017-01-14 20:42:54 +01:00
Lorenz Meier
b9e32d7a34 mixer test: Fix string handling
Some strings were not enforcing NUL termination.
2017-01-14 07:47:03 -08:00
Lorenz Meier
6927fcb5c0 Mixer test: Fix string termination corner case 2017-01-14 07:47:03 -08:00
Andreas Antener
35740b0b59 Mixer test: fix paths for nuttx 2017-01-03 20:32:33 -05:00
Lorenz Meier
3229c4183a Mixer test: Condition strncpy properly 2017-01-03 20:32:33 -05:00
Lorenz Meier
9e95d88574 Use system define for path length buffer 2017-01-03 20:32:33 -05:00
Lorenz Meier
0d5089e3bf Mixer test: Improve portability 2017-01-03 20:32:33 -05:00
Lorenz Meier
5247f17576 Mixer test: use real defines from IO firmware
We use the real defines now and test them against every mixer on the system. This means we should catch transfer errors now before even hitting master.
2017-01-03 20:32:33 -05:00
Lorenz Meier
d0dbddea1b Extend mixer test case with complex mixer 2017-01-03 20:32:33 -05:00
Lorenz Meier
0810bcfe8e Polish mixer test, remove any too verbose output 2017-01-03 20:32:33 -05:00
Lorenz Meier
c27728a7aa Test VTOL test mixers 2017-01-03 20:32:33 -05:00
Lorenz Meier
fb8243d5e1 Mixer test: Fix test, failing right now but showing the real issues 2017-01-03 20:32:33 -05:00
Mark Whitehorn
86252e19e6 clean up other build targets 2016-12-10 12:56:39 +01:00
Bartosz Wawrzacz
619efa7b45 [PX4IO/PWM driver] Added trim values to the PWM output drivers 2016-12-10 12:56:39 +01:00
Lorenz Meier
cf671b5134 Fix tests and re-introduce tests into build
Code style fix
2016-09-27 11:56:49 +02:00
Lorenz Meier
f511d49cc2 Improvements to SITL to make paths more flexible. (#5181) (#5255)
* Path cleanup for SITL.

* Restructured sitl scripts dir.

* Set integration tests to use ekf2 for vtol.

* Fix sitl paths for mac.
2016-08-25 21:47:45 +02:00
Lorenz Meier
7b5917567a Fix Mixer test for OS X 2016-08-07 14:05:03 +02:00
Lorenz Meier
102f5b54d7 Revert "Improvements to SITL to make paths more flexible. (#5181)"
This reverts commit 699b6a2cb3.
2016-08-05 21:29:49 +02:00
James Goppert
699b6a2cb3 Improvements to SITL to make paths more flexible. (#5181) 2016-08-05 06:23:59 -04:00
Lorenz Meier
6ab9dc0acf Testing cleanup from Daniel Agar 2016-07-29 13:49:14 +02:00
Lorenz Meier
20a59b8886 Fix mixer testing setup 2016-04-17 18:53:50 +02:00
Daniel Agar
5843acecc4 fix mixer_test 2016-04-13 22:16:16 -04:00
Daniel Agar
ca4dfb5643 mixer_test change count to 4 2016-03-14 09:15:02 +01:00
Daniel Agar
20ec9965ea mixer_test be less verbose so we can see the failure 2016-03-14 09:15:02 +01:00
Lorenz Meier
a3b1605782 Fix usage of PWM defines in test command 2015-12-16 16:38:41 +00:00
Daniel Agar
2fdbdd15ec format src/systemcmds/tests 2015-09-05 12:21:12 -04:00
Lorenz Meier
2a8402edb1 Merged beta into master 2015-07-09 15:55:31 +02:00
Lorenz Meier
eecddbcab9 Tests: Reset mixer inputs 2015-07-06 12:08:31 +02:00
Lorenz Meier
c9fe205db1 Mixer test: Add routine to test pre-arming 2015-07-06 12:08:31 +02:00
Lorenz Meier
234990fbe4 Merge branch 'release_v1.0.0' of github.com:PX4/Firmware 2015-07-02 01:00:06 +02:00