Source-Changes-HG archive

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

[src/trunk]: src/tests/sys/uvm Fixed the build failures caused by incompatibl...



details:   https://anonhg.NetBSD.org/src/rev/1774c25aa61c
branches:  trunk
changeset: 446766:1774c25aa61c
user:      fox <fox%NetBSD.org@localhost>
date:      Tue Dec 18 07:11:35 2018 +0000

description:
Fixed the build failures caused by incompatible type comparisons.

Reviewed by <cherry>

diffstat:

 tests/sys/uvm/t_uvm_physseg.c |  19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r e955f926c0c9 -r 1774c25aa61c tests/sys/uvm/t_uvm_physseg.c
--- a/tests/sys/uvm/t_uvm_physseg.c     Mon Dec 17 20:13:46 2018 +0000
+++ b/tests/sys/uvm/t_uvm_physseg.c     Tue Dec 18 07:11:35 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_uvm_physseg.c,v 1.3 2018/02/08 09:05:20 dholland Exp $ */
+/* $NetBSD: t_uvm_physseg.c,v 1.4 2018/12/18 07:11:35 fox Exp $ */
 
 /*-
  * Copyright (c) 2015, 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_uvm_physseg.c,v 1.3 2018/02/08 09:05:20 dholland Exp $");
+__RCSID("$NetBSD: t_uvm_physseg.c,v 1.4 2018/12/18 07:11:35 fox Exp $");
 
 /*
  * If this line is commented out tests related to uvm_physseg_get_pmseg()
@@ -271,6 +271,11 @@
 #endif
 
 /*
+ * This macro was added to convert uvmexp.npages from int to psize_t
+ */
+#define INT_TO_PSIZE_T(X) (psize_t)X
+
+/*
  * Test Fixture SetUp().
  */
 static void
@@ -498,7 +503,7 @@
 #if VM_PHYSSEG_MAX > 2
            + npages2
 #endif
-           , uvmexp.npages);
+           , INT_TO_PSIZE_T(uvmexp.npages));
 #if VM_PHYSSEG_MAX > 1
        /* Scavenge plug - goes into the same slab */
        ATF_REQUIRE_EQ(uvm_physseg_plug(VALID_START_PFN_3, npages3, &upm3), true);
@@ -706,7 +711,7 @@
        /* Should return a valid handle */
        ATF_REQUIRE(uvm_physseg_valid_p(upm));
 
-       ATF_REQUIRE_EQ(npages1 + npages2, uvmexp.npages);
+       ATF_REQUIRE_EQ(npages1 + npages2, INT_TO_PSIZE_T(uvmexp.npages));
 
        /* After the second call two segments should exist */
        ATF_CHECK_EQ(2, uvm_physseg_get_entries());
@@ -889,7 +894,7 @@
 
        uvm_physseg_init_seg(PHYSSEG_NODE_TO_HANDLE(seg), pgs);
 
-       ATF_REQUIRE_EQ(npages, uvmexp.npages);
+       ATF_REQUIRE_EQ(npages, INT_TO_PSIZE_T(uvmexp.npages));
 }
 
 #if 0
@@ -2279,7 +2284,11 @@
        upm = uvm_physseg_find(VALID_AVAIL_END_PFN_1 - 1, NULL);
 
        /* It should no longer exist */
+#if defined(UVM_HOTPLUG)
        ATF_CHECK_EQ(NULL, upm);
+#else
+       ATF_CHECK_EQ(-1, upm);
+#endif
 
        ATF_CHECK_EQ(1, uvm_physseg_get_entries());
 }



Home | Main Index | Thread Index | Old Index