"simple cache" testcase: fail on cache device lookup
authorNathan Lynch <ntl@pobox.com>
Tue, 21 Oct 2008 11:38:30 +0000 (06:38 -0500)
committerNathan Lynch <ntl@pobox.com>
Tue, 21 Oct 2008 11:38:30 +0000 (06:38 -0500)
Nicer than a segfault in the next API call.

tests/simple_cache.c

index 0b34c643ec58991726920212a98d423f848b4438..dcc79f4761fa912249d739443dfed298dac1bbbc 100644 (file)
@@ -37,6 +37,7 @@
        /* we know there is only one thread, one cache */
        ent = topology_traverse(sys, (topo_procent_t)0, TOPOLOGY_THREAD);
        dev = topology_find_device_by_type(ctx, (topo_device_t)0, "cache");
+       fail_on(dev == 0);
        topology_device_cpumask(dev, cpumask);
        fail_on(!CPU_ISSET_S(0, size, cpumask));
        fail_on(CPU_COUNT_S(size, cpumask) != 1);