From 265c50123eb9df0b6b9fbc3b605f493333b911c4 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Tue, 12 Jul 2011 22:18:46 +0000 Subject: fix tests --- tests/Makefile | 15 +++++++++------ tests/test-command.c | 9 +++++---- tests/test-expand.c | 1 - 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 2a5e2b6..eceb7fb 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,12 +1,15 @@ -# gtk2 -REQ_PKGS += gtk+-2.0 webkit-1.0 CPPFLAGS = -I ../ -DERRORCHECK_MUTEXES -# gtk3 -#REQ_PKGS += gtk+-3.0 webkitgtk-3.0 -#CPPFLAGS = -I ../ -DERRORCHECK_MUTEXES -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED +# use GTK3-based webkit when it is available +USE_GTK3 = $(shell pkg-config --exists gtk+-3.0 webkitgtk-3.0 && echo 1) -# --- configuration ends here --- +ifeq ($(USE_GTK3),1) + REQ_PKGS += gtk+-3.0 webkitgtk-3.0 + CPPFLAGS += -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED +else + REQ_PKGS += gtk+-2.0 webkit-1.0 + CPPFLAGS += +endif REQ_PKGS += libsoup-2.4 gthread-2.0 glib-2.0 diff --git a/tests/test-command.c b/tests/test-command.c index 6b55fb3..0f0f3c1 100644 --- a/tests/test-command.c +++ b/tests/test-command.c @@ -24,6 +24,7 @@ #include #include +#include extern UzblCore uzbl; @@ -189,13 +190,13 @@ test_set_variable (struct EventFixture *ef, const void *data) { /* set a custom variable */ parse_cmd_line("set nonexistant_variable = Some Value", NULL); ASSERT_EVENT(ef, "VARIABLE_SET nonexistant_variable str 'Some Value'"); - uzbl_cmdprop *c = g_hash_table_lookup(uzbl.comm.proto_var, "nonexistant_variable"); + uzbl_cmdprop *c = g_hash_table_lookup(uzbl.behave.proto_var, "nonexistant_variable"); g_assert_cmpstr("Some Value", ==, *c->ptr.s); /* set a custom variable with expansion */ parse_cmd_line("set an_expanded_variable = Test @(echo expansion)@", NULL); ASSERT_EVENT(ef, "VARIABLE_SET an_expanded_variable str 'Test expansion'"); - c = g_hash_table_lookup(uzbl.comm.proto_var, "an_expanded_variable"); + c = g_hash_table_lookup(uzbl.behave.proto_var, "an_expanded_variable"); g_assert_cmpstr("Test expansion", ==, *c->ptr.s); } @@ -216,8 +217,8 @@ test_print (void) { void test_scroll (void) { - uzbl.gui.scbar_v = (GtkScrollbar*) gtk_vscrollbar_new (NULL); - uzbl.gui.bar_v = gtk_range_get_adjustment((GtkRange*) uzbl.gui.scbar_v); + GtkScrollbar *scbar_v = (GtkScrollbar*) gtk_vscrollbar_new (NULL); + uzbl.gui.bar_v = gtk_range_get_adjustment((GtkRange*) scbar_v); gtk_adjustment_set_lower(uzbl.gui.bar_v, 0); gtk_adjustment_set_upper(uzbl.gui.bar_v, 100); diff --git a/tests/test-expand.c b/tests/test-expand.c index d823cfa..cfcfaed 100644 --- a/tests/test-expand.c +++ b/tests/test-expand.c @@ -28,7 +28,6 @@ extern UzblCore uzbl; -extern gchar* expand(char*, guint); extern void make_var_to_name_hash(void); void -- cgit v1.2.3