|
|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
#include <string.h> |
|
|
|
|
#include <assert.h> |
|
|
|
|
#include "../lib/platform_compat.h" |
|
|
|
|
#include "../lib/socket_compat.h" |
|
|
|
|
|
|
|
|
|
#include "u_async.h" |
|
|
|
|
#include "timeout_heap.h" |
|
|
|
|
@ -138,6 +139,8 @@ static void test_error_callback(void* arg) {
|
|
|
|
|
static void test_basic_timers(void) { |
|
|
|
|
TEST_START("Basic timer functionality"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -171,6 +174,8 @@ static void test_basic_timers(void) {
|
|
|
|
|
static void test_timer_cancellation_races(void) { |
|
|
|
|
TEST_START("Timer cancellation race conditions"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -223,6 +228,8 @@ static void test_timer_cancellation_races(void) {
|
|
|
|
|
static void test_immediate_timeouts(void) { |
|
|
|
|
TEST_START("Immediate timeout handling"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -260,6 +267,8 @@ static void test_immediate_timeouts(void) {
|
|
|
|
|
static void test_memory_leak_detection(void) { |
|
|
|
|
TEST_START("Memory leak detection"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -292,6 +301,8 @@ static void test_memory_leak_detection(void) {
|
|
|
|
|
static void test_socket_management(void) { |
|
|
|
|
TEST_START("Socket management efficiency"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -339,6 +350,8 @@ static void test_socket_management(void) {
|
|
|
|
|
static void test_error_handling(void) { |
|
|
|
|
TEST_START("Error injection and handling"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -374,6 +387,8 @@ static void test_error_handling(void) {
|
|
|
|
|
static void test_concurrent_operations(void) { |
|
|
|
|
TEST_START("Concurrent operations stress test"); |
|
|
|
|
|
|
|
|
|
socket_platform_init(); |
|
|
|
|
|
|
|
|
|
uasync_t* ua = uasync_create(); |
|
|
|
|
ASSERT_NOT_NULL(ua, "Failed to create uasync instance"); |
|
|
|
|
|
|
|
|
|
@ -484,6 +499,7 @@ static void test_concurrent_operations(void) {
|
|
|
|
|
/* Main test runner */ |
|
|
|
|
int main(void) { |
|
|
|
|
debug_config_init(); |
|
|
|
|
socket_platform_init(); |
|
|
|
|
debug_set_level(DEBUG_LEVEL_INFO); |
|
|
|
|
debug_set_categories(DEBUG_CATEGORY_ALL); |
|
|
|
|
|
|
|
|
|
|