summaryrefslogtreecommitdiff
path: root/tests/test-gphoto2.c
diff options
context:
space:
mode:
authorLutz Mueller <lutz@users.sourceforge.net>2001-08-17 22:35:50 +0000
committerLutz Mueller <lutz@users.sourceforge.net>2001-08-17 22:35:50 +0000
commitf2bc06c8d507a358c8f0c93248adf05275a32ed5 (patch)
tree5084dfc561013c2298e39eca729960fe99394542 /tests/test-gphoto2.c
parent6bfaabb22a02d07336b2ebe5977637a5fc82e22c (diff)
downloadlibgphoto2-f2bc06c8d507a358c8f0c93248adf05275a32ed5.tar.gz
2001-08-17 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* tests/*: New * configure.in: * Makefile.am: Add tests to SUBDIRS and generate the Makefile * frontents/command-line/test.[c,h]: Removed * frontends/command-line/main.c: * frontents/command-line/Makefile.am: Reflect changes git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@1999 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'tests/test-gphoto2.c')
-rw-r--r--tests/test-gphoto2.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test-gphoto2.c b/tests/test-gphoto2.c
new file mode 100644
index 000000000..1c10dcd16
--- /dev/null
+++ b/tests/test-gphoto2.c
@@ -0,0 +1,31 @@
+#include <gphoto2.h>
+#include <stdio.h>
+
+#define CHECK(f) {int res = f; if (res < 0) {printf ("ERROR: %s\n", gp_result_as_string (res)); exit (1);}}
+
+int
+main (int argc, char *argv [])
+{
+ CameraText text;
+ Camera *camera;
+
+ printf ("Initializing gphoto2...\n");
+ CHECK (gp_init (GP_DEBUG_NONE));
+
+ printf ("Creating camera...\n");
+ CHECK (gp_camera_new (&camera));
+
+ strcpy (camera->model, "Directory Browse");
+
+ printf ("Initializing camera...\n");
+ CHECK (gp_camera_init (camera));
+
+ printf ("Getting summary...\n");
+ CHECK (gp_camera_get_summary (camera, &text));
+ printf ("%s\n", text.text);
+
+ printf ("Unrefing camera...\n");
+ CHECK (gp_camera_unref (camera));
+
+ return (0);
+}