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