mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 07:43:33 +08:00
restore px4fmu-v2_test
This commit is contained in:
committed by
Lorenz Meier
parent
848e87ff76
commit
2bc74fd5d9
@@ -43,16 +43,20 @@
|
||||
#include "systemlib/param/param.h"
|
||||
#include "tests.h"
|
||||
|
||||
#define PARAM_MAGIC1 0x12345678
|
||||
#define PARAM_MAGIC1 12345678
|
||||
#define PARAM_MAGIC2 0xa5a5a5a5
|
||||
PARAM_DEFINE_INT32(test, PARAM_MAGIC1);
|
||||
|
||||
/**
|
||||
* @group Testing
|
||||
*/
|
||||
PARAM_DEFINE_INT32(TEST_PARAMS, 12345678);
|
||||
|
||||
int
|
||||
test_param(int argc, char *argv[])
|
||||
{
|
||||
param_t p;
|
||||
|
||||
p = param_find("test");
|
||||
p = param_find("TEST_PARAMS");
|
||||
|
||||
if (p == PARAM_INVALID) {
|
||||
warnx("test parameter not found");
|
||||
@@ -71,7 +75,7 @@ test_param(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t val;
|
||||
int32_t val = -1;
|
||||
|
||||
if (param_get(p, &val) != OK) {
|
||||
warnx("failed to read test parameter");
|
||||
|
||||
@@ -166,15 +166,20 @@ test_all(int argc, char *argv[])
|
||||
passed[i] = true;
|
||||
}
|
||||
|
||||
for (int j = 0; j < 40; j++) {
|
||||
printf("-");
|
||||
}
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
testcount++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print summary */
|
||||
printf("\n");
|
||||
int j;
|
||||
|
||||
for (j = 0; j < 40; j++) {
|
||||
for (int j = 0; j < 40; j++) {
|
||||
printf("-");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user