1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

tst-strsignal: fix checking for RT signals support

* string/tst-strsignal.c (do_test): Actually check that RT signals are
available by comparing SIGRTMAX to SIGRTMIN. Check that SIGRTMAX is 64
before testing for a message reporting 65 for SIGRTMAX+1.
This commit is contained in:
Samuel Thibault
2020-07-07 21:24:48 +00:00
parent d63387d81d
commit 5549370a73

View File

@@ -34,10 +34,12 @@ do_test (void)
TEST_COMPARE_STRING (strsignal (SIGINT), "Interrupt"); TEST_COMPARE_STRING (strsignal (SIGINT), "Interrupt");
TEST_COMPARE_STRING (strsignal (-1), "Unknown signal -1"); TEST_COMPARE_STRING (strsignal (-1), "Unknown signal -1");
#ifdef SIGRTMIN #ifdef SIGRTMIN
TEST_COMPARE_STRING (strsignal (SIGRTMIN), "Real-time signal 0"); if (SIGRTMIN < SIGRTMAX)
TEST_COMPARE_STRING (strsignal (SIGRTMIN), "Real-time signal 0");
#endif #endif
#ifdef SIGRTMAX #ifdef SIGRTMAX
TEST_COMPARE_STRING (strsignal (SIGRTMAX+1), "Unknown signal 65"); if (SIGRTMAX == 64)
TEST_COMPARE_STRING (strsignal (SIGRTMAX+1), "Unknown signal 65");
#endif #endif
xsetlocale (LC_ALL, "pt_BR.UTF-8"); xsetlocale (LC_ALL, "pt_BR.UTF-8");
@@ -45,10 +47,12 @@ do_test (void)
TEST_COMPARE_STRING (strsignal (SIGINT), "Interrup\xc3\xa7\xc3\xa3\x6f"); TEST_COMPARE_STRING (strsignal (SIGINT), "Interrup\xc3\xa7\xc3\xa3\x6f");
TEST_COMPARE_STRING (strsignal (-1), "Sinal desconhecido -1"); TEST_COMPARE_STRING (strsignal (-1), "Sinal desconhecido -1");
#ifdef SIGRTMI #ifdef SIGRTMI
TEST_COMPARE_STRING (strsignal (SIGRTMIN), "Sinal de tempo-real 0"); if (SIGRTMIN < SIGRTMAX)
TEST_COMPARE_STRING (strsignal (SIGRTMIN), "Sinal de tempo-real 0");
#endif #endif
#ifdef SIGRTMAX #ifdef SIGRTMAX
TEST_COMPARE_STRING (strsignal (SIGRTMAX+1), "Sinal desconhecido 65"); if (SIGRTMAX == 64)
TEST_COMPARE_STRING (strsignal (SIGRTMAX+1), "Sinal desconhecido 65");
#endif #endif
return 0; return 0;