summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Makefile_Ecore.am1
-rw-r--r--src/lib/ecore/ecore_pipe.c5
-rw-r--r--src/lib/evas/canvas/evas_async_events.c2
-rw-r--r--src/tests/ecore/ecore_suite.c1
-rw-r--r--src/tests/ecore/ecore_suite.h1
-rw-r--r--src/tests/ecore/ecore_test_pipe.c41
6 files changed, 45 insertions, 6 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 8c724fa636..b71652738e 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -286,6 +286,7 @@ tests/ecore/ecore_test_ecore_input.c \
286tests/ecore/ecore_test_ecore_file.c \ 286tests/ecore/ecore_test_ecore_file.c \
287tests/ecore/ecore_test_job.c \ 287tests/ecore/ecore_test_job.c \
288tests/ecore/ecore_test_args.c \ 288tests/ecore/ecore_test_args.c \
289tests/ecore/ecore_test_pipe.c \
289tests/ecore/ecore_suite.h 290tests/ecore/ecore_suite.h
290 291
291tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 292tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c
index f9aa62655a..92127b95d0 100644
--- a/src/lib/ecore/ecore_pipe.c
+++ b/src/lib/ecore/ecore_pipe.c
@@ -591,11 +591,6 @@ _ecore_pipe_handler_call(Ecore_Pipe *p,
591 unsigned char *buf, 591 unsigned char *buf,
592 size_t len) 592 size_t len)
593{ 593{
594 // on windows we seem to get a pipe wake with no data. don't pass on
595 // zero data as there is nothing useful to do with it... and it causes
596 // segfaults
597 if ((!buf) || (!len)) return;
598
599 void *data = (void*) p->data; 594 void *data = (void*) p->data;
600 595
601 // clear all values of pipe first. 596 // clear all values of pipe first.
diff --git a/src/lib/evas/canvas/evas_async_events.c b/src/lib/evas/canvas/evas_async_events.c
index b7141a54e4..c27c23b459 100644
--- a/src/lib/evas/canvas/evas_async_events.c
+++ b/src/lib/evas/canvas/evas_async_events.c
@@ -66,7 +66,7 @@ static void _evas_async_events_fd_blocking_set(Eina_Bool blocking EINA_UNUSED);
66static void 66static void
67_async_events_pipe_read_cb(void *data EINA_UNUSED, void *buf, unsigned int len) 67_async_events_pipe_read_cb(void *data EINA_UNUSED, void *buf, unsigned int len)
68{ 68{
69 if (wakeup != *(int*)buf || sizeof(int) != len) 69 if (!buf || wakeup != *(int*)buf || sizeof(int) != len)
70 return; 70 return;
71 71
72 Evas_Event_Async *ev; 72 Evas_Event_Async *ev;
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index 9e6baf6abb..53c6bbb3bf 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -29,6 +29,7 @@ static const Efl_Test_Case etc[] = {
29 { "Ecore_File", ecore_test_ecore_file }, 29 { "Ecore_File", ecore_test_ecore_file },
30 { "Ecore_Job", ecore_test_ecore_job }, 30 { "Ecore_Job", ecore_test_ecore_job },
31 { "Ecore_Args", ecore_test_ecore_args }, 31 { "Ecore_Args", ecore_test_ecore_args },
32 { "Ecore_Pipe", ecore_test_ecore_pipe },
32 { NULL, NULL } 33 { NULL, NULL }
33}; 34};
34 35
diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h
index d1a698ea99..a3327412fe 100644
--- a/src/tests/ecore/ecore_suite.h
+++ b/src/tests/ecore/ecore_suite.h
@@ -22,5 +22,6 @@ void ecore_test_ecore_input(TCase *tc);
22void ecore_test_ecore_file(TCase *tc); 22void ecore_test_ecore_file(TCase *tc);
23void ecore_test_ecore_job(TCase *tc); 23void ecore_test_ecore_job(TCase *tc);
24void ecore_test_ecore_args(TCase *tc); 24void ecore_test_ecore_args(TCase *tc);
25void ecore_test_ecore_pipe(TCase *tc);
25 26
26#endif /* _ECORE_SUITE_H */ 27#endif /* _ECORE_SUITE_H */
diff --git a/src/tests/ecore/ecore_test_pipe.c b/src/tests/ecore/ecore_test_pipe.c
new file mode 100644
index 0000000000..e4b7b9bc0c
--- /dev/null
+++ b/src/tests/ecore/ecore_test_pipe.c
@@ -0,0 +1,41 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include "ecore_suite.h"
7
8static void
9_pipe_handler(void *data, void *buf EINA_UNUSED, unsigned int len EINA_UNUSED)
10{
11 Eina_Bool *bob = data;
12
13 *bob = EINA_TRUE;
14 ecore_main_loop_quit();
15}
16
17EFL_START_TEST(ecore_test_pipe)
18{
19 Ecore_Pipe *pipe;
20 Eina_Bool bob = EINA_FALSE;
21
22 pipe = ecore_pipe_add(_pipe_handler, &bob);
23 fail_if(!pipe);
24
25 ecore_pipe_write(pipe, &bob, sizeof(Eina_Bool));
26 ecore_main_loop_begin();
27 ck_assert_int_eq(bob, EINA_TRUE);
28
29 bob = EINA_FALSE;
30 ecore_pipe_write(pipe, NULL, 0);
31 ecore_main_loop_begin();
32 ck_assert_int_eq(bob, EINA_TRUE);
33
34 ecore_pipe_del(pipe);
35}
36EFL_END_TEST
37
38void ecore_test_ecore_pipe(TCase *tc)
39{
40 tcase_add_test(tc, ecore_test_pipe);
41}