mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Unit test tidy
This commit is contained in:
parent
e78a225ed3
commit
2a18401d21
3 changed files with 194 additions and 124 deletions
22
src/test/unit/parameter_group.ld
Normal file
22
src/test/unit/parameter_group.ld
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
SECTIONS {
|
||||
/* BLOCK: on Windows (PE) output section must be page-aligned. Use 4-byte alignment otherwise */
|
||||
/* SUBALIGN: force 4-byte alignment of input sections for pg_registry.
|
||||
Gcc defaults to 32 bytes; padding is then inserted between object files, breaking the init structure. */
|
||||
.pg_registry BLOCK( DEFINED(__section_alignment__) ? __section_alignment__ : 4 ) : SUBALIGN(4)
|
||||
{
|
||||
PROVIDE_HIDDEN (__pg_registry_start = . );
|
||||
PROVIDE_HIDDEN (___pg_registry_start = . );
|
||||
KEEP (*(.pg_registry))
|
||||
KEEP (*(SORT(.pg_registry.*)))
|
||||
PROVIDE_HIDDEN (__pg_registry_end = . );
|
||||
PROVIDE_HIDDEN (___pg_registry_end = . );
|
||||
|
||||
PROVIDE_HIDDEN (__pg_resetdata_start = . );
|
||||
PROVIDE_HIDDEN (___pg_resetdata_start = . );
|
||||
KEEP (*(.pg_resetdata))
|
||||
PROVIDE_HIDDEN (__pg_resetdata_end = . );
|
||||
PROVIDE_HIDDEN (___pg_resetdata_end = . );
|
||||
}
|
||||
}
|
||||
INSERT AFTER .text;
|
|
@ -31,8 +31,6 @@ extern "C" {
|
|||
|
||||
#include "io/motors.h"
|
||||
|
||||
}
|
||||
|
||||
PG_DECLARE(motorConfig_t, motorConfig);
|
||||
|
||||
PG_REGISTER_WITH_RESET_TEMPLATE(motorConfig_t, motorConfig, PG_MOTOR_CONFIG, 1);
|
||||
|
@ -43,6 +41,8 @@ PG_RESET_TEMPLATE(motorConfig_t, motorConfig,
|
|||
.mincommand = 1000,
|
||||
.motorPwmRate = 400,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#include "unittest_macros.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
@ -88,6 +88,5 @@ TEST(ParameterGroupsfTest, Test_pgFind)
|
|||
// STUBS
|
||||
|
||||
extern "C" {
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue