-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware: tests: devices: Updating the unit test of the OBDH device #147
- Loading branch information
Showing
4 changed files
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* obdh_test.c | ||
* | ||
* Copyright (C) 2021, SpaceLab. | ||
* Copyright The EPS 2.0 Contributors. | ||
* | ||
* This file is part of EPS 2.0. | ||
* | ||
|
@@ -24,8 +24,9 @@ | |
* \brief Unit test of the OBDH device. | ||
* | ||
* \author Lucas Zacchi de Medeiros <[email protected]> | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.1.0 | ||
* \version 0.2.41 | ||
* | ||
* \date 2021/09/15 | ||
* | ||
|
@@ -50,19 +51,19 @@ static void obdh_init_test(void** state) { | |
|
||
} | ||
|
||
static void obdh_decocde_test(void **state) { | ||
static void obdh_decode_test(void **state) { | ||
|
||
} | ||
|
||
static void obdh_answer_test(void** state) { | ||
static void obdh_write_output_buffer_test(void** state) { | ||
|
||
} | ||
|
||
int main(void) { | ||
const struct CMUnitTest obdh_tests[] = { | ||
cmocka_unit_test(obdh_init_test), | ||
cmocka_unit_test(obdh_decocde_test), | ||
cmocka_unit_test(obdh_answer_test), | ||
cmocka_unit_test(obdh_decode_test), | ||
cmocka_unit_test(obdh_write_output_buffer_test), | ||
|
||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* i2c_slave_wrap.c | ||
* | ||
* Copyright (C) 2021, SpaceLab. | ||
* Copyright The EPS 2.0 Contributors. | ||
* | ||
* This file is part of EPS 2.0. | ||
* | ||
|
@@ -24,8 +24,9 @@ | |
* \brief i2c_slave driver wrap implementation. | ||
* | ||
* \author Lucas Zacchi de Medeiros <[email protected]> | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.1.0 | ||
* \version 0.2.41 | ||
* | ||
* \date 2021/09/28 | ||
* | ||
|
@@ -37,26 +38,23 @@ | |
#include <stdint.h> | ||
#include <drivers/i2c_slave/i2c_slave.h> | ||
|
||
uint8_t i2c_rx_buffer[I2C_RX_BUFFER_MAX_SIZE]; | ||
uint8_t i2c_received_data_size = 0; | ||
|
||
int __wrap_i2c_slave_init(i2c_slave_port_t port) { | ||
int __wrap_i2c_slave_init(i2c_slave_port_t port, i2c_slave_address_t adr) { | ||
return 0; | ||
} | ||
|
||
int __wrap_i2c_slave_set_mode(i2c_slave_port_t port, i2c_mode_t mode) { | ||
int __wrap_i2c_slave_enable(void) { | ||
return 0; | ||
} | ||
|
||
int __wrap_i2c_slave_enable(i2c_slave_port_t port) { | ||
int __wrap_i2c_slave_disable(void) { | ||
return 0; | ||
} | ||
|
||
int __wrap_i2c_slave_disable(i2c_slave_port_t port) { | ||
int __wrap_i2c_slave_read(uint8_t *data, uint16_t *len) { | ||
return 0; | ||
} | ||
|
||
int __wrap_i2c_slave_write(i2c_slave_port_t port, uint8_t *data, uint16_t len) { | ||
int __wrap_i2c_slave_write(uint8_t *data, uint16_t len) { | ||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* i2c_slave_wrap.h | ||
* | ||
* Copyright (C) 2021, SpaceLab. | ||
* Copyright The EPS 2.0 Contributors. | ||
* | ||
* This file is part of EPS 2.0. | ||
* | ||
|
@@ -24,8 +24,9 @@ | |
* \brief i2c_slave driver wrap definition. | ||
* | ||
* \author Lucas Zacchi de Medeiros <[email protected]> | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.1.0 | ||
* \version 0.2.41 | ||
* | ||
* \date 2021/09/28 | ||
* | ||
|
@@ -37,21 +38,20 @@ | |
#define I2C_SLAVE_WRAP_H | ||
|
||
#include <stdint.h> | ||
|
||
#include <drivers/i2c_slave/i2c_slave.h> | ||
#include <drivers/i2c/i2c.h> | ||
|
||
extern uint8_t i2c_rx_buffer[I2C_RX_BUFFER_MAX_SIZE]; | ||
extern uint8_t i2c_received_data_size; | ||
|
||
int __wrap_i2c_slave_init(i2c_slave_port_t port); | ||
int __wrap_i2c_slave_init(i2c_slave_port_t port, i2c_slave_address_t adr); | ||
|
||
int __wrap_i2c_slave_set_mode(i2c_slave_port_t port, i2c_mode_t mode); | ||
int __wrap_i2c_slave_enable(void); | ||
|
||
int __wrap_i2c_slave_enable(i2c_slave_port_t port); | ||
int __wrap_i2c_slave_disable(void); | ||
|
||
int __wrap_i2c_slave_disable(i2c_slave_port_t port); | ||
int __wrap_i2c_slave_read(uint8_t *data, uint16_t *len); | ||
|
||
int __wrap_i2c_slave_write(i2c_slave_port_t port, uint8_t *data, uint16_t len); | ||
int __wrap_i2c_slave_write(uint8_t *data, uint16_t len); | ||
|
||
#endif /* I2C_SLAVE_WRAP_H */ | ||
|
||
/** \} End of i2c_slave_wrap group */ |