diff options
author | Dan McGee <dan@archlinux.org> | 2012-02-03 20:29:10 -0600 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-02-05 02:15:35 -0200 |
commit | 6fc9458f58196de9e897aaf60b87f9795f115340 (patch) | |
tree | d7ec293a86c925560a0e3f833851f79d387fd745 | |
parent | 2ec79834a3714a7aabaed1985073001f75a9cd71 (diff) | |
download | kmod-6fc9458f58196de9e897aaf60b87f9795f115340.tar.gz kmod-6fc9458f58196de9e897aaf60b87f9795f115340.zip |
test-conversion: remove test/test-loaded
This was already converted to testsuite/test-loaded.
-rw-r--r-- | test/test-loaded.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/test/test-loaded.c b/test/test-loaded.c deleted file mode 100644 index 9d34aa3..0000000 --- a/test/test-loaded.c +++ /dev/null @@ -1,63 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <stddef.h> -#include <errno.h> -#include <unistd.h> -#include <inttypes.h> -#include <string.h> -#include <libkmod.h> - - -int main(int argc, char *argv[]) -{ - struct kmod_ctx *ctx; - const char *null_config = NULL; - struct kmod_list *list, *itr; - int err; - - ctx = kmod_new(NULL, &null_config); - if (ctx == NULL) - exit(EXIT_FAILURE); - - printf("libkmod version %s\n", VERSION); - - err = kmod_module_new_from_loaded(ctx, &list); - if (err < 0) { - fprintf(stderr, "%s\n", strerror(-err)); - kmod_unref(ctx); - exit(EXIT_FAILURE); - } - - printf("Module Size Used by\n"); - - kmod_list_foreach(itr, list) { - struct kmod_module *mod = kmod_module_get_module(itr); - const char *name = kmod_module_get_name(mod); - int use_count = kmod_module_get_refcnt(mod); - long size = kmod_module_get_size(mod); - struct kmod_list *holders, *hitr; - int first = 1; - - printf("%-19s %8ld %d ", name, size, use_count); - holders = kmod_module_get_holders(mod); - kmod_list_foreach(hitr, holders) { - struct kmod_module *hm = kmod_module_get_module(hitr); - - if (!first) - putchar(','); - else - first = 0; - - fputs(kmod_module_get_name(hm), stdout); - kmod_module_unref(hm); - } - putchar('\n'); - kmod_module_unref_list(holders); - kmod_module_unref(mod); - } - kmod_module_unref_list(list); - - kmod_unref(ctx); - - return EXIT_SUCCESS; -} |