Enlightenment CVS committal
Author : ningerso
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests/callback
Modified Files:
ewl_callback.c
Log Message:
Add test for clearing callbacks with custom callbacks.
Fix clearing custom callbacks which broke with fix for del_type.
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/callback/ewl_callback.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ewl_callback.c 3 Dec 2007 05:07:04 -0000 1.10
+++ ewl_callback.c 3 Dec 2007 05:41:11 -0000 1.11
@@ -34,6 +34,7 @@
static int custom_callback_test_del_multiple(char *buf, int len);
static int custom_callback_test_del_type_single(char *buf, int len);
static int custom_callback_test_del_type_multiple(char *buf, int len);
+static int custom_callback_test_clear(char *buf, int len);
/*
* Callbacks for manipulating the tests.
@@ -73,6 +74,7 @@
{"delete custom callback of multiple",
custom_callback_test_del_multiple, NULL, -1, 0},
{"delete custom callback type",
custom_callback_test_del_type_single, NULL, -1, 0},
{"delete custom callback type of multiple",
custom_callback_test_del_type_multiple, NULL, -1, 0},
+ {"clear with custom callback", custom_callback_test_clear,
NULL, -1, 0},
{NULL, NULL, NULL, -1, 0}
};
@@ -752,6 +754,30 @@
}
else
snprintf(buf, len, "callback function not called");
+
+ ewl_widget_destroy(w);
+
+ return ret;
+}
+
+/*
+ * Test clearing callbacks and calling a single callback type of a custom type.
+ */
+static int
+custom_callback_test_clear(char *buf, int len)
+{
+ Ewl_Widget *w;
+ int ret = 0;
+
+ w = ewl_widget_new();
+ ewl_callback_append(w, CALLBACK_CUSTOM_TYPE, base_callback, NULL);
+ ewl_callback_clear(w);
+ ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
+
+ if ((long)ewl_widget_data_get(w, w) == 0)
+ ret = 1;
+ else
+ snprintf(buf, len, "callback function called");
ewl_widget_destroy(w);
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs