diff options
author | Elliott Hughes <enh@google.com> | 2014-04-30 18:30:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-30 18:30:15 +0000 |
commit | 9fb53dd4dbaa7633c234d9da8417827fa3d3c32f (patch) | |
tree | cb07fe1df9a3d92e78366a5ef38299dfd042d3a5 /tests | |
parent | 2ae3f60ca37ce01beba748bb6ffd02401a543721 (diff) | |
parent | 0990d4fda898ada86e557f872f5cb7d16b138e3c (diff) | |
download | bionic-9fb53dd4dbaa7633c234d9da8417827fa3d3c32f.zip bionic-9fb53dd4dbaa7633c234d9da8417827fa3d3c32f.tar.gz bionic-9fb53dd4dbaa7633c234d9da8417827fa3d3c32f.tar.bz2 |
Merge "Make SIGRTMIN hide the real-time signals we use internally."
Diffstat (limited to 'tests')
-rw-r--r-- | tests/signal_test.cpp | 18 | ||||
-rw-r--r-- | tests/string_test.cpp | 8 |
2 files changed, 21 insertions, 5 deletions
diff --git a/tests/signal_test.cpp b/tests/signal_test.cpp index 6d55bef..af98964 100644 --- a/tests/signal_test.cpp +++ b/tests/signal_test.cpp @@ -252,3 +252,21 @@ TEST(signal, sys_siglist) { ASSERT_TRUE(sys_siglist[0] == NULL); ASSERT_STREQ("Hangup", sys_siglist[SIGHUP]); } + +TEST(signal, limits) { + // This comes from the kernel. + ASSERT_EQ(32, __SIGRTMIN); + + // We reserve a non-zero number at the bottom for ourselves. + ASSERT_GT(SIGRTMIN, __SIGRTMIN); + + // MIPS has more signals than everyone else. +#if defined(__mips__) + ASSERT_EQ(128, __SIGRTMAX); +#else + ASSERT_EQ(64, __SIGRTMAX); +#endif + + // We don't currently reserve any at the top. + ASSERT_EQ(SIGRTMAX, __SIGRTMAX); +} diff --git a/tests/string_test.cpp b/tests/string_test.cpp index 14b284e..5ccc63d 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -100,11 +100,9 @@ TEST(string, strsignal) { ASSERT_STREQ("Hangup", strsignal(1)); // A real-time signal. -#ifdef __GLIBC__ // glibc reserves real-time signals for internal use, and doesn't count those. - ASSERT_STREQ("Real-time signal 14", strsignal(48)); -#else - ASSERT_STREQ("Real-time signal 16", strsignal(48)); -#endif + ASSERT_STREQ("Real-time signal 14", strsignal(SIGRTMIN + 14)); + // One of the signals the C library keeps to itself. + ASSERT_STREQ("Unknown signal 32", strsignal(__SIGRTMIN)); // Errors. ASSERT_STREQ("Unknown signal -1", strsignal(-1)); // Too small. |