aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@src.gnome.org>2008-08-04 21:30:55 +0800
committerDiego Escalante Urrelo <diegoe@src.gnome.org>2008-08-04 21:30:55 +0800
commitd0d48357cf641635b6bf09222de38059113ffb32 (patch)
tree0dea2ef14f908f9d85b252627e37b590d1c2be85 /tests
parent3c6a471e1ac91a23e98533bba0548c3a61ecc44d (diff)
downloadgsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.tar
gsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.tar.gz
gsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.tar.bz2
gsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.tar.lz
gsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.tar.xz
gsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.tar.zst
gsoc2013-epiphany-d0d48357cf641635b6bf09222de38059113ffb32.zip
Add the base for tests/ support.
Include a test for ephysearchentry, need to make them optional too. Part of #544642. svn path=/trunk/; revision=8384
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am18
-rw-r--r--tests/testephysearchentry.c53
2 files changed, 71 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 000000000..20d6a6f20
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,18 @@
+noinst_PROGRAMS = \
+ testephysearchentry
+
+testephysearchentry_SOURCES = \
+ testephysearchentry.c
+testephysearchentry_LDADD = \
+ $(top_builddir)/lib/widgets/libephywidgets.la \
+ $(DEPENDENCIES_LIBS)
+
+INCLUDES = \
+ -I$(top_builddir)/lib/widgets
+
+CFLAGS = \
+ $(DEPENDENCIES_CFLAGS) \
+ $(AM_CFLAGS)
+
+LDADD = \
+ $(DEPENDENCIES_LIBS)
diff --git a/tests/testephysearchentry.c b/tests/testephysearchentry.c
new file mode 100644
index 000000000..32bd725fe
--- /dev/null
+++ b/tests/testephysearchentry.c
@@ -0,0 +1,53 @@
+/*
+ * testephysearchentry.c
+ * This file is part of Epiphany
+ *
+ * Copyright (C) 2008 - Diego Escalante Urrelo
+ *
+ * Epiphany 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.
+ *
+ * Epiphany 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 Epiphany; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "ephy-search-entry.h"
+#include "ephy-icon-entry.h"
+#include <gtk/gtk.h>
+
+GtkWidget *entry;
+
+static void
+test_entry_clear (void)
+{
+ const char *text;
+
+ ephy_search_entry_clear (EPHY_SEARCH_ENTRY (entry));
+ text = gtk_entry_get_text (GTK_ENTRY (ephy_icon_entry_get_entry
+ (EPHY_ICON_ENTRY (entry))));
+ g_assert_cmpstr (text, ==, "");
+}
+
+int
+main (int argc, char *argv[])
+{
+ gtk_test_init (&argc, &argv);
+
+ entry = ephy_search_entry_new ();
+ gtk_entry_set_text (GTK_ENTRY (ephy_icon_entry_get_entry
+ (EPHY_ICON_ENTRY (entry))), "Test");
+
+ g_test_add_func ("/lib/widgets/ephy-search-entry/clear", test_entry_clear);
+
+ return g_test_run ();
+}