]> git.ipfire.org Git - thirdparty/kmod.git/blobdiff - testsuite/test-dependencies.c
testsuite: improve coverage of shared/util.h
[thirdparty/kmod.git] / testsuite / test-dependencies.c
index 1dc02d1b4038721878b59df5791ddb15da994c7f..bed6ad4f3b9f46aa0ae7c5b5046f1b5ec9179ee8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012  ProFUSION embedded systems
+ * Copyright (C) 2011-2013  ProFUSION embedded systems
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
 #include <errno.h>
-#include <unistd.h>
 #include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <libkmod.h>
+#include <unistd.h>
+
+#include <shared/util.h>
+
+#include <libkmod/libkmod.h>
 
 #include "testsuite.h"
+
 #define TEST_UNAME "4.0.20-kmod"
 
 static int test_dependencies(const struct test *t)
@@ -53,11 +56,11 @@ static int test_dependencies(const struct test *t)
                struct kmod_module *m = kmod_module_get_module(l);
                const char *name = kmod_module_get_name(m);
 
-               if (strcmp(name, "crc16") == 0)
+               if (streq(name, "crc16"))
                        crc16 = 1;
-               if (strcmp(name, "mbcache") == 0)
+               if (streq(name, "mbcache"))
                        mbcache = 1;
-               else if (strcmp(name, "jbd2") == 0)
+               else if (streq(name, "jbd2"))
                        jbd2 = 1;
 
                kmod_module_unref(m);
@@ -85,9 +88,4 @@ static const struct test stest_dependencies = {
        .need_spawn = true,
 };
 
-static const struct test *tests[] = {
-       &stest_dependencies,
-       NULL,
-};
-
-TESTSUITE_MAIN(tests);
+TESTSUITE_MAIN();