From 6a0f41aaa53cb79e03520a8214cc2c9305821496 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Jan 2012 03:59:29 +0100 Subject: Moving the function into the tester to making linking simpler --- tests/test-loader.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'tests/test-loader.c') diff --git a/tests/test-loader.c b/tests/test-loader.c index 48537c0..2e9cf55 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -25,6 +25,25 @@ License along with this library. If not, see #include "dummy-indicator-entry-func.h" +void +entry_func_swap (IndicatorObject * io) +{ + static void (*saved_func) (IndicatorObject * io, IndicatorObjectEntry * entry, guint windowid, guint timestamp) = NULL; + IndicatorObjectClass * klass = INDICATOR_OBJECT_GET_CLASS(io); + + if (saved_func == NULL) { + saved_func = klass->entry_activate_window; + } + + if (klass->entry_activate_window == NULL) { + klass->entry_activate_window = saved_func; + } else { + klass->entry_activate_window = NULL; + } + + return; +} + void test_loader_entry_func_window (void) { @@ -37,11 +56,11 @@ test_loader_entry_func_window (void) entryfunc->entry_activate_window_called = FALSE; entryfunc->entry_close_called = FALSE; - dummy_indicator_entry_func_support_window(entryfunc, FALSE); + entry_func_swap(object); indicator_object_entry_activate_window(object, NULL, 0, 0); g_assert(entryfunc->entry_activate_called); - dummy_indicator_entry_func_support_window(entryfunc, TRUE); + entry_func_swap(object); indicator_object_entry_activate_window(object, NULL, 0, 0); g_assert(entryfunc->entry_activate_window_called); -- cgit v1.2.3