Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit beddb01

Browse files
author
Antti Kauppila
committed
unittest fix for newer release of cpputest
1 parent ed76459 commit beddb01

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/nanostack/unittest/libNET/socket_api/socket_api_test.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,8 @@ TEST(SocketAPI, socket_getsockopt)
885885

886886
status = socket_getsockopt(sock_id, SOCKET_IPPROTO_IPV6, SOCKET_IPV6_UNICAST_HOPS, &option, &option_len);
887887
BYTES_EQUAL(0, status);
888-
BYTES_EQUAL(64, option);
888+
int16_t *table = (int16_t*)option;
889+
BYTES_EQUAL(64, table);
889890
BYTES_EQUAL(2, option_len);
890891
option_len = 4;
891892

@@ -896,7 +897,8 @@ TEST(SocketAPI, socket_getsockopt)
896897
test_data->socket_ptr->inet_pcb->session = &tcp_session;
897898
status = socket_getsockopt(sock_id, SOCKET_IPPROTO_IPV6, SOCKET_IPV6_UNICAST_HOPS, &option, &option_len);
898899
BYTES_EQUAL(0, status);
899-
BYTES_EQUAL(entry.cur_hop_limit, option);
900+
uint8_t *table2 = (uint8_t*)option;
901+
BYTES_EQUAL(entry.cur_hop_limit, table2);
900902
BYTES_EQUAL(2, option_len);
901903
option_len = 4;
902904

@@ -987,15 +989,15 @@ TEST(SocketAPI, socket_recvmsg)
987989
status = socket_recvmsg(sock_id, &msghdr, 0);
988990
/*Would block*/
989991
BYTES_EQUAL(-100, status);
990-
992+
991993
socket_stub.socket_read_cnt = 10;
992994
msg_iov.iov_base = buf;
993995
buffer_t *read_buffer = test_data->socket_read_buffer;
994996
uint8_t *ptr;
995997
ptr = buffer_data_pointer(read_buffer);
996998
ptr = common_write_16_bit(1000, ptr);
997999
read_buffer->buf_end = ptr - read_buffer->buf;
998-
1000+
9991001
read_buffer->interface = &interface;
10001002
read_buffer->interface->id = 2;
10011003
read_buffer->size = 4;

0 commit comments

Comments
 (0)