Test cases for basic socket operations */
| 428 | |
| 429 | /* Test cases for basic socket operations */ |
| 430 | static void TC_sal_socket_create(void) |
| 431 | { |
| 432 | int sock; |
| 433 | |
| 434 | LOG_I("Starting TC_sal_socket_create tests..."); |
| 435 | |
| 436 | /* Test valid socket creation */ |
| 437 | LOG_I("Testing TCP socket creation..."); |
| 438 | sock = sal_socket(AF_INET, SOCK_STREAM, 0); |
| 439 | LOG_I("TCP socket created: %d", sock); |
| 440 | uassert_true(sock >= 0); |
| 441 | close_test_socket(sock); |
| 442 | |
| 443 | LOG_I("Testing UDP socket creation..."); |
| 444 | sock = sal_socket(AF_INET, SOCK_DGRAM, 0); |
| 445 | LOG_I("UDP socket created: %d", sock); |
| 446 | uassert_true(sock >= 0); |
| 447 | close_test_socket(sock); |
| 448 | |
| 449 | /* Test invalid parameters */ |
| 450 | LOG_I("Testing invalid family parameter..."); |
| 451 | sock = sal_socket(-1, SOCK_STREAM, 0); |
| 452 | LOG_I("Invalid family result: %d", sock); |
| 453 | uassert_true(sock < 0); |
| 454 | |
| 455 | LOG_I("Testing invalid type parameter..."); |
| 456 | sock = sal_socket(AF_INET, -1, 0); |
| 457 | LOG_I("Invalid type result: %d", sock); |
| 458 | uassert_true(sock < 0); |
| 459 | |
| 460 | LOG_I("Testing invalid protocol parameter..."); |
| 461 | sock = sal_socket(AF_INET, SOCK_STREAM, -1); |
| 462 | LOG_I("Invalid protocol result: %d", sock); |
| 463 | uassert_true(sock < 0); |
| 464 | |
| 465 | LOG_I("TC_sal_socket_create tests completed"); |
| 466 | } |
| 467 | |
| 468 | static void TC_sal_socket_bind(void) |
| 469 | { |
nothing calls this directly
no test coverage detected