Workaround nice test hit the ceiling

This commit is contained in:
Wildan M
2026-05-09 05:48:45 +07:00
parent e9c3960c65
commit c15059e205
+2 -13
View File
@@ -4,10 +4,6 @@
#include "test_helpers.h"
int main(void) {
// XXX: in linux sometimes the start prio is random
int s1 = setpriority(PRIO_PROCESS, 0, 0);
ERROR_IF(setpriority, s1, == -1);
errno = 0;
int p1 = getpriority(PRIO_PROCESS, 0);
ERROR_IF(getpriority, errno, != 0);
@@ -19,16 +15,9 @@ int main(void) {
errno = 0;
int p2 = getpriority(PRIO_PROCESS, 0);
ERROR_IF(getpriority, errno, != 0);
UNEXP_IF(nice, p2, != p1 + 5);
// XXX: in linux sometimes the start prio is random
UNEXP_IF(nice, p2, != p1 + 5 && p2 != 19);
UNEXP_IF(nice, n1, != p2);
int s2 = setpriority(PRIO_PROCESS, 0, 15);
ERROR_IF(setpriority, s2, == -1);
errno = 0;
int p3 = getpriority(PRIO_PROCESS, 0);
ERROR_IF(getpriority, errno, != 0);
UNEXP_IF(getpriority, p3, != 15);
return 0;
}