summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2009-11-16 21:44:48 -0600
committerShaun McCance <shaunm@gnome.org>2009-11-16 21:44:48 -0600
commit6c21a73a4c884d4869a367e75eb570850aa475f1 (patch)
tree36ff22eae974cf94db8e0f6ab1f684bb02f8cedf /tests
parente7c759c58158781daedf65933600ca9259a14bfa (diff)
downloadyelp-6c21a73a4c884d4869a367e75eb570850aa475f1.tar.gz
[libyelp] Adding yelp-io-channel to libyelp
This is only an internal implementation detail. I want to switch over to GIO. I'll need to create a GInputStream that automatically decodes to replace YelpIOChannel.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am7
-rw-r--r--tests/test-io-channel.c50
-rw-r--r--tests/test-uri.c4
3 files changed, 59 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d305e349..02f1d98a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,15 +6,22 @@ YELP_COMMON_CFLAGS = \
-I$(top_srcdir)/libyelp
YELP_COMMON_LDADD = \
$(YELP_LIBS) \
+ $(Z_LIBS) \
+ $(BZ_LIBS) \
+ $(LZMADEC_LIBS) \
$(top_builddir)/libyelp/libyelp.la
check_PROGRAMS = \
+ test-io-channel \
test-location-entry \
test-settings \
test-transform \
test-uri \
test-view
+test_io_channel_CFLAGS = $(YELP_COMMON_CFLAGS)
+test_io_channel_LDADD = $(YELP_COMMON_LDADD)
+
test_location_entry_CFLAGS = $(YELP_COMMON_CFLAGS)
test_location_entry_LDADD = $(YELP_COMMON_LDADD)
diff --git a/tests/test-io-channel.c b/tests/test-io-channel.c
new file mode 100644
index 00000000..f2e1dbce
--- /dev/null
+++ b/tests/test-io-channel.c
@@ -0,0 +1,50 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2009 Shaun McCance <shaunm@gnome.org
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Shaun McCance <shaunm@gnome.org
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include "yelp-io-channel.h"
+
+int
+main (int argc, char **argv)
+{
+ GIOChannel *channel;
+ gchar *str;
+ gint len;
+
+ g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
+
+ if (argc < 2) {
+ g_printerr ("Usage: test-io-channel FILE\n");
+ return 1;
+ }
+
+ channel = yelp_io_channel_new_file (argv[1], NULL);
+ g_io_channel_read_to_end (channel, &str, &len, NULL);
+ printf ("%s\n", str);
+
+ return 0;
+}
diff --git a/tests/test-uri.c b/tests/test-uri.c
index bf295f06..869d9b1c 100644
--- a/tests/test-uri.c
+++ b/tests/test-uri.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
- * Copyright (C) 2002 Mikael Hallendal <micke@imendio.com>
+ * Copyright (C) 2009 Shaun McCance <shaunm@gnome.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,7 +17,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
- * Author: Mikael Hallendal <micke@imendio.com>
+ * Author: Shaun McCance <shaunm@gnome.org>
*/
#include <config.h>