From: Lucas De Marchi Date: Thu, 9 Feb 2012 03:44:09 +0000 (-0200) Subject: test: remove test-state X-Git-Tag: v6~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abb7e4706d4e3e5c1cc378cd57dd66d70f626e2a;p=thirdparty%2Fkmod.git test: remove test-state This test is already covered by testsuite/test-loaded. --- diff --git a/test/test-state.c b/test/test-state.c deleted file mode 100644 index b34edfb6..00000000 --- a/test/test-state.c +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - - -int main(int argc, char *argv[]) -{ - const char *name; - struct kmod_ctx *ctx; - struct kmod_module *mod; - int err; - const char *state; - - if (argc < 2) { - fprintf(stderr, "Provide a module name\n"); - return EXIT_FAILURE; - } - - name = argv[1]; - - ctx = kmod_new(NULL, NULL); - if (ctx == NULL) - exit(EXIT_FAILURE); - - printf("libkmod version %s\n", VERSION); - - err = kmod_module_new_from_name(ctx, name, &mod); - if (err < 0) { - kmod_unref(ctx); - exit(EXIT_FAILURE); - } - - state = kmod_module_initstate_str(kmod_module_get_initstate(mod)); - if (state == NULL) - printf("Module '%s' not found.\n", name); - else - printf("Module '%s' is in '%s' state.\n", name, state); - - - kmod_module_unref(mod); - kmod_unref(ctx); - - return EXIT_SUCCESS; -}