Skip to content

Commit eef0524

Browse files
author
Arto Kinnunen
committed
Update unittests
1 parent c5e3507 commit eef0524

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

TESTS/network/emac/emac_TestNetworkStack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ char *EmacTestNetworkStack::Interface::get_mac_address(char *buf, nsapi_size_t b
155155
return NULL;
156156
}
157157

158+
nsapi_error_t EmacTestNetworkStack::Interface::set_mac_address(uint8_t *buf, nsapi_size_t buflen)
159+
{
160+
return NSAPI_ERROR_OK;
161+
}
162+
158163
nsapi_error_t EmacTestNetworkStack::Interface::get_ip_address(SocketAddress *address)
159164
{
160165
return NSAPI_ERROR_OK;

TESTS/network/emac/emac_TestNetworkStack.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class EmacTestNetworkStack : public OnboardNetworkStack, private mbed::NonCopyab
8484
*
8585
* @return MAC address as "V:W:X:Y:Z"
8686
*/
87-
virtual char *get_mac_address(char *buf, nsapi_size_t buflen);
87+
//virtual char *get_mac_address(char *buf, nsapi_size_t buflen);
88+
89+
virtual nsapi_error_t set_mac_address(uint8_t *mac_addr, nsapi_size_t addr_len);
8890

8991
/** Copies IP address of the network interface to user supplied buffer
9092
*

UNITTESTS/features/netsocket/NetworkInterface/test_NetworkInterface.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ TEST_F(TestNetworkInterface, get_mac_address)
7575
EXPECT_EQ(iface->get_mac_address(), n);
7676
}
7777

78+
TEST_F(TestNetworkInterface, set_mac_address)
79+
{
80+
uint8_t mac_buf[8];
81+
EXPECT_EQ(iface->set_mac_address(mac_buf, 8), NSAPI_ERROR_UNSUPPORTED);
82+
}
83+
7884
TEST_F(TestNetworkInterface, get_ip_address)
7985
{
8086
SocketAddress addr;

UNITTESTS/stubs/NetworkInterface_stub.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ const char *NetworkInterface::get_mac_address()
2626
return 0;
2727
}
2828

29+
nsapi_error_t NetworkInterface::set_mac_address(uint8_t *mac_addr, nsapi_size_t addr_len)
30+
{
31+
return NSAPI_ERROR_UNSUPPORTED;
32+
}
33+
2934
nsapi_error_t NetworkInterface::get_ip_address(SocketAddress *)
3035
{
3136
return NSAPI_ERROR_UNSUPPORTED;

0 commit comments

Comments
 (0)