summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2008-05-25 10:38:09 +0000
committerChristophe Fergeau <teuf@gnome.org>2008-05-25 10:38:09 +0000
commit38ea0e03d9414b955cd51f09a8e668c63f8899f9 (patch)
treed24c80f92bfb89240b81a2dcdc97a6520f7016fc /tests
parentc3e9ad30bd3e6beb2e3edc5a1a732e66ac17d0f5 (diff)
downloadlibgpod-38ea0e03d9414b955cd51f09a8e668c63f8899f9.tar.gz
libgpod-38ea0e03d9414b955cd51f09a8e668c63f8899f9.tar.xz
libgpod-38ea0e03d9414b955cd51f09a8e668c63f8899f9.zip
* configure.ac: check libxml presence
* src/Makefile.am: add new files, remove obsolete ones * src/itdb_plist.h: * src/itdb_plist.c: plist parser, this parses a plist XML file to a GHashTable of GValue *. This parser should be generic, ie it doesn't know it's parsing SysInfoExtended, it only cares about it being a plist file * src/itdb_sysinfo_extended_parser.h: * src/itdb_sysinfo_extended_parser.c: convert the parsed plist data to data structures usable by libgpod * src/itdb_device.h: * src/itdb_device.c: parses SysInfoExtended in addition to SysInfo * src/itdb_sysinfo.c: this hacky parser is obsoleted by the new (much more complete) SysInfoExtended parser, so it's removed * tests/Makefile.am: * tests/test-sysinfo-extended-parsing.c: small test program for the new parser git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1980 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/test-sysinfo-extended-parsing.c24
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 17c9cb7..f9e003b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -37,9 +37,12 @@ test_checksum_SOURCES = test-checksum.c
test_firewire_id_SOURCES = test-fw-id.c
+test_sysinfo_extended_parsing_SOURCES = test-sysinfo-extended-parsing.c
+
get_timezone_SOURCES = get-timezone.c
noinst_PROGRAMS=test-itdb test-ls test-checksum test-firewire-id \
+ test-sysinfo-extended-parsing \
$(TESTTHUMBS) $(TESTTAGLIB) $(TESTMISC)
INCLUDES=$(LIBGPOD_CFLAGS) -I$(top_srcdir)/src -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
diff --git a/tests/test-sysinfo-extended-parsing.c b/tests/test-sysinfo-extended-parsing.c
new file mode 100644
index 0000000..86731d1
--- /dev/null
+++ b/tests/test-sysinfo-extended-parsing.c
@@ -0,0 +1,24 @@
+#include "itdb_sysinfo_extended_parser.h"
+
+#include <glib.h>
+#include <glib-object.h>
+
+int main (int argc, char **argv)
+{
+ SysInfoIpodProperties *props;
+
+ if (argc != 2)
+ return(1);
+
+ g_type_init ();
+ props = itdb_sysinfo_extended_parse (argv[1]);
+ if (props == NULL) {
+ g_print ("Couldn't parse %s\n", argv[1]);
+ }
+ itdb_sysinfo_properties_dump (props);
+ itdb_sysinfo_properties_free (props);
+ props = NULL;
+
+ return 0;
+}
+