diff --git a/components/net/utest/tc_netdev.c b/components/net/utest/tc_netdev.c index e416e75f5fd..53f554939b4 100644 --- a/components/net/utest/tc_netdev.c +++ b/components/net/utest/tc_netdev.c @@ -50,8 +50,8 @@ static rt_bool_t initial_dhcp_enabled; /**< Initial DHCP enable status */ */ rt_err_t multiple_ping_test(struct netdev *netdev, const char *host, rt_uint32_t n) { -#define UTEST_PING_DATA_LEN 32 /* Ping data packet size */ -#define UTEST_PING_TIMEOUT (5 * RT_TICK_PER_SECOND) /* Ping timeout: 5 seconds */ +#define UTEST_PING_DATA_LEN 32 /* Ping data packet size */ +#define UTEST_PING_TIMEOUT (5 * RT_TICK_PER_SECOND) /* Ping timeout: 5 seconds */ rt_uint32_t success_num = 0, i; rt_err_t res = RT_EOK; @@ -79,21 +79,17 @@ rt_err_t multiple_ping_test(struct netdev *netdev, const char *host, rt_uint32_t * * This function tests network connectivity by pinging various targets: * - Gateway address (should succeed) - * - Invalid internal IP address (should fail) - * - External IP address (should succeed) - * - Invalid external IP address (should fail) - * - External URL (should succeed) - * - Invalid external URL (should fail) + * - Invalid host name (should fail) + * - External IP address (should succeed outside CI) + * - External URL (should succeed outside CI) * * @note This test verifies both successful and failed ping scenarios */ static void test_netdev_ping(void) { -#define UTEST_INTRANET_WRONG_IP_ADDR "192.256.0.321" /* Invalid IP format */ -#define UTEST_EXTERNAL_IP_ADDR "8.8.8.8" /* Valid external IP */ -#define UTEST_EXTERNAL_WRONG_IP_ADDR "123.456.789.012" /* Invalid IP format */ -#define UTEST_EXTERNAL_URL "www.baidu.com" /* Valid external URL */ -#define UTEST_EXTERNAL_WRONG_URL "www.abcsdd.com" /* Non-existent URL */ +#define UTEST_INVALID_HOST_NAME "" /* Rejected before DNS lookup */ +#define UTEST_EXTERNAL_IP_ADDR "8.8.8.8" /* Valid external IP */ +#define UTEST_EXTERNAL_URL "www.baidu.com" /* Valid external URL */ rt_err_t res = RT_EOK; @@ -101,25 +97,19 @@ static void test_netdev_ping(void) res = multiple_ping_test(netdev_default, inet_ntoa(netdev_default->gw), 10); uassert_true(res == RT_EOK); - /* Test ping to invalid internal IP - should fail */ - res = multiple_ping_test(netdev_default, UTEST_INTRANET_WRONG_IP_ADDR, 1); + /* Test ping with an invalid host name - should fail without a DNS query */ + res = multiple_ping_test(netdev_default, UTEST_INVALID_HOST_NAME, 1); uassert_false(res == RT_EOK); +#ifndef RT_USING_CI_ACTION /* Test ping to external IP address - should succeed */ res = multiple_ping_test(netdev_default, UTEST_EXTERNAL_IP_ADDR, 10); uassert_true(res == RT_EOK); - /* Test ping to invalid external IP - should fail */ - res = multiple_ping_test(netdev_default, UTEST_EXTERNAL_WRONG_IP_ADDR, 1); - uassert_false(res == RT_EOK); - /* Test ping to external URL - should succeed */ res = multiple_ping_test(netdev_default, UTEST_EXTERNAL_URL, 10); uassert_true(res == RT_EOK); - - /* Test ping to invalid external URL - should fail */ - res = multiple_ping_test(netdev_default, UTEST_EXTERNAL_WRONG_URL, 1); - uassert_false(res == RT_EOK); +#endif } /** @@ -170,22 +160,23 @@ static void test_netdev_netstat(void) * @brief Test DNS server configuration and hostname resolution * * This function tests: - * - Setting incorrect DNS server and verifying hostname resolution fails - * - Setting correct DNS server and verifying hostname resolution succeeds - * - DNS server configuration operations + * - Setting a DNS server and verifying the configuration + * - Rejecting an out-of-range DNS server index + * - Rejecting an invalid host name without external network access + * - Hostname resolution outside CI * * @note DNS configuration will be restored in utest_tc_cleanup */ static void test_netdev_dns(void) { -#define UTEST_DNS "114.114.114.114" /* Valid DNS server */ -#define UTEST_WRONG_DNS "13.19.123.143" /* Invalid DNS server */ -#define UTEST_WRONG_HOST_NAME "www.abcde.com" /* Test hostname */ -#define UTEST_HOST_ADDR "www.rt-thread.org" /* RT-Thread official website */ +#define UTEST_DNS "114.114.114.114" /* Valid DNS server */ +#define UTEST_INVALID_HOST "" /* Rejected before DNS lookup */ +#define UTEST_HOST_ADDR "www.rt-thread.org" /* RT-Thread official website */ - ip_addr_t ipaddr = {0}; + ip_addr_t ipaddr = { 0 }; struct hostent *res = RT_NULL; struct sal_proto_family *netdev_inet = RT_NULL; + rt_err_t err; /* Get SAL protocol family for DNS operations */ netdev_inet = netdev_default->sal_user_data; @@ -196,26 +187,25 @@ static void test_netdev_dns(void) return; } - /* Test with wrong DNS server - hostname resolution should fail */ - inet_aton(UTEST_WRONG_DNS, &ipaddr); - netdev_default->ops->set_dns_server(netdev_default, 0, &ipaddr); - netdev_default->ops->set_dns_server(netdev_default, 1, &ipaddr); - res = netdev_inet->netdb_ops->gethostbyname(UTEST_WRONG_HOST_NAME); - if (res == RT_NULL) - { - uassert_true(RT_TRUE); /* Expected failure */ - } - else - { - uassert_true(RT_FALSE); /* Unexpected success */ - } - - /* Test with correct DNS server - hostname resolution should succeed */ + /* Verify DNS server configuration without depending on a resolver response. */ inet_aton(UTEST_DNS, &ipaddr); - netdev_default->ops->set_dns_server(netdev_default, 0, &ipaddr); - netdev_default->ops->set_dns_server(netdev_default, 1, &ipaddr); + err = netdev_set_dns_server(netdev_default, 0, &ipaddr); + uassert_true(err == RT_EOK); + uassert_true(ip_addr_cmp(&netdev_default->dns_servers[0], &ipaddr)); + + /* An out-of-range DNS server index must be rejected. */ + err = netdev_set_dns_server(netdev_default, NETDEV_DNS_SERVERS_NUM, &ipaddr); + uassert_true(err == -RT_ERROR); + + /* An empty host name must be rejected locally, without a DNS query. */ + res = netdev_inet->netdb_ops->gethostbyname(UTEST_INVALID_HOST); + uassert_true(res == RT_NULL); + +#ifndef RT_USING_CI_ACTION + /* Test hostname resolution only outside CI. */ res = netdev_inet->netdb_ops->gethostbyname(UTEST_HOST_ADDR); uassert_true(res != RT_NULL); +#endif /* DNS will be restored in utest_tc_cleanup */ } @@ -275,7 +265,7 @@ static void test_netdev_dhcp(void) /* Check if IP and gateway are properly restored */ if (!ip_addr_isany(&netdev_default->ip_addr) && - !ip_addr_isany(&netdev_default->gw)) + !ip_addr_isany(&netdev_default->gw)) { rt_kprintf("Network configuration restored after %d retries\n", retry_count); rt_kprintf("Current IP: %s, Gateway: %s\n", @@ -308,9 +298,9 @@ static void test_netdev_dhcp(void) */ static void test_netdev_ifconfig_set(void) { -#define UTEST_WRONG_IP_ADDR "192.1.4.125" /* Test IP address */ -#define UTEST_HOST_ADDR "www.rt-thread.org" /* Test hostname */ -#define UTEST_WRONG_GW_IP_ADDR "192.168.99.1" /* Test gateway address */ +#define UTEST_WRONG_IP_ADDR "192.1.4.125" /* Test IP address */ +#define UTEST_HOST_ADDR "www.rt-thread.org" /* Test hostname */ +#define UTEST_WRONG_GW_IP_ADDR "192.168.99.1" /* Test gateway address */ ip_addr_t ipaddr, true_ipaddr; rt_err_t res = RT_EOK; @@ -406,9 +396,9 @@ static void test_netdev_set_default_netdev(void) */ static void test_netdev_ipaddr_conversion(void) { -#define UTEST_IP4_ADDR_STR "192.168.1.1" /* Valid IPv4 address */ -#define UTEST_IP4_ADDR_STR2 "10.0.0.1" /* Another valid IPv4 address */ -#define UTEST_INVALID_IP_STR "999.999.999.999" /* Invalid IPv4 address */ +#define UTEST_IP4_ADDR_STR "192.168.1.1" /* Valid IPv4 address */ +#define UTEST_IP4_ADDR_STR2 "10.0.0.1" /* Another valid IPv4 address */ +#define UTEST_INVALID_IP_STR "999.999.999.999" /* Invalid IPv4 address */ ip4_addr_t ip4_addr; char buf[16]; /* Maximum length for IPv4 string representation */ @@ -584,7 +574,7 @@ static void test_netdev_config_set(void) ip_addr_t original_netmask = netdev_default->netmask; ip_addr_t original_dns0 = netdev_default->dns_servers[0]; ip_addr_t original_dns1 = netdev_default->dns_servers[1]; - ip_addr_t test_netmask = {0}, test_dns = {0}; + ip_addr_t test_netmask = { 0 }, test_dns = { 0 }; rt_err_t res; /* Test set_netmask */ @@ -1064,19 +1054,24 @@ static rt_err_t utest_tc_cleanup(void) /* Restore network configuration */ res = netdev_set_ipaddr(netdev_default, &initial_ip_addr); - if (res != RT_EOK) rt_kprintf("Warning: Failed to restore IP address: %d\n", res); + if (res != RT_EOK) + rt_kprintf("Warning: Failed to restore IP address: %d\n", res); res = netdev_set_netmask(netdev_default, &initial_netmask); - if (res != RT_EOK) rt_kprintf("Warning: Failed to restore netmask: %d\n", res); + if (res != RT_EOK) + rt_kprintf("Warning: Failed to restore netmask: %d\n", res); res = netdev_set_gw(netdev_default, &initial_gw); - if (res != RT_EOK) rt_kprintf("Warning: Failed to restore gateway: %d\n", res); + if (res != RT_EOK) + rt_kprintf("Warning: Failed to restore gateway: %d\n", res); res = netdev_set_dns_server(netdev_default, 0, &initial_dns0); - if (res != RT_EOK) rt_kprintf("Warning: Failed to restore DNS0: %d\n", res); + if (res != RT_EOK) + rt_kprintf("Warning: Failed to restore DNS0: %d\n", res); res = netdev_set_dns_server(netdev_default, 1, &initial_dns1); - if (res != RT_EOK) rt_kprintf("Warning: Failed to restore DNS1: %d\n", res); + if (res != RT_EOK) + rt_kprintf("Warning: Failed to restore DNS1: %d\n", res); /* Restore DHCP state */ if (initial_dhcp_enabled) diff --git a/components/utilities/utest/utest.c b/components/utilities/utest/utest.c index f215b01ecc8..f9f80fdff92 100644 --- a/components/utilities/utest/utest.c +++ b/components/utilities/utest/utest.c @@ -14,15 +14,15 @@ #include "utest.h" #include "utest_log.h" -#define DBG_TAG "utest" +#define DBG_TAG "utest" #ifdef UTEST_DEBUG -#define DBG_LVL DBG_LOG +#define DBG_LVL DBG_LOG #else -#define DBG_LVL DBG_INFO +#define DBG_LVL DBG_INFO #endif #include -#if RT_CONSOLEBUF_SIZE < 256 +#if defined(RT_CONSOLEBUF_SIZE) && RT_CONSOLEBUF_SIZE < 256 #error "RT_CONSOLEBUF_SIZE is less than 256!" #endif @@ -33,9 +33,9 @@ #endif #ifdef UTEST_THR_PRIORITY -#define UTEST_THREAD_PRIORITY UTEST_THR_PRIORITY +#define UTEST_THREAD_PRIORITY UTEST_THR_PRIORITY #else -#define UTEST_THREAD_PRIORITY FINSH_THREAD_PRIORITY +#define UTEST_THREAD_PRIORITY FINSH_THREAD_PRIORITY #endif static rt_uint8_t utest_log_lv = UTEST_LOG_ALL; @@ -43,27 +43,25 @@ static utest_tc_export_t tc_table = RT_NULL; static rt_size_t tc_num; static rt_uint32_t tc_loop; static rt_uint8_t *tc_fail_list; -static struct utest local_utest = {UTEST_PASSED, 0, 0}; +static struct utest local_utest = { UTEST_PASSED, 0, 0 }; #if defined(__ICCARM__) || defined(__ICCRX__) /* for IAR compiler */ -#pragma section="UtestTcTab" +#pragma section = "UtestTcTab" #elif defined(_MSC_VER) #pragma section("UtestTcTab$a", read) -__declspec(allocate("UtestTcTab$a")) const struct utest_tc_export __tc_export_begin = -{ +__declspec(allocate("UtestTcTab$a")) const struct utest_tc_export __tc_export_begin = { "__start", }; #pragma section("UtestTcTab$z", read) -__declspec(allocate("UtestTcTab$z")) const struct utest_tc_export __tc_export_end = -{ +__declspec(allocate("UtestTcTab$z")) const struct utest_tc_export __tc_export_end = { "__end", }; #endif -#define TC_FAIL_LIST_SIZE (RT_ALIGN(tc_num, 8) / 8) -#define TC_FAIL_LIST_MARK_FAILED(index) (tc_fail_list[index / 8] |= (1UL << (index % 8))) -#define TC_FAIL_LIST_IS_FAILED(index) (tc_fail_list[index / 8] & (1UL << (index % 8))) +#define TC_FAIL_LIST_SIZE (RT_ALIGN(tc_num, 8) / 8) +#define TC_FAIL_LIST_MARK_FAILED(index) (tc_fail_list[index / 8] |= (1UL << (index % 8))) +#define TC_FAIL_LIST_IS_FAILED(index) (tc_fail_list[index / 8] & (1UL << (index % 8))) void utest_log_lv_set(rt_uint8_t lv) { @@ -108,8 +106,9 @@ int utest_init(void) extern const int UtestTcTab$$Base; extern const int UtestTcTab$$Limit; tc_table = (utest_tc_export_t)&UtestTcTab$$Base; + // cppcheck-suppress subtractPointers tc_num = (utest_tc_export_t)&UtestTcTab$$Limit - tc_table; -#elif defined (__ICCARM__) || defined(__ICCRX__) /* for IAR Compiler */ +#elif defined(__ICCARM__) || defined(__ICCRX__) /* for IAR Compiler */ tc_table = (utest_tc_export_t)__section_begin("UtestTcTab"); tc_num = (utest_tc_export_t)__section_end("UtestTcTab") - tc_table; #else @@ -124,21 +123,26 @@ int utest_init(void) ptr_end = (unsigned int *)&__tc_export_end; ptr_begin += (sizeof(struct utest_tc_export) / sizeof(unsigned int)); #endif - while (*ptr_begin == 0) ptr_begin++; +#if defined(__GNUC__) || defined(_MSC_VER) + while (*ptr_begin == 0) + ptr_begin++; ptr_end--; - while (*ptr_end == 0) ptr_end--; + while (*ptr_end == 0) + ptr_end--; /* copy tc_table from rodata section to ram */ for (unsigned int *ptr = ptr_begin; ptr < ptr_end;) { if (!tc_table) tc_table = (utest_tc_export_t)rt_malloc(sizeof(struct utest_tc_export)); else - tc_table = (utest_tc_export_t)rt_realloc(tc_table, (tc_num + 1)* sizeof(struct utest_tc_export)); + tc_table = (utest_tc_export_t)rt_realloc(tc_table, (tc_num + 1) * sizeof(struct utest_tc_export)); RT_ASSERT(tc_table); tc_table[tc_num++] = *((utest_tc_export_t)ptr); ptr += (sizeof(struct utest_tc_export) / sizeof(unsigned int)); - while (*ptr == 0) ptr++; + while (*ptr == 0) + ptr++; } +#endif #endif LOG_I("utest is initialize success."); @@ -146,7 +150,7 @@ int utest_init(void) if (tc_num > 0) { tc_fail_list = rt_malloc(TC_FAIL_LIST_SIZE); - if(!tc_fail_list) + if (!tc_fail_list) { LOG_E("no memory, tc_fail_list init failed!"); } @@ -178,8 +182,8 @@ static const char *file_basename(const char *file) char *end_ptr = RT_NULL; char *rst = RT_NULL; - if (!((end_ptr = strrchr(file, '\\')) != RT_NULL || \ - (end_ptr = strrchr(file, '/')) != RT_NULL) || \ + if (!((end_ptr = strrchr(file, '\\')) != RT_NULL || + (end_ptr = strrchr(file, '/')) != RT_NULL) || (rt_strlen(file) < 2)) { rst = (char *)file; @@ -226,7 +230,7 @@ static void utest_do_run(const char *utest_name) rt_uint32_t tc_fail_num = 0; rt_uint32_t tc_run_num = 0; - for (index = 0; index < tc_loop; index ++) + for (index = 0; index < tc_loop; index++) { i = 0; is_find = RT_FALSE; @@ -240,7 +244,7 @@ static void utest_do_run(const char *utest_name) LOG_I("[==========] [ utest ] loop %d/%d", index + 1, tc_loop); LOG_I("[==========] [ utest ] started"); - while(i < tc_num) + while (i < tc_num) { if (utest_name) { @@ -270,7 +274,7 @@ static void utest_do_run(const char *utest_name) if (tc_table[i].init() != RT_EOK) { TC_FAIL_LIST_MARK_FAILED(i); - tc_fail_num ++; + tc_fail_num++; tc_failed = RT_TRUE; LOG_E("[ FAILED ] [ result ] testcase init (%s)", tc_table[i].name); goto __tc_continue; @@ -279,6 +283,10 @@ static void utest_do_run(const char *utest_name) if (tc_table[i].tc != RT_NULL) { + local_utest.error = UTEST_PASSED; + local_utest.passed_num = 0; + local_utest.failed_num = 0; + tc_table[i].tc(); if (local_utest.failed_num == 0) { @@ -287,7 +295,7 @@ static void utest_do_run(const char *utest_name) else { TC_FAIL_LIST_MARK_FAILED(i); - tc_fail_num ++; + tc_fail_num++; tc_failed = RT_TRUE; LOG_E("[ FAILED ] [ result ] testcase (%s)", tc_table[i].name); } @@ -295,7 +303,7 @@ static void utest_do_run(const char *utest_name) else { TC_FAIL_LIST_MARK_FAILED(i); - tc_fail_num ++; + tc_fail_num++; tc_failed = RT_TRUE; LOG_E("[ FAILED ] [ result ] testcase (%s)", tc_table[i].name); } @@ -307,17 +315,17 @@ static void utest_do_run(const char *utest_name) if (tc_failed == RT_FALSE) { TC_FAIL_LIST_MARK_FAILED(i); - tc_fail_num ++; + tc_fail_num++; } LOG_E("[ FAILED ] [ result ] testcase cleanup (%s)", tc_table[i].name); goto __tc_continue; } } - __tc_continue: + __tc_continue: LOG_I("[----------] [ testcase ] (%s) finished", tc_table[i].name); - tc_run_num ++; + tc_run_num++; i++; } @@ -331,10 +339,10 @@ static void utest_do_run(const char *utest_name) LOG_I("[==========] [ utest ] %d tests from %d testcase ran.", tc_run_num, tc_num); LOG_I("[ PASSED ] [ result ] %d tests.", tc_run_num - tc_fail_num); - if(tc_fail_list && (tc_fail_num > 0)) + if (tc_fail_list && (tc_fail_num > 0)) { LOG_E("[ FAILED ] [ result ] %d tests, listed below:", tc_fail_num); - for(i = 0; i < tc_num; i ++) + for (i = 0; i < tc_num; i++) { if (TC_FAIL_LIST_IS_FAILED(i)) { @@ -377,7 +385,7 @@ static int utest_auto_run(void) INIT_APP_EXPORT(utest_auto_run); #endif /* RT_UTEST_USING_AUTO_RUN */ -int utest_testcase_run(int argc, char** argv) +int utest_testcase_run(int argc, char **argv) { static char utest_name[UTEST_NAME_MAX_LEN]; rt_memset(utest_name, 0x0, sizeof(utest_name)); @@ -394,7 +402,7 @@ int utest_testcase_run(int argc, char** argv) { if (argc == 3 || argc == 4) { - rt_strncpy(utest_name, argv[2], sizeof(utest_name) -1); + rt_strncpy(utest_name, argv[2], sizeof(utest_name) - 1); if (argc == 4) { tc_loop = atoi(argv[3]); @@ -408,7 +416,7 @@ int utest_testcase_run(int argc, char** argv) } else { - rt_strncpy(utest_name, argv[1], sizeof(utest_name) -1); + rt_strncpy(utest_name, argv[1], sizeof(utest_name) - 1); if (argc == 3) { tc_loop = atoi(argv[2]); @@ -424,7 +432,7 @@ int utest_testcase_run(int argc, char** argv) return RT_EOK; } -MSH_CMD_EXPORT_ALIAS(utest_testcase_run, utest_run, utest_run [-thread or -help] [testcase name] [loop num], optenable); +MSH_CMD_EXPORT_ALIAS(utest_testcase_run, utest_run, utest_run[-thread or -help][testcase name][loop num], optenable); utest_t utest_handle_get(void) { @@ -433,6 +441,9 @@ utest_t utest_handle_get(void) void utest_unit_run(test_unit_func func, const char *unit_func_name) { + rt_uint32_t passed_num = local_utest.passed_num; + rt_uint32_t failed_num = local_utest.failed_num; + LOG_I("[==========] utest unit name: (%s)", unit_func_name); local_utest.error = UTEST_PASSED; local_utest.passed_num = 0; @@ -442,6 +453,16 @@ void utest_unit_run(test_unit_func func, const char *unit_func_name) { func(); } + + passed_num += local_utest.passed_num; + failed_num += local_utest.failed_num; + + local_utest.passed_num = passed_num; + local_utest.failed_num = failed_num; + if (local_utest.failed_num != 0) + { + local_utest.error = UTEST_FAILED; + } } /* @@ -462,7 +483,7 @@ rt_bool_t utest_assert(int value, const char *file, int line, const char *func, if (!(value)) { local_utest.error = UTEST_FAILED; - local_utest.failed_num ++; + local_utest.failed_num++; LOG_E("[ ASSERT ] [ unit ] at (%s); func: (%s:%d); msg: (%s)", file_basename(file), func, line, msg); rst = RT_FALSE; } @@ -473,7 +494,7 @@ rt_bool_t utest_assert(int value, const char *file, int line, const char *func, LOG_D("[ OK ] [ unit ] (%s:%d) is passed", func, line); } local_utest.error = UTEST_PASSED; - local_utest.passed_num ++; + local_utest.passed_num++; rst = RT_TRUE; } diff --git a/src/utest/signal_tc.c b/src/utest/signal_tc.c index eb7001e49e0..7ace71d6034 100644 --- a/src/utest/signal_tc.c +++ b/src/utest/signal_tc.c @@ -134,6 +134,12 @@ static volatile int receive_sig = 0; static struct rt_semaphore _received_signal; +#ifdef RT_USING_MUSLLIBC +#define UTEST_SIGNAL_MIN 1 +#else +#define UTEST_SIGNAL_MIN 0 +#endif + void sig_handle_default(int signo) { receive_sig = signo; @@ -145,7 +151,7 @@ static void rt_signal_install_test(void) rt_sighandler_t result; /* case 1:rt_signal_install, install all available signal. */ - for (signo = 0; signo < RT_SIG_MAX; signo++) + for (signo = UTEST_SIGNAL_MIN; signo < RT_SIG_MAX; signo++) { result = rt_signal_install(signo, sig_handle_default); uassert_true(result != SIG_ERR); @@ -163,7 +169,7 @@ static void rt_signal_unmask_test(void) rt_sighandler_t result; /* case 3:rt_signal_mask/unmask, one thread self, install and unmask, then kill, should received. */ - for (signo = 0; signo < RT_SIG_MAX; signo++) + for (signo = UTEST_SIGNAL_MIN; signo < RT_SIG_MAX; signo++) { receive_sig = -1; result = rt_signal_install(signo, sig_handle_default); @@ -183,7 +189,7 @@ static void rt_signal_mask_test(void) rt_sighandler_t result; /* case 4:rt_signal_mask/unmask, one thread self, install and unmask and mask, then kill, should can't received. */ - for (signo = 0; signo < RT_SIG_MAX; signo++) + for (signo = UTEST_SIGNAL_MIN; signo < RT_SIG_MAX; signo++) { receive_sig = -1; result = rt_signal_install(signo, sig_handle_default); @@ -206,7 +212,7 @@ static void rt_signal_kill_test(void) rt_sighandler_t result; /* case 7:rt_signal_kill, kill legal thread, return 0; */ - for (signo = 0; signo < RT_SIG_MAX; signo++) + for (signo = UTEST_SIGNAL_MIN; signo < RT_SIG_MAX; signo++) { receive_sig = -1; result = rt_signal_install(signo, sig_handle_default);