summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac1
-rw-r--r--tests/Makefile.am18
-rw-r--r--tests/testephysearchentry.c53
4 files changed, 73 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 322a1c69e..88dc1e818 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = lib embed src data po help doc
+SUBDIRS = lib embed src data po help doc tests
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 9d9fa9b89..42aace7ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -554,6 +554,7 @@ src/bookmarks/Makefile
src/epiphany.h
help/Makefile
po/Makefile.in
+tests/Makefile
],
[],
[EPIPHANY_API_VERSION=$EPIPHANY_API_VERSION])
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 ();
+}