]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
dthreads: add simple check that dt_online_cpus() returns a reasonable value
authorDaniel Salzman <daniel.salzman@nic.cz>
Mon, 14 Jun 2021 13:46:19 +0000 (15:46 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Mon, 14 Jun 2021 14:18:14 +0000 (16:18 +0200)
tests/knot/test_dthreads.c

index c2c9da2c0524374ebce127dae346408c78d9b15f..3bdfa3a71893811e65aa2ee839a127c15a685e1b 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -71,7 +71,10 @@ static void interrupt_handle(int s)
 /*! API: run tests. */
 int main(int argc, char *argv[])
 {
-       plan(8);
+       plan_lazy();
+
+       int cpus = dt_online_cpus();
+       ok(cpus > 0, "dthread: online cpus is positive value");
 
        // Register service and signal handler
        struct sigaction sa;