diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 7 | ||||
-rw-r--r-- | tests/test-io-channel.c | 50 | ||||
-rw-r--r-- | tests/test-uri.c | 4 |
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> |