Update of /cvsroot/libexif/libexif/test
In directory sc8-pr-cvs1:/tmp/cvs-serv21845/test
Modified Files:
Makefile.am
Added Files:
test-mnote.c
Log Message:
2003-10-26 Lutz Mueller <lu...@us...>
* test/test-mnote.c: New.
* libexif: The code now both compiles and doesn't crash,
but at least the canon maker note still doesn't get parsed.
--- NEW FILE: test-mnote.c ---
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <libexif/exif-data.h>
int
main (int argc, char **argv)
{
ExifData *d;
ExifMnoteData *md;
unsigned int c, i;
char *v;
if (argc <= 1) {
fprintf (stderr, "You need to supply a filename!\n");
return 1;
}
fprintf (stdout, "Loading '%s'...\n", argv[1]);
d = exif_data_new_from_file (argv[1]);
if (!d) {
fprintf (stderr, "Could not load data from '%s'!\n", argv[1]);
return 1;
}
fprintf (stdout, "Parsing maker note...\n");
md = exif_data_get_mnote_data (d);
if (!md) {
fprintf (stderr, "Could not parse maker note!\n");
exif_data_unref (d);
return 1;
}
c = exif_mnote_data_count (md);
for (i = 0; i < c; i++) {
fprintf (stdout, "%s", exif_mnote_data_get_name (md, i));
fprintf (stdout, " Title: %s",
exif_mnote_data_get_title (md, i));
fprintf (stdout, " Description: %s",
exif_mnote_data_get_description (md, i));
v = exif_mnote_data_get_value (md, i);
if (v) {
fprintf (stdout, " Value: '%s'", v);
free (v);
}
}
exif_data_unref (d);
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libexif/libexif/test/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Makefile.am 22 Nov 2002 16:47:56 -0000 1.7
+++ Makefile.am 26 Oct 2003 22:30:27 -0000 1.8
@@ -3,15 +3,8 @@
-I$(top_srcdir)intl \
-I$(top_srcdir)
-noinst_PROGRAMS = \
- test-mem \
- test-tree
-
-test_tree_LDADD = \
- ../libjpeg/libjpeg.la \
- ../libexif/libexif.la \
- $(INTLLIBS)
+noinst_PROGRAMS = test-mem test-tree test-mnote
-test_mem_LDADD = \
- ../libexif/libexif.la \
- $(INTLLIBS)
+test_tree_LDADD = ../libjpeg/libjpeg.la ../libexif/libexif.la $(INTLLIBS)
+test_mem_LDADD = ../libexif/libexif.la $(INTLLIBS)
+test_mnote_LDADD = ../libexif/libexif.la $(INTLLIBS)
|