summaryrefslogtreecommitdiff
path: root/src/test/test-libudev.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-10-27 20:59:01 +0200
committerKay Sievers <kay@vrfy.org>2012-10-27 23:39:41 +0200
commit2001208c2ab631a69896d1f670c26846b70d1fb7 (patch)
treebe11475c8b6784a9b9dd0438a8c11984d2e76825 /src/test/test-libudev.c
parent19e65613563dd9c14cf1ce58aa6e151de8fb90c2 (diff)
libudev: import hwdb and export lookup interface
Diffstat (limited to 'src/test/test-libudev.c')
-rw-r--r--src/test/test-libudev.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c
index 481ce65dbf..b89d900121 100644
--- a/src/test/test-libudev.c
+++ b/src/test/test-libudev.c
@@ -421,6 +421,20 @@ static int test_enumerate(struct udev *udev, const char *subsystem)
return 0;
}
+static int test_hwdb(struct udev *udev, const char *modalias) {
+ struct udev_hwdb * hwdb;
+ struct udev_list_entry *entry;
+
+ hwdb = udev_hwdb_new(udev);
+
+ udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, modalias, 0))
+ printf("'%s'='%s'\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
+ printf("\n");
+
+ hwdb = udev_hwdb_unref(hwdb);
+ return 0;
+}
+
int main(int argc, char *argv[])
{
struct udev *udev = NULL;
@@ -489,6 +503,8 @@ int main(int argc, char *argv[])
test_queue(udev);
+ test_hwdb(udev, "usb:v0D50p0011*");
+
test_monitor(udev);
out:
udev_unref(udev);