Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Fix some unit tests and disable some that are unable to fix.
  • Loading branch information
gongtao0607 committed Oct 25, 2024
1 parent 50d18f5 commit 7e8417e
Show file tree
Hide file tree
Showing 119 changed files with 397 additions and 364 deletions.
2 changes: 1 addition & 1 deletion src/main/blackbox/blackbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "build/build_config.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/build/dprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"

#include "dprintf.h"

Expand Down
2 changes: 1 addition & 1 deletion src/main/cms/cms.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ static void cmsTraverseGlobalExit(const CMS_Menu *pMenu)

const void *cmsMenuExit(displayPort_t *pDisplay, const void *ptr)
{
int exitType = (int)ptr;
int exitType = (intptr_t)ptr;
switch (exitType) {
case CMS_EXIT_SAVE:
case CMS_EXIT_SAVEREBOOT:
Expand Down
2 changes: 0 additions & 2 deletions src/main/common/bitarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include <stdbool.h>
#include <string.h>

#include "platform.h"

#include "bitarray.h"

#define BITARRAY_BIT_OP(array, bit, op) ((array)[(bit) / (sizeof((array)[0]) * 8)] op (1 << ((bit) % (sizeof((array)[0]) * 8))))
Expand Down
2 changes: 2 additions & 0 deletions src/main/common/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include <stdbool.h>

#include "common/utils.h"


#define BUTTER_Q 0.707106781f /* 2nd order Butterworth: 1/sqrt(2) */
#define BESSEL_Q 0.577350269f /* 2nd order Bessel: 1/sqrt(3) */
Expand Down
2 changes: 1 addition & 1 deletion src/main/common/maths.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <stdlib.h>

#include "types.h"
#include "common/types.h"

/*
* Floating point constants
Expand Down
2 changes: 0 additions & 2 deletions src/main/common/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include <stdbool.h>
#include <stdint.h>

#include "platform.h"

#include "pg/time.h"

// time difference, 32 bits always sufficient
Expand Down
2 changes: 1 addition & 1 deletion src/main/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "types.h"
#include "common/types.h"

#define INIT_ZERO { 0, }

Expand Down
1 change: 1 addition & 0 deletions src/main/config/feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#pragma once

#include "common/utils.h"
#include "pg/feature.h"

#ifndef DEFAULT_FEATURES
Expand Down
1 change: 1 addition & 0 deletions src/main/fc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ static void subTaskMotorsServosUpdate(timeUs_t currentTimeUs)

static void subTaskFilterUpdate(timeUs_t currentTimeUs)
{
UNUSED(currentTimeUs);
#ifdef USE_FREQ_SENSOR
freqUpdate();
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/rc_adjustments.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"

#include "fc/rc_modes.h"
#include "flight/pid.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/rc_controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "common/filter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include "pid.h"

static FAST_DATA_ZERO_INIT pid_t pid;
static FAST_DATA_ZERO_INIT pidData_t pid;


float pidGetDT()
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ typedef struct pid_s {

order1Filter_t crossCouplingFilter[XY_AXIS_COUNT];

} pid_t;
} pidData_t;


void pidController(const pidProfile_t *pidProfile, timeUs_t currentTimeUs);
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "config/config_reset.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/accel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "common/sensor_alignment.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/adjustments.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"

#include "pg/pg_ids.h"
#include "pg/adjustments.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/adjustments.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"

#include "pg/pg.h"
#include "pg/modes.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/arming.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg_ids.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/arming.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/barometer.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#ifdef USE_BARO
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/barometer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "drivers/barometer/barometer.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "config/config.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#ifdef USE_BLACKBOX
Expand Down
3 changes: 2 additions & 1 deletion src/main/pg/blackbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

#pragma once

#include "types.h"
#include "common/types.h"

#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/boardalignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg_ids.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/boardalignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/camera_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#ifdef USE_CAMERA_CONTROL
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/camera_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "drivers/io.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/compass.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#if defined(USE_MAG)
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/compass.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "common/time.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/current.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "config/config_reset.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/current.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/esc_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg_ids.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/esc_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/esc_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "config/config_reset.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/esc_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "drivers/io.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/failsafe.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg_ids.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/failsafe.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg_ids.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/governor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/pg/gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this software. If not, see <https://www.gnu.org/licenses/>.
*/

#include "types.h"
#include "common/types.h"
#include "platform.h"

#include "pg/pg_ids.h"
Expand Down
Loading

0 comments on commit 7e8417e

Please sign in to comment.