Skip to content

CodeRabbit Generated Unit Tests: Add unit tests for PR changes#928

Draft
coderabbitai[bot] wants to merge 7 commits intomasterfrom
coderabbitai/utg/c167f8c
Draft

CodeRabbit Generated Unit Tests: Add unit tests for PR changes#928
coderabbitai[bot] wants to merge 7 commits intomasterfrom
coderabbitai/utg/c167f8c

Conversation

@coderabbitai
Copy link

@coderabbitai coderabbitai bot commented Feb 4, 2026

Unit test generation was requested by @mkmer.

The following files were modified:

  • TESTS_CREATED.md
  • TEST_SUMMARY.md
  • run_tests.sh
  • tests/res/http_registrations/Makefile
  • tests/res/http_registrations/QUICKSTART.md
  • tests/res/http_registrations/README.md
  • tests/res/http_registrations/__pycache__/mock_registration_server.cpython-311.pyc
  • tests/res/http_registrations/configs/ast1/iax.conf
  • tests/res/http_registrations/configs/ast1/logger.conf
  • tests/res/http_registrations/configs/ast1/manager.conf
  • tests/res/http_registrations/configs/ast1/modules.conf
  • tests/res/http_registrations/configs/ast1/rpt_http_registrations.conf
  • tests/res/http_registrations/mock_registration_server.py
  • tests/res/http_registrations/test-config.yaml
  • tests/res/http_registrations/test_http_registrations_unit.c
  • tests/res/http_registrations_failure/configs/ast1/iax.conf
  • tests/res/http_registrations_failure/configs/ast1/logger.conf
  • tests/res/http_registrations_failure/configs/ast1/manager.conf
  • tests/res/http_registrations_failure/configs/ast1/modules.conf
  • tests/res/http_registrations_failure/configs/ast1/rpt_http_registrations.conf
  • tests/res/http_registrations_failure/test-config.yaml
  • tests/res/tests.yaml

@coderabbitai
Copy link
Author

coderabbitai bot commented Feb 4, 2026

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. By default, CodeRabbit skips reviewing PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v19.1.1

Click here for the full clang-format patch
diff --git a/tests/res/http_registrations/test_http_registrations_unit.c b/tests/res/http_registrations/test_http_registrations_unit.c
index d0116e4..b82a8c2 100644
--- a/tests/res/http_registrations/test_http_registrations_unit.c
+++ b/tests/res/http_registrations/test_http_registrations_unit.c
@@ -22,9 +22,9 @@ static int tests_failed = 0;
-    do { \
-        if (condition) { \
-            printf("  [PASS] %s\n", message); \
-            tests_passed++; \
-        } else { \
-            printf("  [FAIL] %s\n", message); \
-            tests_failed++; \
-        } \
-    } while(0)
+	do { \
+		if (condition) { \
+			printf("  [PASS] %s\n", message); \
+			tests_passed++; \
+		} else { \
+			printf("  [FAIL] %s\n", message); \
+			tests_failed++; \
+		} \
+	} while (0)
@@ -34,6 +34,6 @@ struct mock_http_registry {
-    char username[80];
-    char secret[80];
-    char hostname[256];
-    int port;
-    int refresh;
-    char registered;
+	char username[80];
+	char secret[80];
+	char hostname[256];
+	int port;
+	int refresh;
+	char registered;
@@ -48,130 +48,117 @@ void test_parse_register_format(void)
-    printf("\n=== Test: Registration String Parsing ===\n");
-
-    /* Test 1: Valid format with username, password, hostname, and port */
-    {
-        const char *input = "testnode:testpass@example.com:443";
-        char copy[256];
-        char *username, *hostname, *secret, *porta;
-        char *stringp = NULL;
-
-        strcpy(copy, input);
-        stringp = copy;
-        username = strsep(&stringp, "@");
-        hostname = strsep(&stringp, "@");
-
-        TEST_ASSERT(username != NULL && hostname != NULL,
-                   "Basic format parsing (user@host)");
-
-        stringp = username;
-        username = strsep(&stringp, ":");
-        secret = strsep(&stringp, ":");
-
-        TEST_ASSERT(strcmp(username, "testnode") == 0,
-                   "Username parsed correctly");
-        TEST_ASSERT(strcmp(secret, "testpass") == 0,
-                   "Password parsed correctly");
-
-        stringp = hostname;
-        hostname = strsep(&stringp, ":");
-        porta = strsep(&stringp, ":");
-
-        TEST_ASSERT(strcmp(hostname, "example.com") == 0,
-                   "Hostname parsed correctly");
-        TEST_ASSERT(strcmp(porta, "443") == 0,
-                   "Port parsed correctly");
-    }
-
-    /* Test 2: Format without password */
-    {
-        const char *input = "testnode@example.com:443";
-        char copy[256];
-        char *username, *hostname, *secret, *porta;
-        char *stringp = NULL;
-
-        strcpy(copy, input);
-        stringp = copy;
-        username = strsep(&stringp, "@");
-        hostname = strsep(&stringp, "@");
-
-        stringp = username;
-        username = strsep(&stringp, ":");
-        secret = strsep(&stringp, ":");
-
-        TEST_ASSERT(strcmp(username, "testnode") == 0,
-                   "Username without password parsed");
-        TEST_ASSERT(secret == NULL,
-                   "Missing password returns NULL");
-    }
-
-    /* Test 3: Format without port */
-    {
-        const char *input = "testnode:testpass@example.com";
-        char copy[256];
-        char *username, *hostname, *secret, *porta;
-        char *stringp = NULL;
-
-        strcpy(copy, input);
-        stringp = copy;
-        username = strsep(&stringp, "@");
-        hostname = strsep(&stringp, "@");
-
-        stringp = username;
-        username = strsep(&stringp, ":");
-        secret = strsep(&stringp, ":");
-
-        stringp = hostname;
-        hostname = strsep(&stringp, ":");
-        porta = strsep(&stringp, ":");
-
-        TEST_ASSERT(strcmp(hostname, "example.com") == 0,
-                   "Hostname without port parsed");
-        TEST_ASSERT(porta == NULL,
-                   "Missing port returns NULL");
-    }
-
-    /* Test 4: Invalid format - missing hostname separator */
-    {
-        const char *input = "testnode_no_separator";
-        char copy[256];
-        char *username, *hostname;
-        char *stringp = NULL;
-
-        strcpy(copy, input);
-        stringp = copy;
-        username = strsep(&stringp, "@");
-        hostname = strsep(&stringp, "@");
-
-        TEST_ASSERT(hostname == NULL,
-                   "Invalid format (no @) detected");
-    }
-
-    /* Test 5: Invalid format - empty username */
-    {
-        const char *input = ":password@example.com:443";
-        char copy[256];
-        char *username, *hostname, *secret;
-        char *stringp = NULL;
-
-        strcpy(copy, input);
-        stringp = copy;
-        username = strsep(&stringp, "@");
-        hostname = strsep(&stringp, "@");
-
-        stringp = username;
-        username = strsep(&stringp, ":");
-        secret = strsep(&stringp, ":");
-
-        TEST_ASSERT(strlen(username) == 0,
-                   "Empty username detected");
-    }
-
-    /* Test 6: Port number validation */
-    {
-        const char *valid_port = "443";
-        const char *invalid_port = "notaport";
-
-        TEST_ASSERT(atoi(valid_port) == 443,
-                   "Valid port number converted");
-        TEST_ASSERT(atoi(invalid_port) == 0,
-                   "Invalid port number returns 0");
-    }
+	printf("\n=== Test: Registration String Parsing ===\n");
+
+	/* Test 1: Valid format with username, password, hostname, and port */
+	{
+		const char *input = "testnode:testpass@example.com:443";
+		char copy[256];
+		char *username, *hostname, *secret, *porta;
+		char *stringp = NULL;
+
+		strcpy(copy, input);
+		stringp = copy;
+		username = strsep(&stringp, "@");
+		hostname = strsep(&stringp, "@");
+
+		TEST_ASSERT(username != NULL && hostname != NULL, "Basic format parsing (user@host)");
+
+		stringp = username;
+		username = strsep(&stringp, ":");
+		secret = strsep(&stringp, ":");
+
+		TEST_ASSERT(strcmp(username, "testnode") == 0, "Username parsed correctly");
+		TEST_ASSERT(strcmp(secret, "testpass") == 0, "Password parsed correctly");
+
+		stringp = hostname;
+		hostname = strsep(&stringp, ":");
+		porta = strsep(&stringp, ":");
+
+		TEST_ASSERT(strcmp(hostname, "example.com") == 0, "Hostname parsed correctly");
+		TEST_ASSERT(strcmp(porta, "443") == 0, "Port parsed correctly");
+	}
+
+	/* Test 2: Format without password */
+	{
+		const char *input = "testnode@example.com:443";
+		char copy[256];
+		char *username, *hostname, *secret, *porta;
+		char *stringp = NULL;
+
+		strcpy(copy, input);
+		stringp = copy;
+		username = strsep(&stringp, "@");
+		hostname = strsep(&stringp, "@");
+
+		stringp = username;
+		username = strsep(&stringp, ":");
+		secret = strsep(&stringp, ":");
+
+		TEST_ASSERT(strcmp(username, "testnode") == 0, "Username without password parsed");
+		TEST_ASSERT(secret == NULL, "Missing password returns NULL");
+	}
+
+	/* Test 3: Format without port */
+	{
+		const char *input = "testnode:testpass@example.com";
+		char copy[256];
+		char *username, *hostname, *secret, *porta;
+		char *stringp = NULL;
+
+		strcpy(copy, input);
+		stringp = copy;
+		username = strsep(&stringp, "@");
+		hostname = strsep(&stringp, "@");
+
+		stringp = username;
+		username = strsep(&stringp, ":");
+		secret = strsep(&stringp, ":");
+
+		stringp = hostname;
+		hostname = strsep(&stringp, ":");
+		porta = strsep(&stringp, ":");
+
+		TEST_ASSERT(strcmp(hostname, "example.com") == 0, "Hostname without port parsed");
+		TEST_ASSERT(porta == NULL, "Missing port returns NULL");
+	}
+
+	/* Test 4: Invalid format - missing hostname separator */
+	{
+		const char *input = "testnode_no_separator";
+		char copy[256];
+		char *username, *hostname;
+		char *stringp = NULL;
+
+		strcpy(copy, input);
+		stringp = copy;
+		username = strsep(&stringp, "@");
+		hostname = strsep(&stringp, "@");
+
+		TEST_ASSERT(hostname == NULL, "Invalid format (no @) detected");
+	}
+
+	/* Test 5: Invalid format - empty username */
+	{
+		const char *input = ":password@example.com:443";
+		char copy[256];
+		char *username, *hostname, *secret;
+		char *stringp = NULL;
+
+		strcpy(copy, input);
+		stringp = copy;
+		username = strsep(&stringp, "@");
+		hostname = strsep(&stringp, "@");
+
+		stringp = username;
+		username = strsep(&stringp, ":");
+		secret = strsep(&stringp, ":");
+
+		TEST_ASSERT(strlen(username) == 0, "Empty username detected");
+	}
+
+	/* Test 6: Port number validation */
+	{
+		const char *valid_port = "443";
+		const char *invalid_port = "notaport";
+
+		TEST_ASSERT(atoi(valid_port) == 443, "Valid port number converted");
+		TEST_ASSERT(atoi(invalid_port) == 0, "Invalid port number returns 0");
+	}
@@ -186,35 +173,34 @@ void test_build_request_data_format(void)
-    printf("\n=== Test: JSON Request Data Format ===\n");
-
-    /* Test 1: Verify expected JSON structure components */
-    {
-        /* Expected format:
-         * {
-         *   "port": 4569,
-         *   "data": {
-         *     "nodes": {
-         *       "node_number": {
-         *         "node": "node_number",
-         *         "passwd": "password",
-         *         "remote": 0
-         *       }
-         *     }
-         *   }
-         * }
-         */
-        const char *expected_keys[] = {"port", "data", "nodes", "node", "passwd", "remote"};
-        int num_keys = sizeof(expected_keys) / sizeof(expected_keys[0]);
-
-        printf("  Expected JSON structure contains keys:\n");
-        for (int i = 0; i < num_keys; i++) {
-            printf("    - %s\n", expected_keys[i]);
-        }
-
-        TEST_ASSERT(1, "JSON structure documented");
-    }
-
-    /* Test 2: Verify remote field is set to 0 */
-    {
-        int remote_value = 0;
-        TEST_ASSERT(remote_value == 0,
-                   "Remote field defaults to 0");
-    }
+	printf("\n=== Test: JSON Request Data Format ===\n");
+
+	/* Test 1: Verify expected JSON structure components */
+	{
+		/* Expected format:
+		 * {
+		 *   "port": 4569,
+		 *   "data": {
+		 *     "nodes": {
+		 *       "node_number": {
+		 *         "node": "node_number",
+		 *         "passwd": "password",
+		 *         "remote": 0
+		 *       }
+		 *     }
+		 *   }
+		 * }
+		 */
+		const char *expected_keys[] = { "port", "data", "nodes", "node", "passwd", "remote" };
+		int num_keys = sizeof(expected_keys) / sizeof(expected_keys[0]);
+
+		printf("  Expected JSON structure contains keys:\n");
+		for (int i = 0; i < num_keys; i++) {
+			printf("    - %s\n", expected_keys[i]);
+		}
+
+		TEST_ASSERT(1, "JSON structure documented");
+	}
+
+	/* Test 2: Verify remote field is set to 0 */
+	{
+		int remote_value = 0;
+		TEST_ASSERT(remote_value == 0, "Remote field defaults to 0");
+	}
@@ -229,29 +215,22 @@ void test_http_response_parsing(void)
-    printf("\n=== Test: HTTP Response Parsing ===\n");
-
-    /* Test 1: Valid success response */
-    {
-        const char *response = "{\"ipaddr\":\"192.168.1.100\",\"port\":4569,\"refresh\":60,\"data\":\"successfully registered\"}";
-
-        /* Verify response contains expected fields */
-        TEST_ASSERT(strstr(response, "ipaddr") != NULL,
-                   "Response contains ipaddr field");
-        TEST_ASSERT(strstr(response, "port") != NULL,
-                   "Response contains port field");
-        TEST_ASSERT(strstr(response, "refresh") != NULL,
-                   "Response contains refresh field");
-        TEST_ASSERT(strstr(response, "data") != NULL,
-                   "Response contains data field");
-        TEST_ASSERT(strstr(response, "successfully registered") != NULL,
-                   "Response contains success message");
-    }
-
-    /* Test 2: Check for registration success indicator */
-    {
-        const char *success_response = "successfully registered";
-        const char *fail_response = "registration failed";
-
-        TEST_ASSERT(strstr(success_response, "successfully registered") != NULL,
-                   "Success response detected");
-        TEST_ASSERT(strstr(fail_response, "successfully registered") == NULL,
-                   "Failure response detected");
-    }
+	printf("\n=== Test: HTTP Response Parsing ===\n");
+
+	/* Test 1: Valid success response */
+	{
+		const char *response = "{\"ipaddr\":\"192.168.1.100\",\"port\":4569,\"refresh\":60,\"data\":\"successfully registered\"}";
+
+		/* Verify response contains expected fields */
+		TEST_ASSERT(strstr(response, "ipaddr") != NULL, "Response contains ipaddr field");
+		TEST_ASSERT(strstr(response, "port") != NULL, "Response contains port field");
+		TEST_ASSERT(strstr(response, "refresh") != NULL, "Response contains refresh field");
+		TEST_ASSERT(strstr(response, "data") != NULL, "Response contains data field");
+		TEST_ASSERT(strstr(response, "successfully registered") != NULL, "Response contains success message");
+	}
+
+	/* Test 2: Check for registration success indicator */
+	{
+		const char *success_response = "successfully registered";
+		const char *fail_response = "registration failed";
+
+		TEST_ASSERT(strstr(success_response, "successfully registered") != NULL, "Success response detected");
+		TEST_ASSERT(strstr(fail_response, "successfully registered") == NULL, "Failure response detected");
+	}
@@ -266,38 +245,31 @@ void test_registration_state_management(void)
-    printf("\n=== Test: Registration State Management ===\n");
-
-    struct mock_http_registry reg = {0};
-
-    /* Test 1: Initial state */
-    {
-        TEST_ASSERT(reg.registered == 0,
-                   "Initial registration state is unregistered");
-        TEST_ASSERT(reg.refresh == 0,
-                   "Initial refresh interval is 0");
-    }
-
-    /* Test 2: Successful registration state */
-    {
-        strcpy(reg.username, "testnode");
-        strcpy(reg.secret, "testpass");
-        strcpy(reg.hostname, "example.com");
-        reg.port = 443;
-        reg.registered = 1;
-        reg.refresh = 60;
-
-        TEST_ASSERT(reg.registered == 1,
-                   "Registration state set to registered");
-        TEST_ASSERT(reg.refresh == 60,
-                   "Refresh interval set correctly");
-        TEST_ASSERT(strlen(reg.username) > 0,
-                   "Username stored");
-        TEST_ASSERT(strlen(reg.hostname) > 0,
-                   "Hostname stored");
-    }
-
-    /* Test 3: Failed registration state */
-    {
-        reg.registered = 0;
-
-        TEST_ASSERT(reg.registered == 0,
-                   "Failed registration state cleared");
-    }
+	printf("\n=== Test: Registration State Management ===\n");
+
+	struct mock_http_registry reg = { 0 };
+
+	/* Test 1: Initial state */
+	{
+		TEST_ASSERT(reg.registered == 0, "Initial registration state is unregistered");
+		TEST_ASSERT(reg.refresh == 0, "Initial refresh interval is 0");
+	}
+
+	/* Test 2: Successful registration state */
+	{
+		strcpy(reg.username, "testnode");
+		strcpy(reg.secret, "testpass");
+		strcpy(reg.hostname, "example.com");
+		reg.port = 443;
+		reg.registered = 1;
+		reg.refresh = 60;
+
+		TEST_ASSERT(reg.registered == 1, "Registration state set to registered");
+		TEST_ASSERT(reg.refresh == 60, "Refresh interval set correctly");
+		TEST_ASSERT(strlen(reg.username) > 0, "Username stored");
+		TEST_ASSERT(strlen(reg.hostname) > 0, "Hostname stored");
+	}
+
+	/* Test 3: Failed registration state */
+	{
+		reg.registered = 0;
+
+		TEST_ASSERT(reg.registered == 0, "Failed registration state cleared");
+	}
@@ -312,30 +284,25 @@ void test_url_construction(void)
-    printf("\n=== Test: URL Construction ===\n");
-
-    /* Test 1: URL with port */
-    {
-        char url[256];
-        const char *hostname = "example.com";
-        int port = 8443;
-
-        snprintf(url, sizeof(url), "https://%s:%d/", hostname, port);
-
-        TEST_ASSERT(strncmp(url, "https://", 8) == 0,
-                   "URL starts with https://");
-        TEST_ASSERT(strstr(url, "example.com") != NULL,
-                   "URL contains hostname");
-        TEST_ASSERT(strstr(url, "8443") != NULL,
-                   "URL contains port");
-        TEST_ASSERT(url[strlen(url)-1] == '/',
-                   "URL ends with /");
-    }
-
-    /* Test 2: URL without explicit port (uses default) */
-    {
-        char url[256];
-        const char *hostname = "example.com";
-
-        snprintf(url, sizeof(url), "https://%s/", hostname);
-
-        TEST_ASSERT(strcmp(url, "https://example.com/") == 0,
-                   "URL without port constructed correctly");
-    }
+	printf("\n=== Test: URL Construction ===\n");
+
+	/* Test 1: URL with port */
+	{
+		char url[256];
+		const char *hostname = "example.com";
+		int port = 8443;
+
+		snprintf(url, sizeof(url), "https://%s:%d/", hostname, port);
+
+		TEST_ASSERT(strncmp(url, "https://", 8) == 0, "URL starts with https://");
+		TEST_ASSERT(strstr(url, "example.com") != NULL, "URL contains hostname");
+		TEST_ASSERT(strstr(url, "8443") != NULL, "URL contains port");
+		TEST_ASSERT(url[strlen(url) - 1] == '/', "URL ends with /");
+	}
+
+	/* Test 2: URL without explicit port (uses default) */
+	{
+		char url[256];
+		const char *hostname = "example.com";
+
+		snprintf(url, sizeof(url), "https://%s/", hostname);
+
+		TEST_ASSERT(strcmp(url, "https://example.com/") == 0, "URL without port constructed correctly");
+	}
@@ -350 +317 @@ void test_config_interval_parsing(void)
-    printf("\n=== Test: Configuration Interval Parsing ===\n");
+	printf("\n=== Test: Configuration Interval Parsing ===\n");
@@ -352,4 +319,4 @@ void test_config_interval_parsing(void)
-    /* Test 1: Valid interval */
-    {
-        const char *valid_interval = "60";
-        int interval = atoi(valid_interval);
+	/* Test 1: Valid interval */
+	{
+		const char *valid_interval = "60";
+		int interval = atoi(valid_interval);
@@ -357,3 +324,2 @@ void test_config_interval_parsing(void)
-        TEST_ASSERT(interval == 60,
-                   "Valid interval parsed correctly");
-    }
+		TEST_ASSERT(interval == 60, "Valid interval parsed correctly");
+	}
@@ -361,4 +327,4 @@ void test_config_interval_parsing(void)
-    /* Test 2: Invalid interval (non-numeric) */
-    {
-        const char *invalid_interval = "not_a_number";
-        int interval = atoi(invalid_interval);
+	/* Test 2: Invalid interval (non-numeric) */
+	{
+		const char *invalid_interval = "not_a_number";
+		int interval = atoi(invalid_interval);
@@ -366,3 +332,2 @@ void test_config_interval_parsing(void)
-        TEST_ASSERT(interval == 0,
-                   "Invalid interval returns 0");
-    }
+		TEST_ASSERT(interval == 0, "Invalid interval returns 0");
+	}
@@ -370,3 +335,3 @@ void test_config_interval_parsing(void)
-    /* Test 3: Default interval */
-    {
-        int default_interval = 60;
+	/* Test 3: Default interval */
+	{
+		int default_interval = 60;
@@ -374,3 +339,2 @@ void test_config_interval_parsing(void)
-        TEST_ASSERT(default_interval == 60,
-                   "Default interval is 60 seconds");
-    }
+		TEST_ASSERT(default_interval == 60, "Default interval is 60 seconds");
+	}
@@ -385,26 +349,23 @@ void test_memory_management(void)
-    printf("\n=== Test: Memory Management ===\n");
-
-    /* Test 1: Registry structure allocation */
-    {
-        size_t base_size = sizeof(struct mock_http_registry);
-        size_t hostname_len = strlen("example.com") + 1;
-        size_t total_size = base_size + hostname_len;
-
-        TEST_ASSERT(total_size > base_size,
-                   "Flexible array member adds to size");
-    }
-
-    /* Test 2: String bounds checking */
-    {
-        struct mock_http_registry reg = {0};
-        const char *test_username = "testnode";
-        const char *test_secret = "testpassword123";
-
-        strncpy(reg.username, test_username, sizeof(reg.username) - 1);
-        strncpy(reg.secret, test_secret, sizeof(reg.secret) - 1);
-
-        TEST_ASSERT(strlen(reg.username) < sizeof(reg.username),
-                   "Username within bounds");
-        TEST_ASSERT(strlen(reg.secret) < sizeof(reg.secret),
-                   "Secret within bounds");
-    }
+	printf("\n=== Test: Memory Management ===\n");
+
+	/* Test 1: Registry structure allocation */
+	{
+		size_t base_size = sizeof(struct mock_http_registry);
+		size_t hostname_len = strlen("example.com") + 1;
+		size_t total_size = base_size + hostname_len;
+
+		TEST_ASSERT(total_size > base_size, "Flexible array member adds to size");
+	}
+
+	/* Test 2: String bounds checking */
+	{
+		struct mock_http_registry reg = { 0 };
+		const char *test_username = "testnode";
+		const char *test_secret = "testpassword123";
+
+		strncpy(reg.username, test_username, sizeof(reg.username) - 1);
+		strncpy(reg.secret, test_secret, sizeof(reg.secret) - 1);
+
+		TEST_ASSERT(strlen(reg.username) < sizeof(reg.username), "Username within bounds");
+		TEST_ASSERT(strlen(reg.secret) < sizeof(reg.secret), "Secret within bounds");
+	}
@@ -419,20 +380,17 @@ void test_dns_manager_integration(void)
-    printf("\n=== Test: DNS Manager Integration ===\n");
-
-    /* Test 1: Hostname validation */
-    {
-        const char *valid_hostname = "example.com";
-        const char *invalid_hostname = "";
-
-        TEST_ASSERT(strlen(valid_hostname) > 0,
-                   "Valid hostname has length");
-        TEST_ASSERT(strlen(invalid_hostname) == 0,
-                   "Empty hostname detected");
-    }
-
-    /* Test 2: Port setting */
-    {
-        int default_https_port = 443;
-
-        TEST_ASSERT(default_https_port == 443,
-                   "Default HTTPS port is 443");
-    }
+	printf("\n=== Test: DNS Manager Integration ===\n");
+
+	/* Test 1: Hostname validation */
+	{
+		const char *valid_hostname = "example.com";
+		const char *invalid_hostname = "";
+
+		TEST_ASSERT(strlen(valid_hostname) > 0, "Valid hostname has length");
+		TEST_ASSERT(strlen(invalid_hostname) == 0, "Empty hostname detected");
+	}
+
+	/* Test 2: Port setting */
+	{
+		int default_https_port = 443;
+
+		TEST_ASSERT(default_https_port == 443, "Default HTTPS port is 443");
+	}
@@ -446,31 +404,31 @@ int main(int argc, char *argv[])
-    printf("\n");
-    printf("========================================\n");
-    printf("  HTTP Registrations Unit Test Suite\n");
-    printf("========================================\n");
-
-    /* Run all test suites */
-    test_parse_register_format();
-    test_build_request_data_format();
-    test_http_response_parsing();
-    test_registration_state_management();
-    test_url_construction();
-    test_config_interval_parsing();
-    test_memory_management();
-    test_dns_manager_integration();
-
-    /* Print summary */
-    printf("\n========================================\n");
-    printf("  Test Results Summary\n");
-    printf("========================================\n");
-    printf("  Passed: %d\n", tests_passed);
-    printf("  Failed: %d\n", tests_failed);
-    printf("  Total:  %d\n", tests_passed + tests_failed);
-    printf("========================================\n\n");
-
-    if (tests_failed > 0) {
-        printf("RESULT: FAILED\n\n");
-        return 1;
-    } else {
-        printf("RESULT: SUCCESS\n\n");
-        return 0;
-    }
+	printf("\n");
+	printf("========================================\n");
+	printf("  HTTP Registrations Unit Test Suite\n");
+	printf("========================================\n");
+
+	/* Run all test suites */
+	test_parse_register_format();
+	test_build_request_data_format();
+	test_http_response_parsing();
+	test_registration_state_management();
+	test_url_construction();
+	test_config_interval_parsing();
+	test_memory_management();
+	test_dns_manager_integration();
+
+	/* Print summary */
+	printf("\n========================================\n");
+	printf("  Test Results Summary\n");
+	printf("========================================\n");
+	printf("  Passed: %d\n", tests_passed);
+	printf("  Failed: %d\n", tests_failed);
+	printf("  Total:  %d\n", tests_passed + tests_failed);
+	printf("========================================\n\n");
+
+	if (tests_failed > 0) {
+		printf("RESULT: FAILED\n\n");
+		return 1;
+	} else {
+		printf("RESULT: SUCCESS\n\n");
+		return 0;
+	}

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review February 4, 2026 15:34

outdated suggestion

@mkmer mkmer marked this pull request as draft February 4, 2026 17:15
@mkmer mkmer force-pushed the coderabbitai/utg/c167f8c branch from 4dc041e to b69cbaa Compare February 5, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant