tests: fix coding style

pull/8591/head
Martin Kojtal 2018-10-31 12:18:42 +00:00
parent 326658a2fc
commit 79d4fd8173
3 changed files with 29 additions and 29 deletions

View File

@ -152,7 +152,7 @@ public:
{ {
assert(sock); assert(sock);
} }
SInfo(Socket* sock, bool delete_on_exit=true): SInfo(Socket *sock, bool delete_on_exit = true):
_id(id_count++), _id(id_count++),
_sock(sock), _sock(sock),
_type(SInfo::OTHER), _type(SInfo::OTHER),
@ -1162,11 +1162,11 @@ static int cmd_socket(int argc, char *argv[])
cmd_printf("Invalid socket id\r\n"); cmd_printf("Invalid socket id\r\n");
return CMDLINE_RETCODE_FAIL; return CMDLINE_RETCODE_FAIL;
} }
TCPSocket *new_sock = static_cast<TCPSocket*>(&new_info->socket()); TCPSocket *new_sock = static_cast<TCPSocket *>(&new_info->socket());
nsapi_error_t ret = static_cast<TCPServer&>(info->socket()).accept(new_sock, &addr); nsapi_error_t ret = static_cast<TCPServer &>(info->socket()).accept(new_sock, &addr);
if (ret == NSAPI_ERROR_OK) { if (ret == NSAPI_ERROR_OK) {
cmd_printf("TCPServer::accept() new socket sid: %d connection from %s port %d\r\n", cmd_printf("TCPServer::accept() new socket sid: %d connection from %s port %d\r\n",
new_info->id(), addr.get_ip_address(), addr.get_port()); new_info->id(), addr.get_ip_address(), addr.get_port());
} }
return handle_nsapi_error("TCPServer::accept()", ret); return handle_nsapi_error("TCPServer::accept()", ret);
} }

View File

@ -27,7 +27,7 @@ public:
phy_params.adr_ack_delay = 1; phy_params.adr_ack_delay = 1;
} }
virtual ~my_LoRaPHY() virtual ~my_LoRaPHY()
{ {
} }
@ -40,19 +40,19 @@ public:
class my_radio : public LoRaRadio { class my_radio : public LoRaRadio {
public: 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)
{ {
}; };
@ -62,7 +62,7 @@ public:
uint16_t symb_timeout, bool fix_len, uint16_t symb_timeout, bool fix_len,
uint8_t payload_len, uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period, bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous) bool iq_inverted, bool rx_continuous)
{ {
}; };
@ -70,23 +70,23 @@ public:
uint32_t bandwidth, uint32_t datarate, uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preamble_len, uint8_t coderate, uint16_t preamble_len,
bool fix_len, bool crc_on, bool freq_hop_on, 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)
{ {
}; };
@ -95,15 +95,15 @@ public:
return uint8_value; 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)
{ {
}; };
@ -115,7 +115,7 @@ public:
return bool_value; return bool_value;
}; };
virtual void start_cad(void) virtual void start_cad(void)
{ {
}; };
@ -124,15 +124,15 @@ public:
return bool_value; 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)
{ {
}; };
@ -422,10 +422,10 @@ TEST_F(Test_LoRaPHY, compute_rx_win_params)
list[0] = 125000; list[0] = 125000;
object->get_phy_params().bandwidths.table = list; object->get_phy_params().bandwidths.table = list;
uint8_t list2[1]; uint8_t list2[1];
list2[0]= 12; list2[0] = 12;
object->get_phy_params().datarates.table = &list2; object->get_phy_params().datarates.table = &list2;
channel_params_t ch_lst[16]; channel_params_t ch_lst[16];
memset(ch_lst, 0, sizeof(channel_params_t)*16); memset(ch_lst, 0, sizeof(channel_params_t) * 16);
ch_lst[0].band = 0; ch_lst[0].band = 0;
ch_lst[0].dr_range.fields.min = DR_0; ch_lst[0].dr_range.fields.min = DR_0;
ch_lst[0].dr_range.fields.max = DR_5; ch_lst[0].dr_range.fields.max = DR_5;
@ -513,7 +513,7 @@ TEST_F(Test_LoRaPHY, link_ADR_request)
object->get_phy_params().max_channel_cnt = 16; object->get_phy_params().max_channel_cnt = 16;
channel_params_t li[16]; channel_params_t li[16];
memset(li, 0, sizeof(channel_params_t)*16); memset(li, 0, sizeof(channel_params_t) * 16);
object->get_phy_params().channels.channel_list = li; object->get_phy_params().channels.channel_list = li;
li[0].frequency = 0; li[0].frequency = 0;
li[1].frequency = 5; li[1].frequency = 5;
@ -673,7 +673,7 @@ TEST_F(Test_LoRaPHY, set_next_channel)
ch = 5; ch = 5;
t1 = 16; t1 = 16;
t2 = 32; t2 = 32;
memset(b, 0, sizeof(band_t)*4); memset(b, 0, sizeof(band_t) * 4);
object->get_phy_params().bands.size = 2; object->get_phy_params().bands.size = 2;
object->get_phy_params().bands.table = &b; object->get_phy_params().bands.table = &b;
b[0].off_time = 0; b[0].off_time = 0;
@ -767,7 +767,7 @@ TEST_F(Test_LoRaPHY, set_tx_cont_mode)
cw_mode_params_t p; cw_mode_params_t p;
p.max_eirp = 0; p.max_eirp = 0;
p.channel=0; p.channel = 0;
p.tx_power = -1; p.tx_power = -1;
p.datarate = 0; p.datarate = 0;
p.antenna_gain = 1; p.antenna_gain = 1;

View File

@ -44,9 +44,9 @@ public:
uint8_t payload_len, uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period, 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, virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate, uint32_t bandwidth, uint32_t datarate,