naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
4fbe94
From a1ed6bfc5a8c40377b9f1cab1acc3c67a9529427 Mon Sep 17 00:00:00 2001
4fbe94
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
4fbe94
Date: Tue, 21 May 2019 09:01:34 +0200
4fbe94
Subject: [PATCH] test-cpu-set-util: add simple test for
4fbe94
 cpus_in_affinity_mask()
4fbe94
4fbe94
(cherry picked from commit 9d1345f0657c707df89b41b2738776efb40aec8e)
4fbe94
4fbe94
Related: #1734787
4fbe94
---
4fbe94
 src/test/test-cpu-set-util.c | 9 +++++++++
4fbe94
 1 file changed, 9 insertions(+)
4fbe94
4fbe94
diff --git a/src/test/test-cpu-set-util.c b/src/test/test-cpu-set-util.c
4fbe94
index b9ec29af66..e87e0ca6e6 100644
4fbe94
--- a/src/test/test-cpu-set-util.c
4fbe94
+++ b/src/test/test-cpu-set-util.c
4fbe94
@@ -157,6 +157,14 @@ static void test_parse_cpu_set(void) {
4fbe94
         cpu_set_reset(&c);
4fbe94
 }
4fbe94
 
4fbe94
+static void test_cpus_in_affinity_mask(void) {
4fbe94
+        int r;
4fbe94
+
4fbe94
+        r = cpus_in_affinity_mask();
4fbe94
+        assert(r > 0);
4fbe94
+        log_info("cpus_in_affinity_mask: %d", r);
4fbe94
+}
4fbe94
+
4fbe94
 int main(int argc, char *argv[]) {
4fbe94
         log_info("CPU_ALLOC_SIZE(1) = %zu", CPU_ALLOC_SIZE(1));
4fbe94
         log_info("CPU_ALLOC_SIZE(9) = %zu", CPU_ALLOC_SIZE(9));
4fbe94
@@ -167,6 +175,7 @@ int main(int argc, char *argv[]) {
4fbe94
         log_info("CPU_ALLOC_SIZE(8191) = %zu", CPU_ALLOC_SIZE(8191));
4fbe94
 
4fbe94
         test_parse_cpu_set();
4fbe94
+        test_cpus_in_affinity_mask();
4fbe94
 
4fbe94
         return 0;
4fbe94
 }