unittest: fix style for empty functions

pull/8365/head
Martin Kojtal 2018-10-23 13:56:12 +01:00
parent e80f2ff18a
commit 6efa4f293c
12 changed files with 454 additions and 151 deletions

View File

@ -27,9 +27,13 @@ using namespace events;
class my_phy : public LoRaPHY {
public:
my_phy() {};
my_phy()
{
};
virtual ~my_phy() {};
virtual ~my_phy()
{
};
};
class Test_LoRaMac : public testing::Test {

View File

@ -22,9 +22,13 @@
class my_LoRaPHY : public LoRaPHY {
public:
my_LoRaPHY() {};
my_LoRaPHY()
{
};
virtual ~my_LoRaPHY() {};
virtual ~my_LoRaPHY()
{
};
};

View File

@ -22,9 +22,13 @@
class my_LoRaPHY : public LoRaPHY {
public:
my_LoRaPHY() {};
my_LoRaPHY()
{
};
virtual ~my_LoRaPHY() {};
virtual ~my_LoRaPHY()
{
};
};
uint8_t my_cb()

View File

@ -27,7 +27,9 @@ public:
phy_params.adr_ack_delay = 1;
}
virtual ~my_LoRaPHY() {}
virtual ~my_LoRaPHY()
{
}
loraphy_params_t &get_phy_params()
{
@ -38,13 +40,21 @@ public:
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -52,32 +62,50 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void)
{
return uint8_value;
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -87,18 +115,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
uint8_t uint8_value;

View File

@ -23,13 +23,21 @@
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -37,32 +45,50 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void)
{
return uint8_value;
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -72,18 +98,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
uint8_t uint8_value;

View File

@ -23,13 +23,21 @@
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -37,32 +45,50 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void)
{
return uint8_value;
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -72,18 +98,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
uint8_t uint8_value;

View File

@ -23,13 +23,21 @@
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -37,32 +45,50 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void)
{
return uint8_value;
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -72,18 +98,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
uint8_t uint8_value;

View File

@ -23,13 +23,21 @@
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -37,29 +45,49 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void) {};
virtual uint8_t get_status(void)
{
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -69,18 +97,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
};

View File

@ -22,13 +22,21 @@
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -36,32 +44,50 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void)
{
return uint8_value;
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -71,18 +97,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
uint8_t uint8_value;

View File

@ -21,13 +21,21 @@
class my_radio : public LoRaRadio {
public:
virtual void init_radio(radio_events_t *events) {};
virtual void init_radio(radio_events_t *events)
{
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -35,51 +43,88 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void) {};
virtual uint8_t get_status(void)
{
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
int16_t rssi_threshold,
uint32_t max_carrier_sense_time) {};
uint32_t max_carrier_sense_time)
{
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency) {};
virtual bool check_rf_frequency(uint32_t frequency)
{
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
};
class my_LoRaPHY : public LoRaPHY {
public:
my_LoRaPHY() {};
my_LoRaPHY()
{
};
virtual ~my_LoRaPHY() {};
virtual ~my_LoRaPHY()
{
};
};
class Test_LoRaWANInterface : public testing::Test {

View File

@ -30,9 +30,13 @@ using namespace events;
class my_LoRaPHY : public LoRaPHY {
public:
my_LoRaPHY() {};
my_LoRaPHY()
{
};
virtual ~my_LoRaPHY() {};
virtual ~my_LoRaPHY()
{
};
};
uint8_t my_cb()
@ -49,11 +53,17 @@ public:
_ev = events;
};
virtual void radio_reset() {};
virtual void radio_reset()
{
};
virtual void sleep(void) {};
virtual void sleep(void)
{
};
virtual void standby(void) {};
virtual void standby(void)
{
};
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
@ -61,32 +71,50 @@ public:
uint16_t symb_timeout, bool fix_len,
uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) {};
bool iq_inverted, bool rx_continuous)
{
};
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on,
uint8_t hop_period, bool iq_inverted, uint32_t timeout) {};
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
{
};
virtual void send(uint8_t *buffer, uint8_t size) {};
virtual void send(uint8_t *buffer, uint8_t size)
{
};
virtual void receive(void) {};
virtual void receive(void)
{
};
virtual void set_channel(uint32_t freq) {};
virtual void set_channel(uint32_t freq)
{
};
virtual uint32_t random(void) {};
virtual uint32_t random(void)
{
};
virtual uint8_t get_status(void)
{
return uint8_value;
};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) {};
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
{
};
virtual void set_public_network(bool enable) {};
virtual void set_public_network(bool enable)
{
};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) {};
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
{
};
virtual bool perform_carrier_sense(radio_modems_t modem,
uint32_t freq,
@ -96,18 +124,26 @@ public:
return bool_value;
};
virtual void start_cad(void) {};
virtual void start_cad(void)
{
};
virtual bool check_rf_frequency(uint32_t frequency)
{
return bool_value;
};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) {};
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
{
};
virtual void lock(void) {};
virtual void lock(void)
{
};
virtual void unlock(void) {};
virtual void unlock(void)
{
};
bool bool_value;
uint8_t uint8_value;

View File

@ -65,7 +65,9 @@ public:
return 0;
}
virtual int close() {}
virtual int close()
{
}
virtual short poll(short events) const
{