Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/librt fix priority tests for SCHED_OTHER



details:   https://anonhg.NetBSD.org/src/rev/70b2ee63eb6a
branches:  trunk
changeset: 828657:70b2ee63eb6a
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 24 17:37:23 2017 +0000

description:
fix priority tests for SCHED_OTHER

diffstat:

 tests/lib/librt/t_sched.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r 08107d724fd2 -r 70b2ee63eb6a tests/lib/librt/t_sched.c
--- a/tests/lib/librt/t_sched.c Sun Dec 24 16:16:30 2017 +0000
+++ b/tests/lib/librt/t_sched.c Sun Dec 24 17:37:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sched.c,v 1.5 2012/03/25 04:11:42 christos Exp $ */
+/* $NetBSD: t_sched.c,v 1.6 2017/12/24 17:37:23 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,8 +29,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sched.c,v 1.5 2012/03/25 04:11:42 christos Exp $");
+__RCSID("$NetBSD: t_sched.c,v 1.6 2017/12/24 17:37:23 christos Exp $");
 
+#include <sys/param.h> /* PRI_NONE */
 #include <sched.h>
 #include <limits.h>
 #include <unistd.h>
@@ -94,10 +95,14 @@
 
                pmax = sched_get_priority_max(pol[i]);
                pmin = sched_get_priority_min(pol[i]);
-
-               ATF_REQUIRE(pmax != -1);
-               ATF_REQUIRE(pmin != -1);
-               ATF_REQUIRE(pmax > pmin);
+               if (pol[i] == SCHED_OTHER) {
+                       ATF_REQUIRE(pmax == PRI_NONE);
+                       ATF_REQUIRE(pmin == PRI_NONE);
+               } else {
+                       ATF_REQUIRE(pmax != -1);
+                       ATF_REQUIRE(pmin != -1);
+                       ATF_REQUIRE(pmax > pmin);
+               }
        }
 }
 



Home | Main Index | Thread Index | Old Index