Skip to content

Commit

Permalink
unittest fix for newer release of cpputest
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti Kauppila committed Feb 13, 2018
1 parent ed76459 commit beddb01
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/nanostack/unittest/libNET/socket_api/socket_api_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ TEST(SocketAPI, socket_getsockopt)

status = socket_getsockopt(sock_id, SOCKET_IPPROTO_IPV6, SOCKET_IPV6_UNICAST_HOPS, &option, &option_len);
BYTES_EQUAL(0, status);
BYTES_EQUAL(64, option);
int16_t *table = (int16_t*)option;
BYTES_EQUAL(64, table);
BYTES_EQUAL(2, option_len);
option_len = 4;

Expand All @@ -896,7 +897,8 @@ TEST(SocketAPI, socket_getsockopt)
test_data->socket_ptr->inet_pcb->session = &tcp_session;
status = socket_getsockopt(sock_id, SOCKET_IPPROTO_IPV6, SOCKET_IPV6_UNICAST_HOPS, &option, &option_len);
BYTES_EQUAL(0, status);
BYTES_EQUAL(entry.cur_hop_limit, option);
uint8_t *table2 = (uint8_t*)option;
BYTES_EQUAL(entry.cur_hop_limit, table2);
BYTES_EQUAL(2, option_len);
option_len = 4;

Expand Down Expand Up @@ -987,15 +989,15 @@ TEST(SocketAPI, socket_recvmsg)
status = socket_recvmsg(sock_id, &msghdr, 0);
/*Would block*/
BYTES_EQUAL(-100, status);

socket_stub.socket_read_cnt = 10;
msg_iov.iov_base = buf;
buffer_t *read_buffer = test_data->socket_read_buffer;
uint8_t *ptr;
ptr = buffer_data_pointer(read_buffer);
ptr = common_write_16_bit(1000, ptr);
read_buffer->buf_end = ptr - read_buffer->buf;

read_buffer->interface = &interface;
read_buffer->interface->id = 2;
read_buffer->size = 4;
Expand Down

0 comments on commit beddb01

Please sign in to comment.