diff options
author | Hans Ulrich Niedermann <gp@n-dimensional.de> | 2006-09-18 22:38:21 +0000 |
---|---|---|
committer | Hans Ulrich Niedermann <gp@n-dimensional.de> | 2006-09-18 22:38:21 +0000 |
commit | 37431a9fcd8d2921da95c412cb7668066e9e7b9e (patch) | |
tree | 1e0d81255640b3848e883d656e7fca2cc1381955 /tests/ddb | |
parent | fa800750bc1e885ef11aefe86e5e016884ff1e44 (diff) | |
download | libgphoto2-37431a9fcd8d2921da95c412cb7668066e9e7b9e.tar.gz |
fixed/hacked a few parser/tester bugs
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9183 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'tests/ddb')
-rw-r--r-- | tests/ddb/ddb-txt.y | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/ddb/ddb-txt.y b/tests/ddb/ddb-txt.y index 06c3dc6ca..9e597e96d 100644 --- a/tests/ddb/ddb-txt.y +++ b/tests/ddb/ddb-txt.y @@ -524,6 +524,9 @@ reset_ca(void) { memset(&ca, 0, sizeof(ca)); speed_index = 0; + /* FIXME: These defaults are of dubious quality. */ + ca.usb_subclass = -1; + ca.usb_protocol = -1; } @@ -596,17 +599,23 @@ compare_camera_abilities(const CameraAbilities *a, CMP_RET_S(strcmp, library); /* CMP_RET_S(strcmp, id); */ CMP_RET_UI(uicmp, port); - for (i=0; (a->speed[i] != 0) && (a->speed[i] != 0); i++) { - CMP_RET_UI(uicmp, speed[i]); + if ((a->port & GP_PORT_SERIAL)) { + for (i=0; (a->speed[i] != 0) && (a->speed[i] != 0); i++) { + CMP_RET_UI(uicmp, speed[i]); + } } CMP_RET_UI(uicmp, operations); CMP_RET_UI(uicmp, file_operations); CMP_RET_UI(uicmp, folder_operations); - CMP_RET_UI(uicmp, usb_vendor); - CMP_RET_UI(uicmp, usb_product); - CMP_RET_UI(uicmp, usb_class); - CMP_RET_UI(uicmp, usb_subclass); - CMP_RET_UI(uicmp, usb_protocol); + if ((a->port & GP_PORT_USB)) { + CMP_RET_UI(uicmp, usb_vendor); + CMP_RET_UI(uicmp, usb_product); + CMP_RET_UI(uicmp, usb_class); + if (a->usb_class != 0) { + CMP_RET_UI(uicmp, usb_subclass); + CMP_RET_UI(uicmp, usb_protocol); + } + } CMP_RET_UI(uicmp, device_type); if (errors == 0) { return 0; |