]> Kevux Git Server - fll/commitdiff
Update: The unit tests where socket.id needs to be set properly.
authorKevin Day <thekevinday@gmail.com>
Thu, 7 Dec 2023 01:55:50 +0000 (19:55 -0600)
committerKevin Day <thekevinday@gmail.com>
Thu, 7 Dec 2023 01:55:50 +0000 (19:55 -0600)
The commit a55af231dacdf355323d42ba6e06f0188eb7d387 the socket.id bug in f_socket_connect() but failed to update the unit test.

level_0/f_socket/tests/unit/c/test-socket-connect.c

index 7612a91fce4f82ba02a8605477955318db97c177..824b2be74d84a9ac24389c3b29f043bb642317a3 100644 (file)
@@ -9,6 +9,8 @@ void test__f_socket_connect__fails(void **state) {
 
   f_socket_t socket = f_socket_t_initialize;
 
+  socket.id = 1;
+
   int errnos[] = {
     EACCES,
     EADDRINUSE,
@@ -66,7 +68,8 @@ void test__f_socket_connect__returns_file_descriptor(void **state) {
 
   {
     f_socket_t socket = f_socket_t_initialize;
-    socket.id = 1;
+
+    socket.id = -1;
 
     const f_status_t status = f_socket_connect(socket);
 
@@ -78,6 +81,8 @@ void test__f_socket_connect__works(void **state) {
 
   f_socket_t socket = f_socket_t_initialize;
 
+  socket.id = 1;
+
   {
     will_return(__wrap_connect, false);