Skip to content

Commit

Permalink
firmware: tests: devices: Update Payload X tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-porto committed Aug 17, 2024
1 parent 1c056d3 commit bb5fe26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion firmware/tests/devices/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ANTENNA_TEST_FLAGS=$(FLAGS),--wrap=isis_antenna_init,--wrap=isis_antenna_arm,--w

MEDIA_TEST_FLAGS=$(FLAGS),--wrap=flash_init,--wrap=flash_write,--wrap=flash_write_single,--wrap=flash_read_single,--wrap=flash_write_long,--wrap=flash_read_long,--wrap=flash_erase,--wrap=mt25q_init,--wrap=mt25q_reset,--wrap=mt25q_read_device_id,--wrap=mt25q_read_flash_description,--wrap=mt25q_clear_flag_status_register,--wrap=mt25q_read_status,--wrap=mt25q_enter_deep_power_down,--wrap=mt25q_release_from_deep_power_down,--wrap=mt25q_write_enable,--wrap=mt25q_write_disable,--wrap=mt25q_is_busy,--wrap=mt25q_die_erase,--wrap=mt25q_sector_erase,--wrap=mt25q_sub_sector_erase,--wrap=mt25q_write,--wrap=mt25q_read,--wrap=mt25q_get_max_address,--wrap=mt25q_enter_4_byte_address_mode,--wrap=mt25q_read_flag_status_register,--wrap=mt25q_get_flash_description,--wrap=mt25q_spi_init,--wrap=mt25q_spi_write,--wrap=mt25q_spi_read,--wrap=mt25q_spi_transfer,--wrap=mt25q_spi_select,--wrap=mt25q_spi_unselect,--wrap=mt25q_spi_write_only,--wrap=mt25q_spi_read_only,--wrap=mt25q_spi_transfer_only,--wrap=mt25q_gpio_init,--wrap=mt25q_gpio_set_hold,--wrap=mt25q_gpio_set_reset,--wrap=mt25q_delay_ms,--wrap=cy15x102qn_init,--wrap=cy15x102qn_set_write_enable,--wrap=cy15x102qn_reset_write_enable,--wrap=cy15x102qn_read_status_reg,--wrap=cy15x102qn_write_status_reg,--wrap=cy15x102qn_write,--wrap=cy15x102qn_read,--wrap=cy15x102qn_fast_read,--wrap=cy15x102qn_special_sector_write,--wrap=cy15x102qn_special_sector_read,--wrap=cy15x102qn_read_device_id,--wrap=cy15x102qn_read_unique_id,--wrap=cy15x102qn_write_serial_number,--wrap=cy15x102qn_read_serial_number,--wrap=cy15x102qn_deep_power_down_mode,--wrap=cy15x102qn_hibernate_mode,--wrap=cy15x102qn_spi_init,--wrap=cy15x102qn_spi_write,--wrap=cy15x102qn_spi_read,--wrap=cy15x102qn_spi_transfer,--wrap=cy15x102qn_spi_select,--wrap=cy15x102qn_spi_unselect,--wrap=cy15x102qn_spi_write_only,--wrap=cy15x102qn_spi_read_only,--wrap=cy15x102qn_spi_transfer_only,--wrap=cy15x102qn_gpio_init,--wrap=cy15x102qn_gpio_set_write_protect,--wrap=cy15x102qn_gpio_clear_write_protect

PAYLOAD_TEST_FLAGS=$(FLAGS),--wrap=edc_init,--wrap=edc_enable,--wrap=edc_disable,--wrap=edc_write_cmd,--wrap=edc_read,--wrap=edc_check_device,--wrap=edc_set_rtc_time,--wrap=edc_pop_ptt_pkg,--wrap=edc_pause_ptt_task,--wrap=edc_resume_ptt_task,--wrap=edc_start_adc_task,--wrap=edc_get_state_pkg,--wrap=edc_get_ptt_pkg,--wrap=edc_get_hk_pkg,--wrap=edc_get_adc_seq,--wrap=edc_echo,--wrap=edc_calc_checksum,--wrap=edc_get_state,--wrap=edc_get_ptt,--wrap=edc_get_hk,--wrap=edc_delay_ms,--wrap=phj_init_i2c,--wrap=phj_init_gpio,--wrap=phj_read,--wrap=phj_check_converter,--wrap=phj_check_message,--wrap=px_init,--wrap=px_write,--wrap=px_read
PAYLOAD_TEST_FLAGS=$(FLAGS),--wrap=edc_init,--wrap=edc_enable,--wrap=edc_disable,--wrap=edc_write_cmd,--wrap=edc_read,--wrap=edc_check_device,--wrap=edc_set_rtc_time,--wrap=edc_pop_ptt_pkg,--wrap=edc_pause_ptt_task,--wrap=edc_resume_ptt_task,--wrap=edc_start_adc_task,--wrap=edc_get_state_pkg,--wrap=edc_get_ptt_pkg,--wrap=edc_get_hk_pkg,--wrap=edc_get_adc_seq,--wrap=edc_echo,--wrap=edc_calc_checksum,--wrap=edc_get_state,--wrap=edc_get_ptt,--wrap=edc_get_hk,--wrap=edc_delay_ms,--wrap=phj_init_i2c,--wrap=phj_init_gpio,--wrap=phj_read,--wrap=phj_check_converter,--wrap=phj_check_message,--wrap=px_init,--wrap=px_write,--wrap=px_read,--wrap=px_enable,--wrap=px_disable

.PHONY: all
all: current_sensor_test voltage_sensor_test temp_sensor_test leds_test watchdog_test ttc_test eps_test antenna_test media_test payload_test
Expand Down
18 changes: 14 additions & 4 deletions firmware/tests/devices/payload_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ static void payload_init_test(void **state)
assert_return_code(payload_init(PAYLOAD_EDC_1), 0);

/* Payload-X */
expect_value(__wrap_px_init, conf.port, PX_I2C_PORT);
expect_value(__wrap_px_init, conf.bitrate, PX_I2C_BITRATE);
expect_value(__wrap_px_init, conf->port, PX_I2C_PORT);
expect_value(__wrap_px_init, conf->bitrate, PX_I2C_BITRATE);
expect_value(__wrap_px_init, conf->en_pin, GPIO_PIN_37);

will_return(__wrap_px_init, 0);

Expand All @@ -175,7 +176,11 @@ static void payload_enable_test(void **state)

assert_return_code(payload_enable(PAYLOAD_EDC_1), 0);

// assert_return_code(payload_enable(PAYLOAD_X), 0);
expect_value(__wrap_px_enable, conf->en_pin, GPIO_PIN_37);

will_return(__wrap_px_enable, 0);

assert_return_code(payload_enable(PAYLOAD_X), 0);
// assert_return_code(payload_enable(PAYLOAD_PHJ), 0);
}

Expand All @@ -198,7 +203,12 @@ static void payload_disable_test(void **state)
will_return(__wrap_edc_disable, 0);

assert_return_code(payload_disable(PAYLOAD_EDC_1), 0);
// assert_return_code(payload_disable(PAYLOAD_X), 0);

expect_value(__wrap_px_disable, conf->en_pin, GPIO_PIN_37);

will_return(__wrap_px_disable, 0);

assert_return_code(payload_disable(PAYLOAD_X), 0);
// assert_return_code(payload_disable(PAYLOAD_PHJ), 0);
}

Expand Down

0 comments on commit bb5fe26

Please sign in to comment.