From c1d9e34f74d15dfbfd68229d334f4fde0ea53541 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 19:20:18 +0000 Subject: Apply patch 0001-testutils-fix-range_is_mapped.patch patch_name: 0001-testutils-fix-range_is_mapped.patch present_in_specfile: true --- diff --git a/tests/testutils.c b/tests/testutils.c index 2b47547..ec44867 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -238,19 +238,29 @@ int range_is_mapped(unsigned long low, unsigned long high) return -1; } - if ((start >= low) && (start < high)) { + /* + * (existing mapping) (tested region) + * +----------------+ +.......+ + * ^start ^end ^ low ^high + */ + if (low >= end) { fclose(f); - return 1; + return 0; } - if ((end >= low) && (end < high)) { + + /* + * (tested region) (existing mapping) + * +.....+ +----------------+ + * ^low ^high ^ start ^end + */ + if (high <= start) { fclose(f); - return 1; + return 0; } - } fclose(f); - return 0; + return 1; } /*