| 920 | } |
| 921 | |
| 922 | static void TC_sal_socket_close(void) |
| 923 | { |
| 924 | int sock = -1; |
| 925 | |
| 926 | LOG_I("Starting TC_sal_socket_close tests..."); |
| 927 | |
| 928 | /* Test close valid socket */ |
| 929 | LOG_I("Testing close valid socket..."); |
| 930 | sock = create_test_socket(AF_INET, SOCK_STREAM, 0); |
| 931 | LOG_I("Closing socket %d...", sock); |
| 932 | uassert_int_equal(sal_closesocket(sock), 0); |
| 933 | sock = -1; |
| 934 | |
| 935 | /* Test close invalid socket */ |
| 936 | LOG_I("Testing close invalid socket..."); |
| 937 | uassert_int_equal(sal_closesocket(-1), -1); |
| 938 | |
| 939 | /* Test double close */ |
| 940 | LOG_I("Testing double close..."); |
| 941 | sock = create_test_socket(AF_INET, SOCK_STREAM, 0); |
| 942 | sal_closesocket(sock); |
| 943 | LOG_I("Double closing socket %d (should be safe)", sock); |
| 944 | |
| 945 | LOG_I("TC_sal_socket_close tests completed"); |
| 946 | } |
| 947 | |
| 948 | static void TC_sal_socket_getpeername_getsockname(void) |
| 949 | { |
nothing calls this directly
no test coverage detected