aboutsummaryrefslogtreecommitdiff
path: root/tests/test-loader.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-01-16 03:59:29 +0100
committerTed Gould <ted@gould.cx>2012-01-16 03:59:29 +0100
commit6a0f41aaa53cb79e03520a8214cc2c9305821496 (patch)
tree42ca4612dbc583426b4e476fa054979829c93495 /tests/test-loader.c
parentf898563b6eaff8a00dd0cc2f7adabed16b80b698 (diff)
downloadlibayatana-indicator-6a0f41aaa53cb79e03520a8214cc2c9305821496.tar.gz
libayatana-indicator-6a0f41aaa53cb79e03520a8214cc2c9305821496.tar.bz2
libayatana-indicator-6a0f41aaa53cb79e03520a8214cc2c9305821496.zip
Moving the function into the tester to making linking simpler
Diffstat (limited to 'tests/test-loader.c')
-rw-r--r--tests/test-loader.c23
1 files changed, 21 insertions, 2 deletions
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
@@ -26,6 +26,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)
{
IndicatorObject * object = indicator_object_new_from_file(BUILD_DIR "/.libs/libdummy-indicator-entry-func.so");
@@ -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);