Source-Changes-HG archive

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

[src/netbsd-8]: src/tests/lib/librt Additionally pull up the following, reque...



details:   https://anonhg.NetBSD.org/src/rev/3b15429b50b9
branches:  netbsd-8
changeset: 320509:3b15429b50b9
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jul 10 15:06:25 2018 +0000

description:
Additionally pull up the following, requested by maya in ticket #892:

        src/tests/lib/librt/t_sched.c   1.6

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 4a1a784e2f11 -r 3b15429b50b9 tests/lib/librt/t_sched.c
--- a/tests/lib/librt/t_sched.c Tue Jul 10 14:44:05 2018 +0000
+++ b/tests/lib/librt/t_sched.c Tue Jul 10 15:06:25 2018 +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.5.24.1 2018/07/10 15:06:25 martin 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.5.24.1 2018/07/10 15:06:25 martin 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