[EGIT] [core/efl] master 04/05: eio: add test cases for eio xattr module.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2e7c348acabca6e0c60d37c41a841d18fe5c6abe commit 2e7c348acabca6e0c60d37c41a841d18fe5c6abe Author: vivek Date: Sat Apr 18 17:40:59 2015 +0200 eio: add test cases for eio xattr module. Summary: Added test cases for eio_file_xattr, eio_file_xattr_set and eio_file_xattr_get functions Signed-off-by: vivek Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2374 Signed-off-by: Cedric BAIL --- src/Makefile_Eio.am| 1 + src/tests/eio/eio_suite.c | 3 + src/tests/eio/eio_suite.h | 1 + src/tests/eio/eio_test_xattr.c | 164 + 4 files changed, 169 insertions(+) diff --git a/src/Makefile_Eio.am b/src/Makefile_Eio.am index afa1ce3..a41af55 100644 --- a/src/Makefile_Eio.am +++ b/src/Makefile_Eio.am @@ -66,6 +66,7 @@ tests/eio/eio_model_test_file.c \ tests/eio/eio_model_test_monitor_add.c \ tests/eio/eio_test_monitor.c \ tests/eio/eio_test_file.c \ +tests/eio/eio_test_xattr.c \ tests/eio/eio_suite.h tests_eio_eio_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ diff --git a/src/tests/eio/eio_suite.c b/src/tests/eio/eio_suite.c index 7b3de1b..4dfdbfb 100644 --- a/src/tests/eio/eio_suite.c +++ b/src/tests/eio/eio_suite.c @@ -22,6 +22,9 @@ static const Eio_Test_Case etc[] = { {"Eio Model", eio_model_test_file}, {"Eio Model Monitor", eio_model_test_monitor_add}, {"Eio File", eio_test_file}, +#ifdef XATTR_TEST_DIR + {"Eio_Xattr", eio_test_xattr}, +#endif {NULL, NULL} }; diff --git a/src/tests/eio/eio_suite.h b/src/tests/eio/eio_suite.h index d365f70..170a060 100644 --- a/src/tests/eio/eio_suite.h +++ b/src/tests/eio/eio_suite.h @@ -7,5 +7,6 @@ void eio_test_monitor(TCase *tc); void eio_model_test_file(TCase *tc); void eio_model_test_monitor_add(TCase *tc); void eio_test_file(TCase *tc); +void eio_test_xattr(TCase *tc); #endif /* _EIO_SUITE_H */ diff --git a/src/tests/eio/eio_test_xattr.c b/src/tests/eio/eio_test_xattr.c new file mode 100644 index 000..6d12c3b --- /dev/null +++ b/src/tests/eio/eio_test_xattr.c @@ -0,0 +1,164 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include +#include +#include + +#include "eio_suite.h" + +const char *attribute[] = + { + "user.comment1", + "user.comment2", + "user.comment3" + }; +const char *attr_data[] = + { + "This is a test file", + "This line is a comment", + "This file has extra attributes" + }; + +Eina_Tmpstr* +get_file_path(const char* tmpdirname, const char* filename) +{ +char file_path[PATH_MAX] = ""; +eina_str_join(file_path, sizeof(file_path), '/', tmpdirname, filename); +return eina_tmpstr_add(file_path); +} + +static Eina_Bool +_filter_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const char *attr EINA_UNUSED) +{ + return EINA_TRUE; +} + +static void +_main_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const char *attr) +{ + int *num_of_attr = (int *)data; + unsigned int i; + + for (i = 0; i < sizeof (attribute) / sizeof (attribute[0]); ++i) + if (strcmp(attr, attribute[i]) == 0) + break; + + fail_if(i == sizeof (attribute) / sizeof (attribute[0])); + (*num_of_attr)++; +} + +static void +_done_cb(void *data, Eio_File *handler EINA_UNUSED) + +{ + int *num_of_attr = (int *)data; + + (*num_of_attr)++; + + if (((*num_of_attr) + 1) == (sizeof (attribute) / sizeof (attribute[0]))) + ecore_main_loop_quit(); +} + +static void +_done_once_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED) +{ + ecore_main_loop_quit(); +} + +static void +_done_get_cb(void *data, Eio_File *handler EINA_UNUSED, const char *name, unsigned int len EINA_UNUSED) + +{ + int i = (int)(uintptr_t)data; + + fail_if(strcmp(name, attr_data[i]) != 0); + + if ((i + 1) == (sizeof (attribute) / sizeof (attribute[0]))) + ecore_main_loop_quit(); +} + +static void +_error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error) + +{ + fprintf(stderr, "Something wrong has happend:%s\n", strerror(error)); + abort(); + + ecore_main_loop_quit(); +} + +#ifdef XATTR_TEST_DIR +START_TEST(eio_test_xattr_set) +{ + char *filename = "eio-tmpfile"; + Eina_Tmpstr *test_file_path; + Eio_File *fp; + int num_of_attr = 0, fd; + unsigned int i; + + ecore_init(); + eina_init(); + eio_init(); + + test_file_path = get_file_path(XATTR_TEST_DIR, filename); + fd = open(test_file_path, + O_WRONLY | O_CREAT | O_TRUNC, + S_IRWXU | S_IRWXG | S_IRWXO); + fail_if(fd == 0); + + for (i = 0; i < sizeof(attribute) / sizeof(
[EGIT] [core/efl] master 05/10: eina: add test cases for eina file xattr functions.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=dab4fb492a0f6689f3f64275945c4214e6a496b3 commit dab4fb492a0f6689f3f64275945c4214e6a496b3 Author: vivek Date: Wed Apr 22 14:21:36 2015 +0200 eina: add test cases for eina file xattr functions. Summary: Added test cases for eina_file_xattr_get and eina_file_xattr_value_get functions Signed-off-by: vivek Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2401 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_file.c | 73 src/tests/eina/eina_test_xattr.c | 4 --- 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c index fec6054..38525bd 100644 --- a/src/tests/eina/eina_test_file.c +++ b/src/tests/eina/eina_test_file.c @@ -503,6 +503,76 @@ START_TEST(eina_test_file_path) } END_TEST +#ifdef XATTR_TEST_DIR +START_TEST(eina_test_file_xattr) +{ + Eina_File *ef; + char *filename = "tmpfile"; + const char *attribute[] = + { +"user.comment1", +"user.comment2", +"user.comment3" + }; + const char *data[] = + { +"This is a test file", +"This line is a comment", +"This file has extra attributes" + }; + char *ret_str; + unsigned int i; + Eina_Bool ret; + Eina_Tmpstr *test_file_path; + Eina_Iterator *it; + int fd; + Eina_Xattr *xattr; + + eina_init(); + test_file_path = get_full_path(XATTR_TEST_DIR, filename); + + fd = open(test_file_path, O_RDONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO); + fail_if(fd == 0); + close(fd); + + for (i = 0; i < sizeof(attribute) / sizeof(attribute[0]); ++i) + { +ret = eina_xattr_set(test_file_path, attribute[i], data[i], strlen(data[i]), EINA_XATTR_INSERT); +fail_if(ret != EINA_TRUE); + } + + ef = eina_file_open(test_file_path, EINA_FALSE); + fail_if(!ef); + + it = eina_file_xattr_get(ef); + EINA_ITERATOR_FOREACH(it, ret_str) + { +for (i = 0; i < sizeof (attribute) / sizeof (attribute[0]); i++) + if (strcmp(attribute[i], ret_str) == 0) +break ; +fail_if(i == sizeof (attribute) / sizeof (attribute[0])); + } + eina_iterator_free(it); + + it = eina_file_xattr_value_get(ef); + EINA_ITERATOR_FOREACH(it, xattr) + { +for (i = 0; i < sizeof (data) / sizeof (data[0]); i++) + if (strcmp(attribute[i], xattr->name) == 0 && + strcmp(data[i], xattr->value) == 0) +break ; +fail_if(i == sizeof (data) / sizeof (data[0])); + } + eina_iterator_free(it); + + unlink(test_file_path); + eina_tmpstr_del(test_file_path); + eina_file_close(ef); + eina_shutdown(); +} +END_TEST +#endif + void eina_test_file(TCase *tc) { @@ -513,4 +583,7 @@ eina_test_file(TCase *tc) tcase_add_test(tc, eina_test_file_virtualize); tcase_add_test(tc, eina_test_file_thread); tcase_add_test(tc, eina_test_file_path); +#ifdef XATTR_TEST_DIR + tcase_add_test(tc, eina_test_file_xattr); +#endif } diff --git a/src/tests/eina/eina_test_xattr.c b/src/tests/eina/eina_test_xattr.c index 72c0c3d..50e1ad0 100644 --- a/src/tests/eina/eina_test_xattr.c +++ b/src/tests/eina/eina_test_xattr.c @@ -42,7 +42,6 @@ START_TEST(eina_test_xattr_set) char *filename = "tmpfile"; char *attribute1 = "user.comment1"; char *data1 = "This is comment 1"; - char *attribute2 = "user.comment2"; char *data2 = "This is comment 2"; char *ret_str; int fd; @@ -78,9 +77,6 @@ START_TEST(eina_test_xattr_set) ret = eina_xattr_del(test_file_path, attribute1); fail_if(ret != EINA_TRUE); - ret = eina_xattr_del(test_file_path, attribute2); - fail_if(ret != EINA_FALSE); - ret = eina_xattr_fd_set(fd, attribute1, data1, strlen(data1), EINA_XATTR_CREATED); fail_if(ret != EINA_TRUE); ret_str = eina_xattr_fd_get(fd, attribute1, &len); --
[EGIT] [core/efl] master 02/10: eina: add test case for eina_strbuf_string_free function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=08b99cf20169de924e935160d7b18efe6bdac12f commit 08b99cf20169de924e935160d7b18efe6bdac12f Author: vivek Date: Wed Apr 22 12:38:58 2015 +0200 eina: add test case for eina_strbuf_string_free function. Summary: Added test case for eina_strbuf_string_free function in eina_strbuf module Signed-off-by: vivek Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2382 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_strbuf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/tests/eina/eina_test_strbuf.c b/src/tests/eina/eina_test_strbuf.c index 406b467..7a1386c 100644 --- a/src/tests/eina/eina_test_strbuf.c +++ b/src/tests/eina/eina_test_strbuf.c @@ -56,6 +56,11 @@ START_TEST(strbuf_simple) fail_if(eina_strbuf_length_get(buf) != 0); fail_if(!strcmp(eina_strbuf_string_get(buf), TEXT)); + eina_strbuf_string_free(buf); + fail_if(eina_strbuf_length_get(buf)); + eina_strbuf_append(buf, TEXT); + fail_if(strcmp(eina_strbuf_string_get(buf), TEXT)); + eina_strbuf_free(buf); eina_shutdown(); --
[EGIT] [core/efl] master 08/10: eio: add testcases for various eio_xattr types set and get functions.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d86ed2a46c5f6a7a76fceff7d33ed934f87bb714 commit d86ed2a46c5f6a7a76fceff7d33ed934f87bb714 Author: vivek Date: Wed Apr 22 14:52:55 2015 +0200 eio: add testcases for various eio_xattr types set and get functions. Summary: Added test cases for eio_file_xattr_string_set, eio_file_xattr_string_get, eio_file_xattr_int_set, eio_file_xattr_int_get, eio_file_xattr_double_get, eio_file_xattr_double set functions Signed-off-by: vivek Reviewers: cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D2380 Signed-off-by: Cedric BAIL --- src/tests/eio/eio_test_xattr.c | 103 + 1 file changed, 103 insertions(+) diff --git a/src/tests/eio/eio_test_xattr.c b/src/tests/eio/eio_test_xattr.c index a9a3582..f28d04f 100644 --- a/src/tests/eio/eio_test_xattr.c +++ b/src/tests/eio/eio_test_xattr.c @@ -13,6 +13,13 @@ #include "eio_suite.h" +static char *str_attr = "user.name"; +static char *str_data = "Vivek Ellur"; +static char *int_attr = "user.id"; +static int int_data = 1234; +static char *double_attr = "user.size"; +static double double_data = 123.456; + const char *attribute[] = { "user.comment1", @@ -85,6 +92,30 @@ _done_get_cb(void *data, Eio_File *handler EINA_UNUSED, const char *name, unsign } static void +_done_string_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const char *xattr_string) +{ + fail_if(strcmp(xattr_string, str_data) != 0); + + ecore_main_loop_quit(); +} + +static void +_done_int_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int xattr_int) +{ + fail_if(xattr_int != int_data); + + ecore_main_loop_quit(); +} + +static void +_done_double_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, double xattr_double) +{ + fail_if(xattr_double != double_data); + + ecore_main_loop_quit(); +} + +static void _error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error) { @@ -152,12 +183,84 @@ START_TEST(eio_test_xattr_set) ecore_shutdown(); } END_TEST + +START_TEST(eio_test_xattr_types_set) +{ + char *filename = "eio-tmpfile"; + + Eina_Tmpstr *test_file_path; + int fd, num_of_attr=0; + Eio_File *fp; + + ecore_init(); + eina_init(); + eio_init(); + + test_file_path = get_file_path(XATTR_TEST_DIR, filename); + fd = open(test_file_path, + O_WRONLY | O_CREAT | O_TRUNC, + S_IRWXU | S_IRWXG | S_IRWXO); + fail_if(fd == 0); + fp = eio_file_xattr_string_set(test_file_path, str_attr, +str_data, EINA_XATTR_INSERT, +_done_once_cb, _error_cb, &num_of_attr); + + fail_if(num_of_attr != 0); // test asynchronous + fail_if(!fp); + + ecore_main_loop_begin(); + + fp = eio_file_xattr_string_get(test_file_path, str_attr, + _done_string_cb, _error_cb, NULL); + fail_if(!fp); + + ecore_main_loop_begin(); + + fp = eio_file_xattr_int_set(test_file_path, int_attr, +int_data, EINA_XATTR_INSERT, +_done_once_cb, _error_cb, &num_of_attr); + + fail_if(num_of_attr != 0); // test asynchronous + fail_if(!fp); + + ecore_main_loop_begin(); + + fp = eio_file_xattr_int_get(test_file_path, int_attr, + _done_int_cb, _error_cb, NULL); + fail_if(!fp); + + ecore_main_loop_begin(); + + fp = eio_file_xattr_double_set(test_file_path, double_attr, +double_data, EINA_XATTR_INSERT, +_done_once_cb, _error_cb, &num_of_attr); + + fail_if(num_of_attr != 0); // test asynchronous + fail_if(!fp); + + ecore_main_loop_begin(); + + fp = eio_file_xattr_double_get(test_file_path, double_attr, + _done_double_cb, _error_cb, NULL); + fail_if(!fp); + + ecore_main_loop_begin(); + + close(fd); + unlink(test_file_path); + eina_tmpstr_del(test_file_path); + eio_shutdown(); + eina_shutdown(); + ecore_shutdown(); +} +END_TEST #endif void eio_test_xattr(TCase *tc) { #ifdef XATTR_TEST_DIR tcase_add_test(tc, eio_test_xattr_set); + tcase_add_test(tc, eio_test_xattr_types_set); #else (void)tc; #endif --
[EGIT] [core/efl] master 04/08: eio: fix compilation warnings in eio_test_xattr.c when xattr tests are disabled.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=254aac64a1fabcf8f986e3e73072ad2419a2cd12 commit 254aac64a1fabcf8f986e3e73072ad2419a2cd12 Author: vivek Date: Tue Apr 28 11:09:47 2015 +0200 eio: fix compilation warnings in eio_test_xattr.c when xattr tests are disabled. Summary: Signed-off-by: vivek Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2438 Signed-off-by: Cedric BAIL --- src/tests/eio/eio_test_xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/eio/eio_test_xattr.c b/src/tests/eio/eio_test_xattr.c index f28d04f..b832eb0 100644 --- a/src/tests/eio/eio_test_xattr.c +++ b/src/tests/eio/eio_test_xattr.c @@ -13,6 +13,9 @@ #include "eio_suite.h" + +#ifdef XATTR_TEST_DIR + static char *str_attr = "user.name"; static char *str_data = "Vivek Ellur"; static char *int_attr = "user.id"; @@ -125,7 +128,6 @@ _error_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, int error) ecore_main_loop_quit(); } -#ifdef XATTR_TEST_DIR START_TEST(eio_test_xattr_set) { char *filename = "eio-tmpfile"; --
[EGIT] [core/efl] master 01/01: eina_xattr: Fixed T2381, eina xattr tests failing
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=400436cd1af6aef8892ac899eb0844892fc5e54c commit 400436cd1af6aef8892ac899eb0844892fc5e54c Author: vivek Date: Wed May 6 08:32:04 2015 +0200 eina_xattr: Fixed T2381, eina xattr tests failing Summary: This fixes the case where the system runs with SELinux enabled and enforced. In this scenario the system does add a selinux attribute to new files which we need to handle during our testing. @Fix Signed-off-by: vivek Reviewers: cedric, stefan_schmidt Subscribers: stefan_schmidt, cedric Maniphest Tasks: T2381 Differential Revision: https://phab.enlightenment.org/D2467 --- src/tests/eina/eina_test_file.c | 17 + src/tests/eina/eina_test_xattr.c | 52 ++-- src/tests/eio/eio_test_xattr.c | 8 +++ 3 files changed, 55 insertions(+), 22 deletions(-) diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c index 5fa4a68..766ff46 100644 --- a/src/tests/eina/eina_test_file.c +++ b/src/tests/eina/eina_test_file.c @@ -525,7 +525,7 @@ START_TEST(eina_test_file_xattr) Eina_Bool ret; Eina_Tmpstr *test_file_path; Eina_Iterator *it; - int fd; + int fd, count=0; Eina_Xattr *xattr; eina_init(); @@ -549,20 +549,27 @@ START_TEST(eina_test_file_xattr) { for (i = 0; i < sizeof (attribute) / sizeof (attribute[0]); i++) if (strcmp(attribute[i], ret_str) == 0) -break ; -fail_if(i == sizeof (attribute) / sizeof (attribute[0])); +{ + count++; + break; +} } + fail_if(count != sizeof (attribute) / sizeof (attribute[0])); eina_iterator_free(it); + count = 0; it = eina_file_xattr_value_get(ef); EINA_ITERATOR_FOREACH(it, xattr) { for (i = 0; i < sizeof (data) / sizeof (data[0]); i++) if (strcmp(attribute[i], xattr->name) == 0 && strcmp(data[i], xattr->value) == 0) -break ; -fail_if(i == sizeof (data) / sizeof (data[0])); +{ + count++; + break; +} } + fail_if(count != sizeof (data) / sizeof (data[0])); eina_iterator_free(it); unlink(test_file_path); diff --git a/src/tests/eina/eina_test_xattr.c b/src/tests/eina/eina_test_xattr.c index 50e1ad0..43a315a 100644 --- a/src/tests/eina/eina_test_xattr.c +++ b/src/tests/eina/eina_test_xattr.c @@ -87,6 +87,7 @@ START_TEST(eina_test_xattr_set) ret = eina_xattr_fd_del(fd, attribute1); fail_if(ret != EINA_TRUE); + close(fd); unlink(test_file_path); eina_tmpstr_del(test_file_path); @@ -112,7 +113,7 @@ START_TEST(eina_test_xattr_list) "This file has extra attributes" }; char *ret_str; - int fd, fd1; + int fd, fd1, count=0; unsigned int i; Eina_Bool ret; Eina_Tmpstr *test_file_path, *cp_file_path; @@ -134,61 +135,81 @@ START_TEST(eina_test_xattr_list) ret = eina_xattr_set(test_file_path, attribute[i], data[i], strlen(data[i]), EINA_XATTR_INSERT); fail_if(ret != EINA_TRUE); } + it = eina_xattr_ls(test_file_path); EINA_ITERATOR_FOREACH(it, ret_str) { for (i = 0; i < sizeof (attribute) / sizeof (attribute[0]); i++) if (strcmp(attribute[i], ret_str) == 0) -break ; -fail_if(i == sizeof (attribute) / sizeof (attribute[0])); +{ + count++; + break ; +} } + fail_if(count != sizeof (attribute) / sizeof (attribute[0])); eina_iterator_free(it); + count = 0; it = eina_xattr_value_ls(test_file_path); EINA_ITERATOR_FOREACH(it, xattr) { for (i = 0; i < sizeof (data) / sizeof (data[0]); i++) if (strcmp(attribute[i], xattr->name) == 0 && strcmp(data[i], xattr->value) == 0) -break ; -fail_if(i == sizeof (data) / sizeof (data[0])); +{ + count++; + break ; +} } + fail_if(count != sizeof (data) / sizeof (data[0])); eina_iterator_free(it); + count = 0; it = eina_xattr_fd_ls(fd); EINA_ITERATOR_FOREACH(it, ret_str) { for (i = 0; i < sizeof (attribute) / sizeof (attribute[0]); i++) if (strcmp(attribute[i], ret_str) == 0) -break ; -fail_if(i == sizeof (attribute) / sizeof (attribute[0])); +{ + count++; + break ; +} } + fail_if(count != sizeof (attribute) / sizeof (attribute[0])); eina_iterator_free(it); + count = 0; it = eina_xattr_value_fd_ls(fd); EINA_ITERATOR_FOREACH(it, xattr) { for (i = 0; i < sizeof (data) / sizeof (data[0]); i++) if (strcmp(attribute[i], x
[EGIT] [core/efl] master 44/55: eina: add benchmark for crc hash in eina benchmark
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=eec4a7bd0caa7d52bff6cc524ca12efa16d1445b commit eec4a7bd0caa7d52bff6cc524ca12efa16d1445b Author: vivek Date: Tue Apr 28 23:29:18 2015 +0200 eina: add benchmark for crc hash in eina benchmark Summary: The code added is actually benchmarking all hash function key with various length (8, 32, 256 bytes). Signed-off-by: vivek Reviewers: Sergeant_Whitespace, cedric Reviewed By: cedric Subscribers: Sergeant_Whitespace, cedric Differential Revision: https://phab.enlightenment.org/D2217 Signed-off-by: Cedric BAIL --- src/benchmarks/eina/Makefile.am | 1 + src/benchmarks/eina/eina_bench.c | 3 + src/benchmarks/eina/eina_bench.h | 5 + src/benchmarks/eina/eina_bench_crc_hash.c | 279 ++ 4 files changed, 288 insertions(+) diff --git a/src/benchmarks/eina/Makefile.am b/src/benchmarks/eina/Makefile.am index 9f64d46..da6ceb9 100644 --- a/src/benchmarks/eina/Makefile.am +++ b/src/benchmarks/eina/Makefile.am @@ -18,6 +18,7 @@ eina_bench_SOURCES = \ eina_bench.c \ eina_bench_sort.c \ eina_bench_hash.c \ +eina_bench_crc_hash.c \ eina_bench_stringshare.c \ eina_bench_convert.c \ eina_bench_mempool.c \ diff --git a/src/benchmarks/eina/eina_bench.c b/src/benchmarks/eina/eina_bench.c index dec210e..1ca7e51 100644 --- a/src/benchmarks/eina/eina_bench.c +++ b/src/benchmarks/eina/eina_bench.c @@ -37,6 +37,9 @@ struct _Eina_Benchmark_Case static const Eina_Benchmark_Case etc[] = { { "Hash", eina_bench_hash, EINA_TRUE }, + { "Hash_Short_Key", eina_bench_crc_hash_short, EINA_TRUE }, + { "Hash_Medium_Key", eina_bench_crc_hash_medium, EINA_TRUE }, + { "Hash_Large_key", eina_bench_crc_hash_large, EINA_TRUE }, { "Array vs List vs Inlist", eina_bench_array, EINA_TRUE }, { "Stringshare", eina_bench_stringshare, EINA_TRUE }, { "Convert", eina_bench_convert, EINA_TRUE }, diff --git a/src/benchmarks/eina/eina_bench.h b/src/benchmarks/eina/eina_bench.h index d575822..f076d41 100644 --- a/src/benchmarks/eina/eina_bench.h +++ b/src/benchmarks/eina/eina_bench.h @@ -21,7 +21,12 @@ #include "eina_benchmark.h" +int key_size; + void eina_bench_hash(Eina_Benchmark *bench); +void eina_bench_crc_hash_short(Eina_Benchmark *bench); +void eina_bench_crc_hash_medium(Eina_Benchmark *bench); +void eina_bench_crc_hash_large(Eina_Benchmark *bench); void eina_bench_array(Eina_Benchmark *bench); void eina_bench_stringshare(Eina_Benchmark *bench); void eina_bench_convert(Eina_Benchmark *bench); diff --git a/src/benchmarks/eina/eina_bench_crc_hash.c b/src/benchmarks/eina/eina_bench_crc_hash.c new file mode 100644 index 000..b673448 --- /dev/null +++ b/src/benchmarks/eina/eina_bench_crc_hash.c @@ -0,0 +1,279 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#ifdef EINA_BENCH_HAVE_GLIB +# include +#endif + +#include +#include "Evas_Data.h" +#include "Ecore_Data.h" + +#include "eina_hash.h" +#include "eina_array.h" +#include "eina_bench.h" +#include "eina_rbtree.h" +#include "eina_convert.h" + +#ifdef CITYHASH_BENCH +// Hash function for a byte array. +uint64_t CityHash64(const char *buf, size_t len); +#endif + +char *key_str=NULL; + +void repchar(int n) +{ + key_str = (char *)malloc(n); + int i; + + for (i = 0; i < n; i++) + key_str[i] = 'a'; +} + +static void +eina_bench_murmur_hash(int request) +{ + unsigned int i; + + for (i = 0; i < (unsigned int)request; ++i) + { +char tmp_key[key_size]; + +eina_convert_itoa(i, tmp_key); +eina_strlcat(tmp_key, key_str, key_size); + +eina_hash_murmur3(tmp_key, key_size); + } +} + +#ifdef CITYHASH_BENCH +static void +eina_bench_cityhash(int request) +{ + unsigned int i; + + for (i = 0; i < (unsigned int)request; ++i) + { +char tmp_key[key_size]; + +eina_convert_itoa(i, tmp_key); +eina_strlcat(tmp_key, key_str, key_size); + +CityHash64(tmp_key, key_size); + } +} +#endif + +static void +eina_bench_superfast_hash(int request) +{ + unsigned int i; + + for (i = 0; i < (unsigned int)request; ++i) + { +char tmp_key[key_size]; + +eina_convert_itoa(i, tmp_key); +eina_strlcat(tmp_key, key_str, key_size); + +eina_hash_superfast(tmp_key, key_size); + } +} + +static void +eina_bench_crchash(int request) +{ + unsigned int i; + + for (i = 0; i < (unsigned int)request; ++i) + { +char tmp_key[key_size]; + +eina_convert_itoa(i, tmp_key); +eina_strlcat(tmp_key, key_str, key_size); + +eina_hash_crc(tmp_key, key_size); + } +} + +static void +ei
[EGIT] [core/efl] master 04/55: emile: add emile_suite_build function to separate creation of test suite.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a415fa9a7f11db0aa5716772e2a2015d987590e4 commit a415fa9a7f11db0aa5716772e2a2015d987590e4 Author: vivek Date: Wed Apr 15 16:59:38 2015 +0200 emile: add emile_suite_build function to separate creation of test suite. Summary: Signed-off-by: vivek Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2319 Signed-off-by: Cedric BAIL --- src/tests/emile/emile_suite.c | 47 ++- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/tests/emile/emile_suite.c b/src/tests/emile/emile_suite.c index 9ba150f..7d37367 100644 --- a/src/tests/emile/emile_suite.c +++ b/src/tests/emile/emile_suite.c @@ -44,7 +44,7 @@ _list_tests(void) } static Eina_Bool -_use_test(const char *name, int argc, char *argv[]) +_use_test(const char *name, int argc, const char *argv[]) { argc--; argv--; @@ -58,12 +58,36 @@ _use_test(const char *name, int argc, char *argv[]) return EINA_FALSE; } +static Suite * +emile_suite_build(int argc, const char **argv) +{ + TCase *tc; + Suite *s; + unsigned int i; + + s = suite_create("Emile"); + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { +if (!_use_test(tests[i].name, argc, argv)) + continue; + +tc = tcase_create(tests[i].name); +tests[i].build(tc); +suite_add_tcase(s, tc); +#ifndef _WIN32 +tcase_set_timeout(tc, 0); +#endif + } + + return s; +} + int main(int argc, char *argv[]) { SRunner *sr; Suite *s; - unsigned int i; int failed_count; int j; @@ -80,24 +104,9 @@ main(int argc, char *argv[]) return 0; } - s = suite_create("Emile"); - - for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) - { -TCase *tc; - -if (!_use_test(tests[i].name, argc, argv)) - continue; - -tc = tcase_create(tests[i].name); -tests[i].build(tc); -suite_add_tcase(s, tc); -#ifndef _WIN32 -tcase_set_timeout(tc, 0); -#endif - } - + s = emile_suite_build(argc, (const char **)argv); sr = srunner_create(s); + srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml"); srunner_run_all(sr, CK_ENV); failed_count = srunner_ntests_failed(sr); --
[EGIT] [core/efl] master 45/55: eina: add crc hash function to eina hash module.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1fdc58a58061f044f5a701f8b96af2eb80027b52 commit 1fdc58a58061f044f5a701f8b96af2eb80027b52 Author: vivek Date: Tue Apr 28 23:33:56 2015 +0200 eina: add crc hash function to eina hash module. Summary: Added eina_hash_crc function in eina hash module to generate hash code using crc-32. Signed-off-by: vivek Reviewers: Sergeant_Whitespace, cedric Subscribers: Sergeant_Whitespace, cedric Differential Revision: https://phab.enlightenment.org/D2273 Signed-off-by: Cedric BAIL --- src/lib/eina/eina_hash.h| 11 +++ src/lib/eina/eina_inline_hash.x | 12 2 files changed, 23 insertions(+) diff --git a/src/lib/eina/eina_hash.h b/src/lib/eina/eina_hash.h index 460af00..5f953bf 100644 --- a/src/lib/eina/eina_hash.h +++ b/src/lib/eina/eina_hash.h @@ -1157,6 +1157,17 @@ static inline int eina_hash_int64(const unsigned long long int *pkey, static inline int eina_hash_murmur3(const char *key, int len) EINA_ARG_NONNULL(1); +/** + * @brief + * Hash function using crc-32 algorithm and and 0xEDB88320 polynomial + * + * @param key The key to hash + * @param len The length of the key + * @return The hash value + */ +static inline int eina_hash_crc(const char *key, + int len) EINA_ARG_NONNULL(1); + #include "eina_inline_hash.x" /** diff --git a/src/lib/eina/eina_inline_hash.x b/src/lib/eina/eina_inline_hash.x index 630e347..71b0208 100644 --- a/src/lib/eina/eina_inline_hash.x +++ b/src/lib/eina/eina_inline_hash.x @@ -19,6 +19,8 @@ #ifndef EINA_INLINE_HASH_X_ #define EINA_INLINE_HASH_X_ +#include "eina_crc.h" + EAPI extern unsigned int eina_seed; /* @@ -150,4 +152,14 @@ eina_hash_murmur3(const char *key, int len) return _fmix32(h1); } + +static inline int +eina_hash_crc(const char *key, int len) +{ + unsigned int crc; + unsigned int seed = 0x; + + crc = eina_crc(key, len, seed, EINA_TRUE); + return (int)crc; +} #endif --
[EGIT] [core/efl] master 46/55: eina: add test case for eina_hash_crc function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=edfd621d0619353a2d17c61718cef72b425e7cf6 commit edfd621d0619353a2d17c61718cef72b425e7cf6 Author: vivek Date: Tue Apr 28 23:34:34 2015 +0200 eina: add test case for eina_hash_crc function. Summary: Added test case for eina_hash_crc function which uses crc32 for hashing algorithm Signed-off-by: vivek Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2296 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_hash.c | 85 + 1 file changed, 85 insertions(+) diff --git a/src/tests/eina/eina_test_hash.c b/src/tests/eina/eina_test_hash.c index 0471d5e..b2f9704 100644 --- a/src/tests/eina/eina_test_hash.c +++ b/src/tests/eina/eina_test_hash.c @@ -26,6 +26,29 @@ #include "eina_suite.h" #include "Eina.h" +#include "eina_hash.h" + +#define EINA_HASH_BUCKET_SIZE 8 + +static unsigned int +_eina_string_key_length(const char *key) +{ + if (!key) + return 0; + + return (int)strlen(key) + 1; +} + +static int +_eina_string_key_cmp(const char *key1, int key1_length, + const char *key2, int key2_length) +{ + int delta; + + delta = key1_length - key2_length; + if (delta) return delta; + return strcmp(key1, key2); +} static Eina_Bool eina_foreach_check(EINA_UNUSED const Eina_Hash *hash, @@ -103,6 +126,67 @@ START_TEST(eina_hash_simple) } END_TEST +START_TEST(eina_test_hash_crc) +{ + Eina_Hash *hash = NULL; + int *test; + int array[] = { 1, 42, 4, 5, 6 }; + + fail_if(eina_init() != 2); + + hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length), +EINA_KEY_CMP(_eina_string_key_cmp), +EINA_KEY_HASH(eina_hash_crc), +NULL, +EINA_HASH_BUCKET_SIZE); + fail_if(hash == NULL); + + fail_if(eina_hash_add(hash, "1", &array[0]) != EINA_TRUE); + fail_if(eina_hash_add(hash, "42", &array[1]) != EINA_TRUE); + fail_if(eina_hash_direct_add(hash, "4", &array[2]) != EINA_TRUE); + fail_if(eina_hash_direct_add(hash, "5", &array[3]) != EINA_TRUE); + fail_if(eina_hash_add(hash, "", "") != EINA_TRUE); + + test = eina_hash_find(hash, "4"); + fail_if(!test); + fail_if(*test != 4); + + test = eina_hash_find(hash, "42"); + fail_if(!test); + fail_if(*test != 42); + + eina_hash_foreach(hash, eina_foreach_check, NULL); + + test = eina_hash_modify(hash, "5", &array[4]); + fail_if(!test); + fail_if(*test != 5); + + test = eina_hash_find(hash, "5"); + fail_if(!test); + fail_if(*test != 6); + + fail_if(eina_hash_population(hash) != 5); + + fail_if(eina_hash_find(hash, "120") != NULL); + + fail_if(eina_hash_del(hash, "5", NULL) != EINA_TRUE); + fail_if(eina_hash_find(hash, "5") != NULL); + + fail_if(eina_hash_del(hash, NULL, &array[2]) != EINA_TRUE); + fail_if(eina_hash_find(hash, "4") != NULL); + + fail_if(eina_hash_del(hash, NULL, &array[2]) != EINA_FALSE); + + fail_if(eina_hash_del(hash, "1", NULL) != EINA_TRUE); + fail_if(eina_hash_del(hash, "42", NULL) != EINA_TRUE); + + eina_hash_free(hash); + + /* Same comment as eina_init */ +fail_if(eina_shutdown() != 1); +} +END_TEST + START_TEST(eina_hash_extended) { Eina_Hash *hash = NULL; @@ -337,6 +421,7 @@ END_TEST void eina_test_hash(TCase *tc) { tcase_add_test(tc, eina_hash_simple); + tcase_add_test(tc, eina_test_hash_crc); tcase_add_test(tc, eina_hash_extended); tcase_add_test(tc, eina_hash_double_item); tcase_add_test(tc, eina_hash_all_int); --
[EGIT] [core/efl] master 23/55: eina: add CRC implementation to Eina module.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a2f2d942c6e49e74990a0c56d38de343cf42d696 commit a2f2d942c6e49e74990a0c56d38de343cf42d696 Author: vivek Date: Wed Apr 22 15:34:33 2015 +0200 eina: add CRC implementation to Eina module. Summary: Added eina_crc function in eina to calculate crc for the key passed and added eina_hash_crc function for hashing using crc Signed-off-by: vivek Reviewers: Sergeant_Whitespace, cedric Reviewed By: cedric Subscribers: Sergeant_Whitespace, cedric Differential Revision: https://phab.enlightenment.org/D2260 Signed-off-by: Cedric BAIL --- src/Makefile_Eina.am| 6 +- src/lib/eina/Eina.h | 1 + src/lib/eina/eina_crc.c | 320 src/lib/eina/eina_crc.h | 43 +++ 4 files changed, 368 insertions(+), 2 deletions(-) diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am index ebde225..160e7a9 100644 --- a/src/Makefile_Eina.am +++ b/src/Makefile_Eina.am @@ -87,7 +87,8 @@ lib/eina/eina_cow.h \ lib/eina/eina_inline_unicode.x \ lib/eina/eina_thread_queue.h \ lib/eina/eina_matrix.h \ -lib/eina/eina_quad.h +lib/eina/eina_quad.h \ +lib/eina/eina_crc.h lib_eina_libeina_la_SOURCES = \ lib/eina/eina_abi.c \ @@ -144,7 +145,8 @@ lib/eina/eina_private.h \ lib/eina/eina_strbuf_common.h \ lib/eina/eina_thread_queue.c \ lib/eina/eina_matrix.c \ -lib/eina/eina_quad.c +lib/eina/eina_quad.c \ +lib/eina/eina_crc.c # Will be back for developper after 1.2 # lib/eina/eina_model.c \ diff --git a/src/lib/eina/Eina.h b/src/lib/eina/Eina.h index 0f6851a..672c094 100644 --- a/src/lib/eina/Eina.h +++ b/src/lib/eina/Eina.h @@ -263,6 +263,7 @@ extern "C" { #include #include #include +#include #ifdef __cplusplus } diff --git a/src/lib/eina/eina_crc.c b/src/lib/eina/eina_crc.c new file mode 100644 index 000..29ec08c --- /dev/null +++ b/src/lib/eina/eina_crc.c @@ -0,0 +1,320 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#include "eina_crc.h" + +#define POLYNOMIAL 0xEDB88320 + +static const unsigned int table[8][256] = +{ + { + 0x,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3, + 0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91, + 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7, + 0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5, + 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B, + 0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59, + 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F, + 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D, + 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433, + 0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01, + 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457, + 0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65, + 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB, + 0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, + 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F, + 0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD, + 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683, + 0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1, + 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7, + 0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5, + 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B, + 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79, + 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F, + 0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D, + 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713, + 0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21, + 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777, + 0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,
[EGIT] [core/efl] master 24/55: eina: add test case for eina_crc function in eina module.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=48dea342409fffcdd824b5d0ed00a180782b3459 commit 48dea342409fffcdd824b5d0ed00a180782b3459 Author: vivek Date: Wed Apr 22 15:37:32 2015 +0200 eina: add test case for eina_crc function in eina module. Summary: I added test cases using seed 0x, I was not able to get crc value for different seeds online. Checked some of the links, but they are using entirely different logic and value was not matching for other seed value. Signed-off-by: vivek Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2293 Signed-off-by: Cedric BAIL --- src/Makefile_Eina.am | 3 ++- src/tests/eina/eina_suite.c| 1 + src/tests/eina/eina_suite.h| 1 + src/tests/eina/eina_test_crc.c | 50 ++ 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am index 160e7a9..6303510 100644 --- a/src/Makefile_Eina.am +++ b/src/Makefile_Eina.am @@ -285,7 +285,8 @@ tests/eina/eina_test_barrier.c \ tests/eina/eina_test_tmpstr.c \ tests/eina/eina_test_trash.c \ tests/eina/eina_test_lock.c \ -tests/eina/eina_test_xattr.c +tests/eina/eina_test_xattr.c \ +tests/eina/eina_test_crc.c # tests/eina/eina_test_model.c diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c index 6e16d8e..1a08480 100644 --- a/src/tests/eina/eina_suite.c +++ b/src/tests/eina/eina_suite.c @@ -79,6 +79,7 @@ static const Eina_Test_Case etc[] = { #ifdef XATTR_TEST_DIR { "Xattr", eina_test_xattr }, #endif + {"Crc", eina_test_crc }, { NULL, NULL } }; diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h index 433d95a..63d76cd 100644 --- a/src/tests/eina/eina_suite.h +++ b/src/tests/eina/eina_suite.h @@ -64,5 +64,6 @@ void eina_test_locking(TCase *tc); void eina_test_abi(TCase *tc); void eina_test_trash(TCase *tc); void eina_test_xattr(TCase *tc); +void eina_test_crc(TCase *tc); #endif /* EINA_SUITE_H_ */ diff --git a/src/tests/eina/eina_test_crc.c b/src/tests/eina/eina_test_crc.c new file mode 100644 index 000..34a00f3 --- /dev/null +++ b/src/tests/eina/eina_test_crc.c @@ -0,0 +1,50 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#include "eina_suite.h" +#include "Eina.h" + +START_TEST(eina_crc_simple) +{ + unsigned int seed = 0x, i, ret; + const char *data[] = + { +"Hello World", +"This is to test crc", +"4baAsru=A$r&e.-", +"=-.^Y@~Lp5e1)b^", +"J(uhX4)!&Q#2,jr" + }; + + unsigned int result[] = + { +0x4a17b156, +0x738bec38, +0xcd56f3c6, +0x9732147f, +0x12c660a3 + }; + const char *s1 = "Hello "; + const char *s2 = "World"; + + for (i = 0; i < sizeof(data) / sizeof(data[0]); ++i) + { +ret = eina_crc(data[i], strlen(data[i]), seed, EINA_TRUE); +fail_if(ret != result[i]); + } + + ret = eina_crc(s1, strlen(s1), 0x, EINA_TRUE); + ret = eina_crc(s2, strlen(s2), ret, EINA_FALSE); + fail_if(ret != result[0]); +} +END_TEST + +void eina_test_crc(TCase *tc) +{ + tcase_add_test(tc, eina_crc_simple); +} --
[EGIT] [core/efl] master 02/05: eina: add test case for eina_file_copy function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=be5eb3f2dead798da7bfb7a4a02a7065cf9ab550 commit be5eb3f2dead798da7bfb7a4a02a7065cf9ab550 Author: vivek Date: Mon May 18 10:52:54 2015 +0200 eina: add test case for eina_file_copy function. Summary: Added test case for eina_file_copy function to check copying of two files Signed-off-by: vivek Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2449 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_file.c | 68 + 1 file changed, 68 insertions(+) diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c index 766ff46..c94f821 100644 --- a/src/tests/eina/eina_test_file.c +++ b/src/tests/eina/eina_test_file.c @@ -30,6 +30,7 @@ #include "eina_suite.h" #include "Eina.h" #include "eina_safety_checks.h" +#include "eina_file_common.h" static int default_dir_rights = 0777; const int file_min_offset = 1; @@ -580,6 +581,72 @@ START_TEST(eina_test_file_xattr) END_TEST #endif +START_TEST(eina_test_file_copy) +{ + const char *test_file1_name = "EinaCopyFromXX.txt"; + const char *test_file2_name = "EinaCopyToXX.txt"; + Eina_Tmpstr *test_file1_path, *test_file2_path; + const char *data = "abcdefghijklmnopqrstuvwxyz"; + Eina_File *e_file1, *e_file2; + int fd1, fd2, rval; + size_t file1_len, file2_len; + Eina_Bool ret; + void *content1, *content2; + + eina_init(); + + fd1 = eina_file_mkstemp(test_file1_name, &test_file1_path); + fail_if(fd1 <= 0); + + fd2 = eina_file_mkstemp(test_file2_name, &test_file2_path); + fail_if(fd2 <= 0); + + fail_if(write(fd1, data, strlen(data)) != (ssize_t) strlen(data)); + + close(fd1); + close(fd2); + + //Copy file data + ret = eina_file_copy(test_file1_path, test_file2_path, EINA_FILE_COPY_DATA, NULL, NULL); + fail_if(ret != EINA_TRUE); + + e_file1 = eina_file_open(test_file1_path, EINA_FALSE); + fail_if(!e_file1); + file1_len = eina_file_size_get(e_file1); + + e_file2 = eina_file_open(test_file2_path, EINA_FALSE); + fail_if(!e_file2); + file2_len = eina_file_size_get(e_file2); + + //Check if both the files are same + fail_if(e_file1 == e_file2); + + fail_if(file1_len != strlen(data)); + fail_if(file1_len != file2_len); + + //Check the contents of both the file + content1 = eina_file_map_all(e_file1, EINA_FILE_POPULATE); + fail_if(content1 == NULL); + + content2 = eina_file_map_all(e_file2, EINA_FILE_POPULATE); + fail_if(content2 == NULL); + + rval = memcmp(content1, content2, strlen(data)); + fail_if(rval != 0); + + eina_file_map_free(e_file1, content1); + eina_file_map_free(e_file2, content2); + eina_file_close(e_file1); + eina_file_close(e_file2); + unlink(test_file1_path); + unlink(test_file2_path); + eina_tmpstr_del(test_file1_path); + eina_tmpstr_del(test_file2_path); + + eina_shutdown(); +} +END_TEST + void eina_test_file(TCase *tc) { @@ -593,4 +660,5 @@ eina_test_file(TCase *tc) #ifdef XATTR_TEST_DIR tcase_add_test(tc, eina_test_file_xattr); #endif + tcase_add_test(tc, eina_test_file_copy); } --
[EGIT] [core/elementary] master 03/06: elc_multibuttonentry: ported eo_event callbacks to use eo_event callback array
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=3c01ffd399ea68390475ec28923b8d0b05313a4b commit 3c01ffd399ea68390475ec28923b8d0b05313a4b Author: Vivek Ellur Date: Wed Sep 23 15:21:46 2015 -0700 elc_multibuttonentry: ported eo_event callbacks to use eo_event callback array Summary: Changed eo_event_callback_add to use eo_event_callback_array_add Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3097 Signed-off-by: Cedric BAIL --- src/lib/elc_multibuttonentry.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c index f9f3d6c..c094552 100644 --- a/src/lib/elc_multibuttonentry.c +++ b/src/lib/elc_multibuttonentry.c @@ -44,6 +44,26 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; +static Eina_Bool +_entry_changed_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_entry_focus_in_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_entry_focus_out_cb(void *data, Eo *obj EINA_UNUSED, +const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_entry_clicked_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); + +EO_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb, + { ELM_MULTIBUTTONENTRY_EVENT_CHANGED, _entry_changed_cb }, + { ELM_WIDGET_EVENT_FOCUSED, _entry_focus_in_cb }, + { ELM_WIDGET_EVENT_UNFOCUSED, _entry_focus_out_cb }, + { EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _entry_clicked_cb } +); + EOLIAN static Eina_Bool _elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) { @@ -1160,14 +1180,7 @@ _callbacks_register(Evas_Object *obj) (sd->entry, EVAS_CALLBACK_KEY_DOWN, _entry_key_down_cb, obj); evas_object_event_callback_add (sd->entry, EVAS_CALLBACK_RESIZE, _entry_resize_cb, obj); - eo_do(sd->entry, eo_event_callback_add - (ELM_MULTIBUTTONENTRY_EVENT_CHANGED, _entry_changed_cb, obj)); - eo_do(sd->entry, eo_event_callback_add - (ELM_WIDGET_EVENT_FOCUSED, _entry_focus_in_cb, obj)); - eo_do(sd->entry, eo_event_callback_add - (ELM_WIDGET_EVENT_UNFOCUSED, _entry_focus_out_cb, obj)); - eo_do(sd->entry, eo_event_callback_add - (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _entry_clicked_cb, obj)); + eo_do(sd->entry, eo_event_callback_array_add(_multi_buttonentry_cb(), obj)); } static void --
[EGIT] [core/elementary] master 05/06: elc_popup: ported eo_event callbacks to use eo_event arrays
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=4b160aaacee3238307916918acac9366fcc94d5b commit 4b160aaacee3238307916918acac9366fcc94d5b Author: Vivek Ellur Date: Wed Sep 23 15:23:46 2015 -0700 elc_popup: ported eo_event callbacks to use eo_event arrays Summary: Changed eo_event_callback_add to eo_event_callback_array_add function Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3099 Signed-off-by: Cedric BAIL --- src/lib/elc_popup.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c index 73a1302..a1d7849 100644 --- a/src/lib/elc_popup.c +++ b/src/lib/elc_popup.c @@ -44,12 +44,23 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); static void _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED); +static Eina_Bool +_block_clicked_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_timeout_cb(void *data, Eo *obj EINA_UNUSED, +const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); static const Elm_Action key_actions[] = { {"move", _key_action_move}, {NULL, NULL} }; +EO_CALLBACKS_ARRAY_DEFINE(_notify_cb, + { ELM_NOTIFY_EVENT_BLOCK_CLICKED, _block_clicked_cb }, + { ELM_NOTIFY_EVENT_TIMEOUT, _timeout_cb } +); + static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info); EOLIAN static Eina_Bool @@ -199,10 +210,8 @@ _elm_popup_evas_object_smart_del(Eo *obj, Elm_Popup_Data *sd) evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_RESIZE, _parent_geom_cb, obj); evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_MOVE, _parent_geom_cb, obj); - eo_do(sd->notify, eo_event_callback_del( - ELM_NOTIFY_EVENT_BLOCK_CLICKED, _block_clicked_cb, obj)); - eo_do(sd->notify, eo_event_callback_del( - ELM_NOTIFY_EVENT_TIMEOUT, _timeout_cb, obj)); + eo_do(sd->notify, + eo_event_callback_array_del(_notify_cb(), obj)); evas_object_event_callback_del (sd->content, EVAS_CALLBACK_DEL, _on_content_del); evas_object_event_callback_del(obj, EVAS_CALLBACK_SHOW, _on_show); @@ -1501,11 +1510,8 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv) _size_hints_changed_cb, priv->main_layout); priv->content_text_wrap_type = ELM_WRAP_MIXED; - eo_do(priv->notify, eo_event_callback_add - (ELM_NOTIFY_EVENT_BLOCK_CLICKED,_block_clicked_cb, obj)); - - eo_do(priv->notify, eo_event_callback_add - (ELM_NOTIFY_EVENT_TIMEOUT, _timeout_cb, obj)); + eo_do(priv->notify, + eo_event_callback_array_add(_notify_cb(), obj)); elm_widget_can_focus_set(obj, EINA_TRUE); elm_widget_can_focus_set(priv->main_layout, EINA_TRUE); --
[EGIT] [core/elementary] master 04/06: elc_player: ported eo_event callbacks to use eo_event arrays
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=cd659af5231477ddd8b98890247261a4f6d5e9cc commit cd659af5231477ddd8b98890247261a4f6d5e9cc Author: Vivek Ellur Date: Wed Sep 23 15:23:11 2015 -0700 elc_player: ported eo_event callbacks to use eo_event arrays Summary: Changed eo_event_callback_add to use eo_event_callback_array_add Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3098 Signed-off-by: Cedric BAIL --- src/lib/elc_player.c | 59 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c index 1eeb35d..ac4a23f 100644 --- a/src/lib/elc_player.c +++ b/src/lib/elc_player.c @@ -57,6 +57,28 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { { NULL, NULL } }; +static Eina_Bool +_update_frame(void *data, Eo *obj, + const Eo_Event_Description *desc, void *event_info); +static Eina_Bool +_update_slider(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_play_started(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_play_finished(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_update_position(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_drag_start(void *data, Eo *obj EINA_UNUSED, +const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_drag_stop(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); + static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); static Eina_Bool _key_action_play(Evas_Object *obj, const char *params); @@ -66,6 +88,21 @@ static const Elm_Action key_actions[] = { {NULL, NULL} }; +EO_CALLBACKS_ARRAY_DEFINE(_emotion_cb, + { EMOTION_OBJECT_EVENT_FRAME_DECODE, _update_frame }, + { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _update_slider }, + { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _update_slider }, + { EMOTION_OBJECT_EVENT_POSITION_UPDATE, _update_frame }, + { EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _play_started }, + { EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _play_finished } +); + +EO_CALLBACKS_ARRAY_DEFINE(_slider_cb, + { ELM_SLIDER_EVENT_CHANGED, _update_position }, + { ELM_SLIDER_EVENT_SLIDER_DRAG_START, _drag_start }, + { ELM_SLIDER_EVENT_SLIDER_DRAG_STOP, _drag_stop } +); + static Eina_Bool _key_action_move(Evas_Object *obj, const char *params) { @@ -625,18 +662,8 @@ _elm_player_elm_container_content_set(Eo *obj, Elm_Player_Data *sd, const char * elm_layout_signal_emit(obj, "elm,player,play", "elm"); else elm_layout_signal_emit(obj, "elm,player,pause", "elm"); - eo_do(sd->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_FRAME_DECODE, _update_frame, obj)); - eo_do(sd->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_FRAME_RESIZE, _update_slider, obj)); - eo_do(sd->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _update_slider, obj)); - eo_do(sd->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_POSITION_UPDATE, _update_frame, obj)); - eo_do(sd->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _play_started, obj)); - eo_do(sd->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _play_finished, obj)); + eo_do(sd->emotion, + eo_event_callback_array_add(_emotion_cb(), obj)); /* FIXME: track info from video */ end: @@ -683,12 +710,8 @@ _elm_player_evas_object_smart_add(Eo *obj, Elm_Player_Data *priv) (priv->slider, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_content_set(obj, "elm.swallow.media_player.positionslider", priv->slider); - eo_do(priv->slider, eo_event_callback_add - (ELM_SLIDER_EVENT_CHANGED, _update_position, obj)); - eo_do(priv->slider, eo_event_callback_add - (ELM_SLIDER_EVENT_SLIDER_DRAG_START, _drag_start, obj)); - eo_do(priv->slider, eo_event_callback_add - (ELM_SLIDER_EVENT_SLIDER_DRAG_STOP, _drag_stop, obj)); + eo_do(priv->slider, + eo_event_callback_array_add(_slider_cb(), obj)); priv->vslider = elm_slider_add(obj); elm_slider_indicator_show_set(priv->vslider, EINA_FALSE); --
[EGIT] [core/elementary] master 02/06: elm_spinner: ported eo_event_callbacks to use eo_event arrays
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=baa946bbf786e3db7922ad212d57c094573350d0 commit baa946bbf786e3db7922ad212d57c094573350d0 Author: Vivek Ellur Date: Wed Sep 23 15:03:48 2015 -0700 elm_spinner: ported eo_event_callbacks to use eo_event arrays Summary: Ported eo_event_callback_add to use eo_event_callback_array_add Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3092 Signed-off-by: Cedric BAIL --- src/lib/elm_spinner.c | 67 +++ 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 09cb983..3c5b31b 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -41,12 +41,49 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { static Eina_Bool _key_action_spin(Evas_Object *obj, const char *params); static Eina_Bool _key_action_toggle(Evas_Object *obj, const char *params); +static Eina_Bool +_inc_button_clicked_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_inc_button_pressed_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_inc_button_unpressed_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_inc_dec_button_mouse_move_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info); +static Eina_Bool +_dec_button_clicked_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_dec_button_pressed_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); +static Eina_Bool +_dec_button_unpressed_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED); + static const Elm_Action key_actions[] = { {"spin", _key_action_spin}, {"toggle", _key_action_toggle}, {NULL, NULL} }; +EO_CALLBACKS_ARRAY_DEFINE(_inc_button_cb, + { EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _inc_button_clicked_cb}, + { EVAS_CLICKABLE_INTERFACE_EVENT_PRESSED, _inc_button_pressed_cb}, + { EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED, _inc_button_unpressed_cb}, + { EVAS_OBJECT_EVENT_MOUSE_MOVE, _inc_dec_button_mouse_move_cb } +); + +EO_CALLBACKS_ARRAY_DEFINE(_dec_button_cb, + { EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _dec_button_clicked_cb}, + { EVAS_CLICKABLE_INTERFACE_EVENT_PRESSED, _dec_button_pressed_cb}, + { EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED, _dec_button_unpressed_cb}, + { EVAS_OBJECT_EVENT_MOUSE_MOVE, _inc_dec_button_mouse_move_cb } +); + + static void _access_increment_decrement_info_say(Evas_Object *obj, Eina_Bool is_incremented); @@ -747,10 +784,9 @@ _dec_button_unpressed_cb(void *data, return EINA_TRUE; } -static void -_inc_dec_button_mouse_move_cb(void *data, - Evas *evas EINA_UNUSED, - Evas_Object *obj EINA_UNUSED, +static Eina_Bool +_inc_dec_button_mouse_move_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info) { Evas_Event_Mouse_Move *ev = event_info; @@ -761,6 +797,8 @@ _inc_dec_button_mouse_move_cb(void *data, ecore_timer_del(sd->longpress_timer); sd->longpress_timer = NULL; } + + return EINA_TRUE; } EOLIAN static void @@ -1039,15 +1077,8 @@ _elm_spinner_evas_object_smart_add(Eo *obj, Elm_Spinner_Data *priv) priv->inc_button = elm_button_add(obj); elm_object_style_set(priv->inc_button, "spinner/increase/default"); -eo_do(priv->inc_button, eo_event_callback_add - (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _inc_button_clicked_cb, obj)); -eo_do(priv->inc_button, eo_event_callback_add - (EVAS_CLICKABLE_INTERFACE_EVENT_PRESSED, _inc_button_pressed_cb, obj)); -eo_do(priv->inc_button, eo_event_callback_add - (EVAS_CLICKABLE_INTERFACE_EVENT_UNPRESSED, _inc_button_unpressed_cb, obj)); -evas_object_event_callback_add - (priv->inc_button, EVAS_CALLBACK_MOUSE_MOVE, _inc_dec_button_mouse_move_cb, obj); - +eo_do(priv->inc_button, + eo_event_callback_array_add(_inc_button_cb(), obj)); elm_layout_content_set(obj, "elm.swallow.inc_b
[EGIT] [core/elementary] master 01/06: elm_video: port eo_event callbacks to use eo_event arrays
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=ba30cf95b58aaeae5d877d79f8ce2d73a7dcb257 commit ba30cf95b58aaeae5d877d79f8ce2d73a7dcb257 Author: Vivek Ellur Date: Sun Oct 4 12:05:51 2015 +0200 elm_video: port eo_event callbacks to use eo_event arrays Summary: Changed eo_event_callback_add to use eo_event_callback_array_add in elm_video.c Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3096 Signed-off-by: Cedric BAIL --- src/lib/elm_video.c | 49 + 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c index 3502971..aea83a9 100644 --- a/src/lib/elm_video.c +++ b/src/lib/elm_video.c @@ -27,6 +27,32 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; + +static Eina_Bool +_on_open_done(void *data, + Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED); +static Eina_Bool +_on_playback_started(void *data, + Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED); +static Eina_Bool +_on_playback_finished(void *data, + Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED); +static Eina_Bool +_on_aspect_ratio_updated(void *data, + Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED); +static Eina_Bool +_on_title_changed(void *data, + Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED); +static Eina_Bool +_on_audio_level_changed(void *data, +Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, +void *event_info EINA_UNUSED); + static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); static Eina_Bool _key_action_play(Evas_Object *obj, const char *params); @@ -36,6 +62,15 @@ static const Elm_Action key_actions[] = { {NULL, NULL} }; +EO_CALLBACKS_ARRAY_DEFINE(_video_cb, + { EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done }, + { EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started }, + { EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished }, + { EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated }, + { EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed }, + { EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed } +); + static Eina_Bool _key_action_move(Evas_Object *obj, const char *params) { @@ -155,6 +190,7 @@ _on_playback_started(void *data, return EINA_TRUE; } + static Eina_Bool _on_playback_finished(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, @@ -251,18 +287,7 @@ _elm_video_evas_object_smart_add(Eo *obj, Elm_Video_Data *priv) elm_layout_content_set(obj, "elm.swallow.video", priv->emotion); - eo_do(priv->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done, obj)); - eo_do(priv->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started, obj)); - eo_do(priv->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished, obj)); - eo_do(priv->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated, obj)); - eo_do(priv->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed, obj)); - eo_do(priv->emotion, eo_event_callback_add - (EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed, obj)); + eo_do(priv->emotion, eo_event_callback_array_add(_video_cb(), obj)); evas_object_event_callback_add (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL); --
[EGIT] [core/efl] master 02/09: eio_monitor: fix memory leak issue
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=491fdb94b0c85aff965662a2152863cd3bd19d11 commit 491fdb94b0c85aff965662a2152863cd3bd19d11 Author: Vivek Ellur Date: Thu Oct 8 12:16:23 2015 +0200 eio_monitor: fix memory leak issue Summary: @fix Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3161 Signed-off-by: Cedric BAIL --- src/lib/eio/eio_monitor_cocoa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/eio/eio_monitor_cocoa.c b/src/lib/eio/eio_monitor_cocoa.c index 8cadeaf..d491de4 100644 --- a/src/lib/eio/eio_monitor_cocoa.c +++ b/src/lib/eio/eio_monitor_cocoa.c @@ -330,6 +330,8 @@ void eio_monitor_backend_add(Eio_Monitor *monitor) if (!_stream) { +free(monitor_path); +free(backend); eio_monitor_fallback_add(monitor); return; } --
[EGIT] [core/efl] master 03/09: eio_monitor: fix memory leak in eio monitor module
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d64f50acfc01400e7465cf0288df09dfce7c3a94 commit d64f50acfc01400e7465cf0288df09dfce7c3a94 Author: Vivek Ellur Date: Thu Oct 8 12:17:29 2015 +0200 eio_monitor: fix memory leak in eio monitor module Summary: Free the allocated memory in eio monitor win32 module. Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3160 Signed-off-by: Cedric BAIL --- src/lib/eio/eio_monitor_win32.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eio/eio_monitor_win32.c b/src/lib/eio/eio_monitor_win32.c index 06a5f0c..43c38f3 100644 --- a/src/lib/eio/eio_monitor_win32.c +++ b/src/lib/eio/eio_monitor_win32.c @@ -86,7 +86,10 @@ _eio_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh EINA_UNUSED) return 0; if (fni->FileName[0] == 0) -return ECORE_CALLBACK_CANCEL; +{ + free(wname); + return ECORE_CALLBACK_CANCEL; +} memcpy(wname, fni->FileName, fni->FileNameLength); wname[fni->FileNameLength / sizeof(wchar_t)] = 0; --
[EGIT] [core/efl] master 03/05: eina_tiler: add test cases for eina tiler area set/get functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2136ad5ecb8ec7860eba0e038e69c0f101e15144 commit 2136ad5ecb8ec7860eba0e038e69c0f101e15144 Author: Vivek Ellur Date: Mon Oct 12 12:11:53 2015 -0700 eina_tiler: add test cases for eina tiler area set/get functions Summary: Added test cases for eina_tiler_area_size_set and get functions Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3164 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_tiler.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tests/eina/eina_test_tiler.c b/src/tests/eina/eina_test_tiler.c index 6766b62..0f3961e 100644 --- a/src/tests/eina/eina_test_tiler.c +++ b/src/tests/eina/eina_test_tiler.c @@ -134,10 +134,20 @@ START_TEST(eina_test_tiler_all) Eina_Rectangle *rp; Eina_Rectangle r; int i = 0; + int width, height; eina_init(); - tl = eina_tiler_new(640, 480); + tl = eina_tiler_new(1, 1); + + eina_tiler_area_size_get(tl, &width, &height); + fail_if(width != 1 && height != 1); + + width = 640; + height = 480; + eina_tiler_area_size_set(tl, width, height); + eina_tiler_area_size_get(tl, &width, &height); + fail_if(width != 640 && height != 480); eina_tiler_tile_size_set(tl, 32, 32); --
[EGIT] [core/efl] master 02/05: eina_queue: add test cases in eina thread queue module
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4f604e4d1ee0d32d48d13676f2aef514b47c4885 commit 4f604e4d1ee0d32d48d13676f2aef514b47c4885 Author: Vivek Ellur Date: Mon Oct 12 12:09:04 2015 -0700 eina_queue: add test cases in eina thread queue module Summary: Added test cases for eina_thread_queue_parent_get and eina_thread_queue_fd_get functions Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3165 Signed-off-by: Cedric BAIL --- .../ecore/ecore_test_ecore_thread_eina_thread_queue.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c index 616cb72..d5bdc27 100644 --- a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c +++ b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c @@ -196,6 +196,8 @@ th22_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3) { int val1 = 99, val2 = 99, cnt = 0; + Eina_Thread_Queue *parent; + eina_init(); ecore_init(); @@ -204,6 +206,12 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3) thqmaster = eina_thread_queue_new(); eina_thread_queue_parent_set(thq1, thqmaster); eina_thread_queue_parent_set(thq2, thqmaster); + + parent = eina_thread_queue_parent_get(thq1); + fail_if(parent != thqmaster); + parent = eina_thread_queue_parent_get(thq2); + fail_if(parent != thqmaster); + ecore_thread_feedback_run(th21_do, NULL, NULL, NULL, NULL, EINA_TRUE); ecore_thread_feedback_run(th22_do, NULL, NULL, NULL, NULL, EINA_TRUE); for (;;) @@ -546,7 +554,7 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7) { Msg7 *msg; void *ref; - int msgcnt = 0; + int msgcnt = 0, ret; eina_init(); ecore_init(); @@ -558,6 +566,10 @@ START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7) fail(); } eina_thread_queue_fd_set(thq1, p[1]); + + ret = eina_thread_queue_fd_get(thq1); + fail_if(ret != p[1]); + ecore_thread_feedback_run(thspeed21_do, NULL, NULL, NULL, NULL, EINA_TRUE); for (;;) { --
[EGIT] [core/elementary] master 02/02: elm_index: Fix memory leak issue in realloc failure
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=4492153c6ad360a97ab990f340ebf5be55218789 commit 4492153c6ad360a97ab990f340ebf5be55218789 Author: Vivek Ellur Date: Thu Oct 22 12:38:28 2015 -0700 elm_index: Fix memory leak issue in realloc failure Summary: @Fix Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3214 --- src/lib/elm_index.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c index 83194a7..7f3cb39 100644 --- a/src/lib/elm_index.c +++ b/src/lib/elm_index.c @@ -770,14 +770,17 @@ _sel_eval(Evas_Object *obj, { if (label && last) { -label = realloc(label, strlen(label) + +char *temp; + +temp = realloc(label, strlen(label) + strlen(last) + 1); -if (!label) +if (!temp) { + free(label); free(last); return; } -strcat(label, last); +label = strcat(temp, last); } } free(last); --
[EGIT] [core/elementary] master 01/02: dayselector: fix warning related to argument type
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=a10e9664c8a51e9d8d8997ab53ec7e76b9a26220 commit a10e9664c8a51e9d8d8997ab53ec7e76b9a26220 Author: Vivek Ellur Date: Thu Oct 22 12:37:44 2015 -0700 dayselector: fix warning related to argument type Summary: @fix Signed-off-by: Vivek Ellur Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3215 Signed-off-by: Cedric BAIL --- src/lib/elm_dayselector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elm_dayselector.c b/src/lib/elm_dayselector.c index 6f60147..0f76ab9 100644 --- a/src/lib/elm_dayselector.c +++ b/src/lib/elm_dayselector.c @@ -401,7 +401,7 @@ _items_create(Evas_Object *obj) strftime(buf, sizeof(buf), "%a", &time_daysel); elm_object_text_set(chk, buf); -snprintf(buf, sizeof(buf), "day%d", idx); +snprintf(buf, sizeof(buf), "day%u", idx); elm_layout_content_set(obj, buf, chk); // XXX: ACCESS --
[EGIT] [core/efl] master 05/12: ector: fix null pointer dereference issue
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=96f936e6d371421809b2f8804b029f966e2b14d7 commit 96f936e6d371421809b2f8804b029f966e2b14d7 Author: Vivek Ellur Date: Fri Oct 30 06:39:15 2015 +0100 ector: fix null pointer dereference issue Summary: Fix Coverity CID1293003 Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3220 Signed-off-by: Cedric BAIL --- src/lib/ector/software/ector_software_rasterizer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index b436eed..0cb74a0 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -50,6 +50,9 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data) if (data->type == LinearGradient) fetchfunc = &fetch_linear_gradient; if (data->type == RadialGradient) fetchfunc = &fetch_radial_gradient; + if (!fetchfunc) + return; + comp_func = ector_comp_func_span_get(data->op, data->mul_col, data->gradient->alpha); // move to the offset location --
[EGIT] [core/efl] master 12/12: ecore: add test case for idler enterer function
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=081e9894d4c5636ed3bd59344cebca1b0a7fe7a3 commit 081e9894d4c5636ed3bd59344cebca1b0a7fe7a3 Author: Vivek Ellur Date: Sat Oct 31 02:37:17 2015 +0100 ecore: add test case for idler enterer function Summary: Added test case for ecore_idle_enterer_before_add function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3253 Signed-off-by: Cedric BAIL --- src/tests/ecore/ecore_test_ecore.c | 21 + 1 file changed, 21 insertions(+) diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c index 08a00e2..a5331b4 100644 --- a/src/tests/ecore/ecore_test_ecore.c +++ b/src/tests/ecore/ecore_test_ecore.c @@ -106,6 +106,26 @@ START_TEST(ecore_test_ecore_main_loop_idle_enterer) } END_TEST +START_TEST(ecore_test_ecore_main_loop_idle_before_enterer) +{ + Eina_Bool did = EINA_FALSE; + Ecore_Idle_Enterer *idle_enterer; + int ret; + + ret = ecore_init(); + fail_if(ret < 1); + + idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did); + fail_if(idle_enterer == NULL); + + ecore_main_loop_begin(); + + fail_if(did == EINA_FALSE); + + ret = ecore_shutdown(); +} +END_TEST + START_TEST(ecore_test_ecore_main_loop_idle_exiter) { Eina_Bool did = EINA_FALSE; @@ -681,6 +701,7 @@ void ecore_test_ecore(TCase *tc) tcase_add_test(tc, ecore_test_ecore_main_loop); tcase_add_test(tc, ecore_test_ecore_main_loop_idler); tcase_add_test(tc, ecore_test_ecore_main_loop_idle_enterer); + tcase_add_test(tc, ecore_test_ecore_main_loop_idle_before_enterer); tcase_add_test(tc, ecore_test_ecore_main_loop_idle_exiter); tcase_add_test(tc, ecore_test_ecore_main_loop_timer); tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler); --
[EGIT] [core/efl] master 03/12: eina_quaternion: add test case for rotation function
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=dc391da42430624e1ee91bfba8fc326a9c77ed83 commit dc391da42430624e1ee91bfba8fc326a9c77ed83 Author: Vivek Ellur Date: Fri Oct 30 04:00:33 2015 +0100 eina_quaternion: add test case for rotation function Summary: Added test case for eina_quaternion_rotate function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3246 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_quaternion.c | 21 + 1 file changed, 21 insertions(+) diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index e1b876b..2401dcb 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -453,6 +453,26 @@ START_TEST(eina_test_quaternion_f16p16_rotate_matrix) } END_TEST +START_TEST(eina_test_quaternion_rotate) +{ + Eina_Point_3D r = { 3, 3, 3 }; + Eina_Point_3D c = { 0, 0, 0}, res = {3.0, 3.0, 3.0}; + Eina_Point_3D res1 = {3.0, 3.0, -9.0}; + Eina_Quaternion q = {1, 1, 1, 0}; + + eina_init(); + + eina_quaternion_rotate(&r, &c, &q); + fail_if(!eina_point_3d_cmp(&r, &res)); + + eina_quaternion_set(&q, 1, 1, 0, 0); + eina_quaternion_rotate(&r, &c, &q); + fail_if(!eina_point_3d_cmp(&r, &res1)); + + eina_shutdown(); +} +END_TEST + void eina_test_quaternion(TCase *tc) { @@ -471,4 +491,5 @@ eina_test_quaternion(TCase *tc) tcase_add_test(tc, eina_test_quaternion_f16p16_lerp); tcase_add_test(tc, eina_test_quaternion_lerp); tcase_add_test(tc, eina_test_quaternion_f16p16_rotate_matrix); + tcase_add_test(tc, eina_test_quaternion_rotate); } --
[EGIT] [core/efl] master 02/12: eina_quaternion: add test cases for quaternion rotation functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6090073dee6b8a283a2d404efde8ec9205e485d9 commit 6090073dee6b8a283a2d404efde8ec9205e485d9 Author: Vivek Ellur Date: Fri Oct 30 03:59:21 2015 +0100 eina_quaternion: add test cases for quaternion rotation functions Summary: Added test cases for eina_quaternion_f16p16_rotate and eina_quaternion_f16p16_rotation_matrix3_get functions Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3247 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_quaternion.c | 40 +++ 1 file changed, 40 insertions(+) diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index 058ca3c..e1b876b 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -57,6 +57,22 @@ eina_matrix3_cmp(const Eina_Matrix3 *a, const Eina_Matrix3 *b) } static inline Eina_Bool +eina_matrix3_f16p16_cmp(const Eina_Matrix3_F16p16 *a, const Eina_Matrix3_F16p16 *b) +{ + if ((a->xx == b->xx) && + (a->xy == b->xy) && + (a->xz == b->xz) && + (a->yx == b->yx) && + (a->yy == b->yy) && + (a->yz == b->yz) && + (a->zx == b->zx) && + (a->zy == b->zy) && + (a->zz == b->zz)) + return EINA_TRUE; + return EINA_FALSE; +} + +static inline Eina_Bool eina_point_3d_cmp(const Eina_Point_3D *a, const Eina_Point_3D *b) { if (FLOAT_CMP(a->x, b->x) && @@ -414,6 +430,29 @@ START_TEST(eina_test_quaternion_lerp) } END_TEST +START_TEST(eina_test_quaternion_f16p16_rotate_matrix) +{ + Eina_Quaternion_F16p16 q = {65536, 65536, 65536, 0}; + Eina_Point_3D_F16p16 r = { 65536, 65536, 65536 }; + Eina_Point_3D_F16p16 c = { 0, 0, 0 }, res = {65536, 65536, 65536}; + Eina_Matrix3_F16p16 m, mres = {-262144, 131072, 131072, + 131072, -262144, 131072, + 131072, 131072, -262144 }; + + eina_init(); + + eina_quaternion_f16p16_rotate(&r, &c, &q); + fail_if(r.x != res.x || + r.y != res.y || + r.z != res.z); + + eina_quaternion_f16p16_rotation_matrix3_get(&m, &q); + fail_if(!eina_matrix3_f16p16_cmp(&m, &mres)); + + eina_shutdown(); +} +END_TEST + void eina_test_quaternion(TCase *tc) { @@ -431,4 +470,5 @@ eina_test_quaternion(TCase *tc) tcase_add_test(tc, eina_test_matrix_recompose); tcase_add_test(tc, eina_test_quaternion_f16p16_lerp); tcase_add_test(tc, eina_test_quaternion_lerp); + tcase_add_test(tc, eina_test_quaternion_f16p16_rotate_matrix); } --
[EGIT] [core/efl] master 04/12: eina_hash: add test cases for eina_hash_add/del by hash functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=85f8daac6d3554f980d8737ee7b904d6a5be203d commit 85f8daac6d3554f980d8737ee7b904d6a5be203d Author: Vivek Ellur Date: Fri Oct 30 04:06:25 2015 +0100 eina_hash: add test cases for eina_hash_add/del by hash functions Summary: Added test cases for eina_hash_add_by_hash/del_by_hash functions Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3245 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_hash.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/src/tests/eina/eina_test_hash.c b/src/tests/eina/eina_test_hash.c index b2f9704..cc44bff 100644 --- a/src/tests/eina/eina_test_hash.c +++ b/src/tests/eina/eina_test_hash.c @@ -418,6 +418,40 @@ START_TEST(eina_hash_seed) } END_TEST +START_TEST(eina_hash_add_del_by_hash) +{ + Eina_Hash *hash = NULL; + int array[] = { 1, 42, 4, 5, 6 }; + int key_len, key_hash; + + fail_if(eina_init() != 2); + + hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length), +EINA_KEY_CMP(_eina_string_key_cmp), +EINA_KEY_HASH(eina_hash_crc), +NULL, +EINA_HASH_BUCKET_SIZE); + fail_if(hash == NULL); + fail_if(eina_hash_add(hash, "1", &array[0]) != EINA_TRUE); + fail_if(eina_hash_add(hash, "42", &array[1]) != EINA_TRUE); + fail_if(eina_hash_add(hash, "5", &array[3]) != EINA_TRUE); + fail_if(eina_hash_add(hash, "6", &array[4]) != EINA_TRUE); + + key_len = _eina_string_key_length("4"); + key_hash = eina_hash_crc("4", key_len); + + fail_if(eina_hash_add_by_hash(hash, "4", key_len, key_hash, &array[2]) != EINA_TRUE); + fail_if(eina_hash_del_by_hash(hash, "4", key_len, key_hash, &array[2]) != EINA_TRUE); + fail_if(eina_hash_del_by_hash(hash, "4", key_len, key_hash, &array[2]) != EINA_FALSE); + + key_len = _eina_string_key_length("42"); + key_hash = eina_hash_crc("42", key_len); + fail_if(eina_hash_del_by_hash(hash, "42", key_len, key_hash, &array[1]) != EINA_TRUE); + + fail_if(eina_hash_population(hash) != 3); +} +END_TEST + void eina_test_hash(TCase *tc) { tcase_add_test(tc, eina_hash_simple); @@ -428,4 +462,5 @@ void eina_test_hash(TCase *tc) tcase_add_test(tc, eina_hash_seed); tcase_add_test(tc, eina_hash_int32_fuzze); tcase_add_test(tc, eina_hash_string_fuzze); + tcase_add_test(tc, eina_hash_add_del_by_hash); } --
[EGIT] [core/efl] master 01/12: eina_quaternion: correct the API name in header file
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0080ee0d607faa82a4376f9366ffb9e638a32f25 commit 0080ee0d607faa82a4376f9366ffb9e638a32f25 Author: Vivek Ellur Date: Fri Oct 30 03:57:06 2015 +0100 eina_quaternion: correct the API name in header file Summary: This is not an ABI break as we never did provide the broken name symbol, just a typo in the header that wasn't detected until now. @fix Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3248 Signed-off-by: Cedric BAIL --- src/lib/eina/eina_quaternion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/eina/eina_quaternion.h b/src/lib/eina/eina_quaternion.h index c63aeab..df66589 100644 --- a/src/lib/eina/eina_quaternion.h +++ b/src/lib/eina/eina_quaternion.h @@ -87,7 +87,7 @@ EAPI void eina_quaternion_f16p16_nlerp(Eina_Quaternion_F16p16 *out, EAPI void eina_quaternion_f16p16_rotate(Eina_Point_3D_F16p16 *p, const Eina_Point_3D_F16p16 *center, const Eina_Quaternion_F16p16 *q); /**< @since 1.15 */ -EAPI void eina_quaternion_f16p16_rotation_matri3_get(Eina_Matrix3_F16p16 *m, +EAPI void eina_quaternion_f16p16_rotation_matrix3_get(Eina_Matrix3_F16p16 *m, const Eina_Quaternion_F16p16 *q); /**< @since 1.15 */ EAPI void eina_quaternion_set(Eina_Quaternion *q, double x, --
[EGIT] [core/efl] master 15/24: eina: added test case for matrix4 transpose function
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b5e672aad883143184e61efe4a9a0df1110e3be1 commit b5e672aad883143184e61efe4a9a0df1110e3be1 Author: Vivek Ellur Date: Mon Nov 9 16:16:05 2015 -0800 eina: added test case for matrix4 transpose function Summary: Added test case for eina_matrix4_transpose function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3279 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_matrix.c | 12 1 file changed, 12 insertions(+) diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index 11cc2c6..50323fb 100644 --- a/src/tests/eina/eina_test_matrix.c +++ b/src/tests/eina/eina_test_matrix.c @@ -167,6 +167,18 @@ START_TEST(eina_matrix4) wy != wz || wz != 0); + eina_matrix4_values_set(&m, + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16); + + eina_matrix4_transpose(&n, &m); + fail_if(n.xx != 1 || n.xy != 5 || n.xz != 9 || n.xw != 13 || + n.yx != 2 || n.yy != 6 || n.yz != 10 || n.yw != 14 || + n.zx != 3 || n.zy != 7 || n.zz != 11 || n.zw != 15 || + n.wx != 4 || n.wy != 8 || n.wz != 12 || n.ww != 16); + eina_shutdown(); } END_TEST --
[EGIT] [core/efl] master 16/24: eina: add test case for eina list reverse iterator
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f06eedf3c339af6647fc216ca06f29de53831c70 commit f06eedf3c339af6647fc216ca06f29de53831c70 Author: Vivek Ellur Date: Mon Nov 9 16:17:24 2015 -0800 eina: add test case for eina list reverse iterator Summary: Added test case for eina_list_iterator_reversed_new function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3281 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_iterator.c | 66 + 1 file changed, 66 insertions(+) diff --git a/src/tests/eina/eina_test_iterator.c b/src/tests/eina/eina_test_iterator.c index 4c14dec..5c4b88d 100644 --- a/src/tests/eina/eina_test_iterator.c +++ b/src/tests/eina/eina_test_iterator.c @@ -287,6 +287,71 @@ START_TEST(eina_iterator_list_simple) } END_TEST +static Eina_Bool +eina_reverse_iterator_list_data_check(EINA_UNUSED const Eina_List *list, + int *data, + int *fdata) +{ + switch (*fdata) + { + case 0: fail_if(*data != 1337); break; + + case 1: fail_if(*data != 1); break; + + case 2: fail_if(*data != 42); break; + + case 3: fail_if(*data != 6); break; + + case 4: fail_if(*data != 9); break; + + case 5: fail_if(*data != 7); break; + + case 6: fail_if(*data != 81); break; + } + + (*fdata)++; + + return EINA_TRUE; +} + +START_TEST(eina_reverse_iterator_list_simple) +{ + Eina_List *list = NULL; + Eina_Iterator *it; + int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 }; + int i = 0; + + eina_init(); + + list = eina_list_append(list, &data[0]); + fail_if(list == NULL); + + list = eina_list_prepend(list, &data[1]); + fail_if(list == NULL); + + list = eina_list_append(list, &data[2]); + fail_if(list == NULL); + + list = eina_list_append(list, &data[3]); + fail_if(list == NULL); + + list = eina_list_prepend(list, &data[4]); + fail_if(list == NULL); + + list = eina_list_append(list, &data[5]); + fail_if(list == NULL); + + list = eina_list_prepend(list, &data[6]); + fail_if(list == NULL); + + it = eina_list_iterator_reversed_new(list); + fail_if(!it); + + eina_iterator_foreach(it, EINA_EACH_CB(eina_reverse_iterator_list_data_check), &i); + eina_iterator_free(it); +} +END_TEST + typedef struct _Eina_Rbtree_Int Eina_Rbtree_Int; struct _Eina_Rbtree_Int { @@ -461,5 +526,6 @@ eina_test_iterator(TCase *tc) tcase_add_test(tc, eina_iterator_hash_simple); tcase_add_test(tc, eina_iterator_inlist_simple); tcase_add_test(tc, eina_iterator_list_simple); + tcase_add_test(tc, eina_reverse_iterator_list_simple); tcase_add_test(tc, eina_iterator_rbtree_simple); } --
[EGIT] [core/efl] master 18/24: eina: add test cases for eina list move functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6bf43179cd128b3fe2d491c82b34e5cd729c1a30 commit 6bf43179cd128b3fe2d491c82b34e5cd729c1a30 Author: Vivek Ellur Date: Mon Nov 9 16:18:58 2015 -0800 eina: add test cases for eina list move functions Summary: Added test cases for eina_list_move and eina_list_move_list functions Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3285 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_list.c | 41 + 1 file changed, 41 insertions(+) diff --git a/src/tests/eina/eina_test_list.c b/src/tests/eina/eina_test_list.c index 1fea84b..1ae20cb 100644 --- a/src/tests/eina/eina_test_list.c +++ b/src/tests/eina/eina_test_list.c @@ -489,6 +489,46 @@ START_TEST(eina_test_clone) } END_TEST +START_TEST(eina_test_move) +{ + Eina_List *list1 = NULL, *list2 = NULL; + Eina_Bool ret; + int data1[] = {1, 2, 3, 4, 5}; + int data2[] = {6, 7, 8, 9, 10}; + int i, *list_data; + + eina_init(); + + for (i = 0; i < 5; i++) + { + list1 = eina_list_append(list1, &data1[i]); + list2 = eina_list_append(list2, &data2[i]); + } + fail_if(eina_list_count(list1) != 5); + fail_if(eina_list_count(list2) != 5); + + ret = eina_list_move(&list1, &list2, &data2[4]); + fail_if(ret != EINA_TRUE); + fail_if(eina_list_count(list1) != 6); + fail_if(eina_list_count(list2) != 4); + list_data = eina_list_nth(list1, 5); + fail_if(*list_data != 10); + + ret = eina_list_move_list(&list1, &list2, + eina_list_nth_list(list2, 1)); + fail_if(ret != EINA_TRUE); + fail_if(eina_list_count(list1) != 7); + fail_if(eina_list_count(list2) != 3); + list_data = eina_list_nth(list1, 6); + fail_if(*list_data != 7); + + eina_list_free(list1); + eina_list_free(list2); + + eina_shutdown(); +} +END_TEST + void eina_test_list(TCase *tc) { @@ -498,4 +538,5 @@ eina_test_list(TCase *tc) tcase_add_test(tc, eina_test_list_split); tcase_add_test(tc, eina_test_shuffle); tcase_add_test(tc, eina_test_clone); + tcase_add_test(tc, eina_test_move); } --
[EGIT] [core/efl] master 17/24: eina: add test case for list demote function
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fec6bd3fef426f75581ddffa0587db10da4052c6 commit fec6bd3fef426f75581ddffa0587db10da4052c6 Author: Vivek Ellur Date: Mon Nov 9 16:18:03 2015 -0800 eina: add test case for list demote function Summary: Added test case for eina_list_demote_list function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3283 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_list.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/tests/eina/eina_test_list.c b/src/tests/eina/eina_test_list.c index 4523311..1fea84b 100644 --- a/src/tests/eina/eina_test_list.c +++ b/src/tests/eina/eina_test_list.c @@ -77,6 +77,11 @@ START_TEST(eina_test_simple) list = eina_list_append(list, &data[2]); fail_if(list == NULL); + list = eina_list_demote_list(list, eina_list_nth_list(list, 1)); + test1 = eina_list_nth(list, 2); + fail_if(test1 == NULL); + fail_if(*test1 != 6); + list = eina_list_remove(list, &data[0]); fail_if(list == NULL); --
[EGIT] [core/efl] master 19/24: eina: add test case for list data idx function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4f6e158c13abf4182832df3e26c6af3a47e4b155 commit 4f6e158c13abf4182832df3e26c6af3a47e4b155 Author: Vivek Ellur Date: Mon Nov 9 16:19:43 2015 -0800 eina: add test case for list data idx function. Summary: Added test case for eina_list_data_idx function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3287 --- src/tests/eina/eina_test_list.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/tests/eina/eina_test_list.c b/src/tests/eina/eina_test_list.c index 1ae20cb..29d1d51 100644 --- a/src/tests/eina/eina_test_list.c +++ b/src/tests/eina/eina_test_list.c @@ -77,6 +77,15 @@ START_TEST(eina_test_simple) list = eina_list_append(list, &data[2]); fail_if(list == NULL); + i = eina_list_data_idx(list, &data[1]); + fail_if(i != 0); + + i = eina_list_data_idx(list, &data[2]); + fail_if(i != 2); + + i = eina_list_data_idx(list, &data[3]); + fail_if(i != -1); + list = eina_list_demote_list(list, eina_list_nth_list(list, 1)); test1 = eina_list_nth(list, 2); fail_if(test1 == NULL); --
[EGIT] [core/efl] master 22/24: eina: add test case for eina list search function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7fa841236b38e5816b7f1fc7737a27e09f19a663 commit 7fa841236b38e5816b7f1fc7737a27e09f19a663 Author: Vivek Ellur Date: Mon Nov 9 16:22:21 2015 -0800 eina: add test case for eina list search function. Summary: Added test case for eina_list_search_sorted function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3290 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_list.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/tests/eina/eina_test_list.c b/src/tests/eina/eina_test_list.c index 29d1d51..b23fa87 100644 --- a/src/tests/eina/eina_test_list.c +++ b/src/tests/eina/eina_test_list.c @@ -310,6 +310,7 @@ START_TEST(eina_test_sorted_insert) int i, count; Eina_List *l1, *l2, *itr; void *d; + int *res, val = 2009; eina_init(); @@ -322,6 +323,12 @@ START_TEST(eina_test_sorted_insert) fail_if(l1 == NULL); fail_if(!eina_list_sorted_check(l1)); + res = eina_list_search_sorted(l1, eina_int_cmp, &data[7]); + fail_if(*res != 1664); + + res = eina_list_search_sorted(l1, eina_int_cmp, &val); + fail_if(res != NULL); + l2 = NULL; EINA_LIST_FOREACH(l1, itr, d) l2 = eina_list_sorted_insert(l2, eina_int_cmp, d); --
[EGIT] [core/efl] master 23/24: eina: add test case for file statat function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=873562608eb99c689e3216a017b46c51a93742a3 commit 873562608eb99c689e3216a017b46c51a93742a3 Author: Vivek Ellur Date: Mon Nov 9 16:26:21 2015 -0800 eina: add test case for file statat function. Summary: Added test case for eina_file_statat function Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3293 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_file.c | 50 + 1 file changed, 50 insertions(+) diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c index dc73f12..617ce88 100644 --- a/src/tests/eina/eina_test_file.c +++ b/src/tests/eina/eina_test_file.c @@ -681,6 +681,55 @@ START_TEST(eina_test_file_copy) } END_TEST +START_TEST(eina_test_file_statat) +{ + Eina_Tmpstr *test_file1_path, *test_file2_path; + Eina_Iterator *it; + Eina_Stat st; + Eina_File_Direct_Info *info; + const char *template = "abcdefghijklmnopqrstuvwxyz"; + int template_size = strlen(template); + int fd, ret; + + eina_init(); + + Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir(); + fail_if(test_dirname == NULL); + + test_file1_path = get_full_path(test_dirname, "example1.txt"); + test_file2_path = get_full_path(test_dirname, "example2.txt"); + + fd = open(test_file1_path, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); + fail_if(fd == 0); + fail_if(write(fd, template, template_size) != template_size); + close(fd); + + fd = open(test_file2_path, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); + fail_if(fd == 0); + fail_if(write(fd, template, template_size) != template_size); + close(fd); + + it = eina_file_stat_ls(test_dirname); + fprintf(stderr, "file=%s\n", test_dirname); + EINA_ITERATOR_FOREACH(it, info) + { +ret = eina_file_statat(eina_iterator_container_get(it), info, &st); +fprintf(stderr, "ret=%d\n", ret); +fail_if(ret != 0); +fail_if(st.size != template_size); + } + + unlink(test_file1_path); + unlink(test_file2_path); + fail_if(rmdir(test_dirname) != 0); + eina_tmpstr_del(test_file1_path); + eina_tmpstr_del(test_file2_path); + eina_tmpstr_del(test_dirname); + + eina_shutdown(); +} +END_TEST + void eina_test_file(TCase *tc) { @@ -695,4 +744,5 @@ eina_test_file(TCase *tc) tcase_add_test(tc, eina_test_file_xattr); #endif tcase_add_test(tc, eina_test_file_copy); + tcase_add_test(tc, eina_test_file_statat); } --
[EGIT] [core/enlightenment] master 01/03: e: Fix realloc issue in e font module
discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=f026fdf9b345837d1145f657b2c8ef04765acc60 commit f026fdf9b345837d1145f657b2c8ef04765acc60 Author: Vivek Ellur Date: Tue Nov 10 12:26:14 2015 -0500 e: Fix realloc issue in e font module Summary: @Fix Signed-off-by: Vivek Ellur Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3306 --- src/bin/e_font.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/e_font.c b/src/bin/e_font.c index e1f4e74..81423ac 100644 --- a/src/bin/e_font.c +++ b/src/bin/e_font.c @@ -159,7 +159,7 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con s1 = strchr(font, ':'); if (s1) { -char *s2, *name, *style; +char *s2, *name, *style, *temp; int len; len = s1 - font; @@ -171,7 +171,13 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con if (s2) { len = s2 - name; + temp = name; name = realloc(name, sizeof(char) * len + 1); + if (!name) + { + free(temp); + return NULL; + } memset(name, 0, sizeof(char) * len + 1); strncpy(name, font, len); } --
[EGIT] [core/enlightenment] master 02/03: Fix memory leak issue
discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=54a613eda97da6060c73212f107d6fa9f32eebd1 commit 54a613eda97da6060c73212f107d6fa9f32eebd1 Author: Vivek Ellur Date: Tue Nov 10 12:26:40 2015 -0500 Fix memory leak issue Summary: @Fix Signed-off-by: Vivek Ellur Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3307 --- src/modules/wl_weekeyboard/e_mod_main.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/wl_weekeyboard/e_mod_main.c b/src/modules/wl_weekeyboard/e_mod_main.c index bb5cbe7..c90f0fd 100644 --- a/src/modules/wl_weekeyboard/e_mod_main.c +++ b/src/modules/wl_weekeyboard/e_mod_main.c @@ -41,8 +41,17 @@ _wkb_insert_text(const char *text, uint32_t offset, const char *insert) char *new_text = malloc(strlen(text) + strlen(insert) + 1); uint32_t text_len = 0; + if (!new_text) + { +ERR("out of memory"); +return NULL; + } + if ((!text) || (!insert)) - return NULL; + { +free(new_text); +return NULL; + } text_len = strlen(text); if (offset > text_len) --
[EGIT] [core/enlightenment] master 03/03: Fix null dereference issue
discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=dbfa9682bbc1f0993860d951da85c4b305ee9ae9 commit dbfa9682bbc1f0993860d951da85c4b305ee9ae9 Author: Vivek Ellur Date: Tue Nov 10 12:26:48 2015 -0500 Fix null dereference issue Summary: @Fix possible null dereference issue while referencing cs2->id. So added a condition to check it Signed-off-by: Vivek Ellur Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3309 --- src/modules/conf_randr/e_int_config_randr2.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/conf_randr/e_int_config_randr2.c b/src/modules/conf_randr/e_int_config_randr2.c index 97aa9eb..ac9ea88 100644 --- a/src/modules/conf_randr/e_int_config_randr2.c +++ b/src/modules/conf_randr/e_int_config_randr2.c @@ -390,8 +390,11 @@ _cb_rel_to_set(void *data, Evas_Object *obj, void *event) if (it == event) { E_Config_Randr2_Screen *cs2 = _config_screen_n_find(cfdata, i); - printf("find cs = %p\n", cs2); - printf("cs id = %s\n", cs2->id); + if (cs2) + { + printf("find cs = %p\n", cs2); + printf("cs id = %s\n", cs2->id); + } if (cs2 == cs) return; if (cs2) { --
[EGIT] [core/efl] master 05/10: eina: add test case for binbuf append function
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=46777274fed3d20d823c70e3eaf1eba5a815530d commit 46777274fed3d20d823c70e3eaf1eba5a815530d Author: Vivek Ellur Date: Tue Nov 10 14:44:14 2015 -0800 eina: add test case for binbuf append function Summary: Added test case for eina_binbuf_append_buffer function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3304 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_binbuf.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/eina/eina_test_binbuf.c b/src/tests/eina/eina_test_binbuf.c index 1b0de28..ce77803 100644 --- a/src/tests/eina/eina_test_binbuf.c +++ b/src/tests/eina/eina_test_binbuf.c @@ -26,7 +26,7 @@ START_TEST(binbuf_simple) { - Eina_Binbuf *buf; + Eina_Binbuf *buf, *test_buf; unsigned char *txt; const unsigned char cbuf[] = "Null in the middle \0 and more text afterwards and \0 anotehr null just there and another one \0 here."; size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */ @@ -41,6 +41,12 @@ START_TEST(binbuf_simple) fail_if(memcmp(eina_binbuf_string_get(buf), cbuf, size)); fail_if(size != eina_binbuf_length_get(buf)); + test_buf = eina_binbuf_new(); + fail_if(!test_buf); + fail_if(!eina_binbuf_append_buffer(test_buf, buf)); + fail_if(memcmp(eina_binbuf_string_get(test_buf), cbuf, size)); + fail_if(size != eina_binbuf_length_get(test_buf)); + eina_binbuf_append_length(buf, cbuf, size); fail_if(memcmp(eina_binbuf_string_get(buf), cbuf, size)); fail_if(memcmp(eina_binbuf_string_get(buf) + size, cbuf, size)); --
[EGIT] [core/efl] master 05/10: evil: fix uninitialize warning
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=01f13181175bfe1d0aefde8877efccd25f628f42 commit 01f13181175bfe1d0aefde8877efccd25f628f42 Author: Vivek Ellur Date: Fri Nov 20 05:52:56 2015 +0100 evil: fix uninitialize warning Summary: @Fix Signed-off-by: Vivek Ellur Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3324 Signed-off-by: Cedric BAIL --- src/bin/evil/evil_test_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/evil/evil_test_pipe.c b/src/bin/evil/evil_test_pipe.c index 54b68b2..e5cfdec 100644 --- a/src/bin/evil/evil_test_pipe.c +++ b/src/bin/evil/evil_test_pipe.c @@ -45,7 +45,7 @@ test_pipe_test(void) intsockets[2]; struct timeval t; fd_set rfds; - intret; + intret = 0; data *d; DWORD thread_id; HANDLE h; --
[EGIT] [core/efl] master 04/10: eet: remove useless assignment in eet cipher and silence warning.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f0c826c415ab419ecfbf7d7a563f48eae25b58e1 commit f0c826c415ab419ecfbf7d7a563f48eae25b58e1 Author: Vivek Ellur Date: Fri Nov 20 03:01:54 2015 +0100 eet: remove useless assignment in eet cipher and silence warning. Summary: Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3310 Signed-off-by: Cedric BAIL --- src/lib/eet/eet_cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c index 0f367ec..aa57e5c 100644 --- a/src/lib/eet/eet_cipher.c +++ b/src/lib/eet/eet_cipher.c @@ -260,8 +260,8 @@ eet_identity_close(Eet_Key *key) EVP_PKEY_free(key->private_key); # endif /* ifdef HAVE_GNUTLS */ free(key); -#else - key = NULL; +# else + (void)key; #endif /* ifdef HAVE_SIGNATURE */ } --
[EGIT] [core/efl] master 01/04: eet: Fix warning in eet file
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0ddd0129ea06cee05d8733968ac3b00318951025 commit 0ddd0129ea06cee05d8733968ac3b00318951025 Author: Vivek Ellur Date: Mon Nov 23 17:35:07 2015 +0900 eet: Fix warning in eet file Summary: variable 'total' is of unsigned long long but %lli was used to print..so fixed warning Signed-off-by: Vivek Ellur Reviewers: cedric, jpeg Reviewed By: jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3325 --- src/bin/eet/eet_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/eet/eet_main.c b/src/bin/eet/eet_main.c index 09ab935..a3652e8 100644 --- a/src/bin/eet/eet_main.c +++ b/src/bin/eet/eet_main.c @@ -86,7 +86,7 @@ do_eet_list(const char *file, Eina_Bool verbose) if (verbose) { printf("*** ***\n"); -printf("Total payload size : %lli.\n", total); +printf("Total payload size : %llu.\n", total); } eet_close(ef); --
[EGIT] [core/efl] master 01/01: Eio: Fixes T2831, eio xattr tests failing
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b41e66c1ef9928b506ed1f6e0ef9e033e25edf02 commit b41e66c1ef9928b506ed1f6e0ef9e033e25edf02 Author: Vivek Ellur Date: Thu Dec 3 09:03:59 2015 +0100 Eio: Fixes T2831, eio xattr tests failing Summary: @Fix The eio_file_xattr test was failing in jenkins, so added a new callback and moved the check condition to callback. The condition is checked only when it is successfully executed Signed-off-by: Vivek Ellur Reviewers: cedric, stefan_schmidt Subscribers: jpeg, cedric Maniphest Tasks: T2831 Differential Revision: https://phab.enlightenment.org/D3400 --- src/tests/eio/eio_test_xattr.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/tests/eio/eio_test_xattr.c b/src/tests/eio/eio_test_xattr.c index 6600026..6f15fac 100644 --- a/src/tests/eio/eio_test_xattr.c +++ b/src/tests/eio/eio_test_xattr.c @@ -83,6 +83,15 @@ _done_once_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED) } static void +_done_file_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED) +{ + int *num_of_attr = (int *)data; + + fail_if( (*num_of_attr) != (sizeof (attribute) / sizeof (attribute[0]))); + ecore_main_loop_quit(); +} + +static void _done_get_cb(void *data, Eio_File *handler EINA_UNUSED, const char *name, unsigned int len EINA_UNUSED) { @@ -170,15 +179,13 @@ START_TEST(eio_test_xattr_set) num_of_attr = 0; fp = eio_file_xattr(test_file_path, - _filter_cb, _main_cb, _done_once_cb, _error_cb, + _filter_cb, _main_cb, _done_file_cb, _error_cb, &num_of_attr); fail_if(num_of_attr != 0); fail_if(!fp); ecore_main_loop_begin(); - fail_if(num_of_attr != sizeof (attribute) / sizeof (attribute[0])); - close(fd); unlink(test_file_path); eio_shutdown(); --
[EGIT] [core/efl] master 01/04: eina: add test cases for eina matrix map and transform functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=70e5687f6c43ffd3a66de592e625ff59c15909b6 commit 70e5687f6c43ffd3a66de592e625ff59c15909b6 Author: Vivek Ellur Date: Thu Jun 25 15:35:33 2015 +0200 eina: add test cases for eina matrix map and transform functions Summary: Added test cases for matrix map and transform functions Signed-off-by: Vivek Ellur Reviewers: stefan_schmidt, cedric Reviewed By: stefan_schmidt, cedric Subscribers: stefan_schmidt, cedric Differential Revision: https://phab.enlightenment.org/D2758 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_matrix.c | 53 +++ 1 file changed, 53 insertions(+) diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index ed7c7ef..af1e005 100644 --- a/src/tests/eina/eina_test_matrix.c +++ b/src/tests/eina/eina_test_matrix.c @@ -366,6 +366,58 @@ START_TEST(eina_matrix3_f16p16) } END_TEST +START_TEST(eina_matrix3_map_transform) +{ + double x = 2, y = 3, x1, y1; + Eina_Matrix3 m; + Eina_Rectangle r; + Eina_Quad q; + Eina_Bool ret; + + eina_init(); + + eina_matrix3_values_set(&m, + 0, 1, 0, + 1, 0, 0, + 0, 0, 1); + + eina_matrix3_point_transform(&m, +x, y, +&x1, &y1); + fail_if(x1 != 3 || y1 != 2); + + EINA_RECTANGLE_SET(&r, 0, 0, 3, 4); + eina_matrix3_rectangle_transform(&m, &r, &q); + + fail_if(q.x0 != 0 || q.y0 != 0 || + q.x1 != 0 || q.y1 != 3 || + q.x2 != 4 || q.y2 != 3 || + q.x3 != 4 || q.y3 != 0); + + eina_quad_coords_set(&q, +0.0, 0.0, +3.0, 0.0, +3.0, 3.0, +0.0, 3.0); + ret = eina_matrix3_square_quad_map(&m, &q); + fail_if(ret != EINA_TRUE); + + fail_if(m.xx != 3 || m.xy != 0 || m.xz != 0 || + m.yx != 0 || m.yy != 3 || m.yz != 0 || + m.zx != 0 || m.zy != 0 || m.zz != 1); + + ret = eina_matrix3_quad_square_map(&m, &q); + fail_if(ret != EINA_TRUE); + + fail_if(q.x0 != 0 || q.y0 != 0 || + q.x1 != 3 || q.y1 != 0 || + q.x2 != 3 || q.y2 != 3 || + q.x3 != 0 || q.y3 != 3); + + eina_shutdown(); +} +END_TEST + void eina_test_matrix(TCase *tc) { @@ -374,4 +426,5 @@ eina_test_matrix(TCase *tc) tcase_add_test(tc, eina_matrix3); tcase_add_test(tc, eina_matrix3_operations); tcase_add_test(tc, eina_matrix3_f16p16); + tcase_add_test(tc, eina_matrix3_map_transform); } --
[EGIT] [core/efl] master 03/03: eina: add quaternion test in eina suite and fix the test case errors
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1155176aa50e3ecdaf7affaf0b86d4b1ffd51ce9 commit 1155176aa50e3ecdaf7affaf0b86d4b1ffd51ce9 Author: Vivek Ellur Date: Mon Jun 29 14:24:21 2015 +0200 eina: add quaternion test in eina suite and fix the test case errors Summary: Fixed eina_test_quaternion_conjugate and eina_test_quaternion_matrix which were failing and also added the quaternion test in eina suite Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2775 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_suite.c | 1 + src/tests/eina/eina_suite.h | 1 + src/tests/eina/eina_test_quaternion.c | 10 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c index 5383bb6..5caa536 100644 --- a/src/tests/eina/eina_suite.c +++ b/src/tests/eina/eina_suite.c @@ -82,6 +82,7 @@ static const Eina_Test_Case etc[] = { { "Crc", eina_test_crc }, { "Quad", eina_test_quad }, { "Matrix", eina_test_matrix }, + { "Quaternion", eina_test_quaternion }, { NULL, NULL } }; diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h index d39254d..845ec9d 100644 --- a/src/tests/eina/eina_suite.h +++ b/src/tests/eina/eina_suite.h @@ -67,5 +67,6 @@ void eina_test_xattr(TCase *tc); void eina_test_crc(TCase *tc); void eina_test_quad(TCase *tc); void eina_test_matrix(TCase *tc); +void eina_test_quaternion(TCase *tc); #endif /* EINA_SUITE_H_ */ diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index 55e1c9f..9ca60d4 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -62,7 +62,7 @@ START_TEST(eina_test_quaternion_norm) eina_init(); - fail_if(FLOAT_CMP(eina_quaternion_norm(&q), sqrt(51))); + fail_if(!FLOAT_CMP(eina_quaternion_norm(&q), sqrt(51))); eina_shutdown(); } @@ -71,7 +71,7 @@ END_TEST START_TEST(eina_test_quaternion_conjugate) { static const Eina_Quaternion q1 = { 1, -1, -1, 3 }, q2 = { 1, 3, 4, 3 }; - static const Eina_Quaternion r1 = { 1, 1, 1, -3 }, r2 = { 1, -3, -4, -3 }; + static const Eina_Quaternion r1 = { -1, 1, 1, 3 }, r2 = { -1, -3, -4, 3 }; Eina_Quaternion t1, t2; eina_init(); @@ -90,9 +90,9 @@ START_TEST(eina_test_quaternion_matrix) { Eina_Quaternion q = { 7, 9, 5, 1 }; Eina_Matrix3 m = { - 104, 76, 8, - 104, -8, -116, - -52, 136, -56 + -211, 136, 52, + 116, -147, 104, + 88, 76, -259 }; Eina_Quaternion tq; Eina_Matrix3 tm; --
[EGIT] [core/efl] master 01/02: eina: fix failure of eina_quaternion_test.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=68d9c3d6f0595179199afbe37f07a3f2be5d6df4 commit 68d9c3d6f0595179199afbe37f07a3f2be5d6df4 Author: Vivek Ellur Date: Sat Jul 4 02:30:40 2015 +0200 eina: fix failure of eina_quaternion_test. Summary: eina_test_quaternion_norm was failing. so fixed it. Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2781 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_quaternion.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index 9ca60d4..9759355 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -59,10 +59,11 @@ eina_matrix3_cmp(const Eina_Matrix3 *a, const Eina_Matrix3 *b) START_TEST(eina_test_quaternion_norm) { static const Eina_Quaternion q = { 1, 3, 4, 5 }; + double result = eina_quaternion_norm(&q); eina_init(); - fail_if(!FLOAT_CMP(eina_quaternion_norm(&q), sqrt(51))); + fail_if(!FLOAT_CMP(result, sqrt(51))); eina_shutdown(); } --
[EGIT] [core/elementary] master 01/02: elm_app_client: convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=39a1e98bf65bdb5f58421a5aecdc9396118745b5 commit 39a1e98bf65bdb5f58421a5aecdc9396118745b5 Author: Vivek Ellur Date: Tue Jul 14 14:44:02 2015 +0100 elm_app_client: convert eo docs to new format Summary: Converted docs of elm_app_client.eo and elm_app_client_view.eo to new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2814 --- src/lib/elm_app_client.eo | 30 ++-- src/lib/elm_app_client_view.eo | 64 ++ 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/src/lib/elm_app_client.eo b/src/lib/elm_app_client.eo index b4cfa51..d58ec3a 100644 --- a/src/lib/elm_app_client.eo +++ b/src/lib/elm_app_client.eo @@ -5,46 +5,46 @@ class Elm_App_Client (Eo.Base) methods { @property views { get { -/*@ Return a iterator with all views of application. */ +[[Return a iterator with all views of application.]] } values { -ret: free(own(iterator *), eina_iterator_free); /*@ The iterator with all views, must be freed after use */ +ret: free(own(iterator *), eina_iterator_free); [[The iterator with all views, must be freed after use.]] } } @property package { get { -/*@ Return the application package. */ +[[Return the application package.]] } values { -ret: const(char)*; /*@ application package */ +ret: const(char)*; [[application package]] } } constructor { - /*@ Class constructor of elm_app_client. */ + [[Class constructor of elm_app_client.]] legacy: null; params { -@in package: const(char)*; /*@ Package of application */ +@in package: const(char)*; [[Package of application]] } } view_all_close { - /*@ Close all views of application. */ + [[Close all views of application.]] } terminate { - /*@ Terminate application. */ + [[Terminate application.]] } view_open { - /*@ Open an application view. */ + [[Open an application view.]] params { -@in args: Eina_Value * @optional; /*@ an array of */ -@in view_open_cb: Elm_App_Client_Open_View_Cb @optional; /*@ callback to be called when view open */ -@in data: const(void)* @optional; /*@ calback user data */ +@in args: Eina_Value * @optional; [[an array of.]] +@in view_open_cb: Elm_App_Client_Open_View_Cb @optional; [[callback to be called when view open]] +@in data: const(void)* @optional; [[callback user data]] } - return: Elm_App_Client_Pending *; /*@ handler to cancel the view opening if it takes to long */ + return: Elm_App_Client_Pending *; [[handler to cancel the view opening if it takes to long ]] } view_open_cancel { - /*@ Cancel a pending elm_app_client_view_open(). */ + [[Cancel a pending elm_app_client_view_open().]] params { -@in pending: Elm_App_Client_Pending *; /*@ the view open handler */ +@in pending: Elm_App_Client_Pending *; [[the view open handler]] } } } diff --git a/src/lib/elm_app_client_view.eo b/src/lib/elm_app_client_view.eo index 8534a3f..3a2e4e5 100644 --- a/src/lib/elm_app_client_view.eo +++ b/src/lib/elm_app_client_view.eo @@ -5,37 +5,39 @@ class Elm_App_Client_View (Eo.Base) methods { @property state { get { -/*@ Get state of view */ +[[Get state of view]] } values { -state: Elm_App_View_State; /*@ state of view */ +state: Elm_App_View_State; [[state of view]] } } @property new_events { get { -/*@ Get new events of view */ +[[Get new events of view]] } values { -events: int; /*@ number of events of view */ +events: int; [[number of events of view]] } } @property window { get { -/*@ Get window of view */ +[[Get window of view]] } values { -window: int; /*@ window of view */ +window: int; [[window of view]] } } @property icon_pixels { get { -/*@ Get icon pixels of view, view could have a icon in raw format not saved in disk. */ +[[Get icon pixels of view, view could have a icon + in raw format not saved in disk. +]] } values { -w: uint; /*@ icon width */ -h: uint
[EGIT] [core/elementary] master 02/02: elm_app_server: Convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=8014a35d56457372ef7e4822749b82860199d769 commit 8014a35d56457372ef7e4822749b82860199d769 Author: Vivek Ellur Date: Tue Jul 14 14:44:25 2015 +0100 elm_app_server: Convert eo docs to new format Summary: Converted docs of elm_app_server.eo and elm_app_server_view.eo to new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2816 --- src/lib/elm_app_server.eo | 41 ++--- src/lib/elm_app_server_view.eo | 4 ++-- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/lib/elm_app_server.eo b/src/lib/elm_app_server.eo index 353ac03..4cd82ea 100644 --- a/src/lib/elm_app_server.eo +++ b/src/lib/elm_app_server.eo @@ -9,15 +9,15 @@ class Elm_App_Server (Eo.Base) get { } values { -icon: Eina_Stringshare *; /*@ title of icon */ +icon: Eina_Stringshare *; [[title of icon]] } } @property views { get { -/*@ Return a iterator with all views of application */ +[[Return a iterator with all views of application]] } values { -ret: free(own(iterator *), eina_iterator_free); /*@ Iterator with all views of application, you must free iterator after use */ +ret: free(own(iterator *), eina_iterator_free); [[Iterator with all views of application, you must free iterator after use]] } } @property path { @@ -36,10 +36,10 @@ class Elm_App_Server (Eo.Base) } @property pixels { get { -/*@ Get application raw icon. */ +[[Get application raw icon.]] } set { -/*@ Set icon to application, using the raw pixels of image. */ +[[Set icon to application, using the raw pixels of image.]] } values { w: uint; @@ -49,41 +49,44 @@ class Elm_App_Server (Eo.Base) } } constructor { - /*@ Class constructor of elm_app_server */ + [[Class constructor of elm_app_server]] legacy: null; params { -@in packageid: const(char)*; /*@ package of application */ -@in create_view_cb: Elm_App_Server_Create_View_Cb; /*@ callback to be called when user whants to open some application view */ +@in packageid: const(char)*; [[package of application]] +@in create_view_cb: Elm_App_Server_Create_View_Cb; [[callback to be called when user whants to open some application view]] } } close_all { - /*@ Close all views of application */ + [[Close all views of application]] } view_check { - /*@ If view id is available and unique, return the full DBus object path of view */ + [[If view id is available and unique, return the full DBus object path of view]] params { -@in id: const(char)*; /*@ view identifier */ +@in id: const(char)*; [[view identifier]] } - return: bool; /*@ @c EINA_TRUE if id is valid or @c EINA_FALSE if not */ + return: bool; [[true if id is valid or false if not]] } view_add { - /*@ Add a view to elm_app_server. This should only be used if the application open a view that was not requested by create_view_cb. */ + [[Add a view to elm_app_server. This should only be + used if the application open a view that was not + requested by create_view_cb. + ]] params { -@in view: Elm_App_Server_View *; /*@ elm_app_server_view */ +@in view: Elm_App_Server_View *; [[elm_app_server_view]] } } title_set { - /*@ Set a title to application. */ + [[Set a title to application.]] params { -@in title: const(char)* @nullable; /*@ title of application */ +@in title: const(char)* @nullable; [[title of application]] } } title_get { - /*@ Get title of application */ - return: Eina_Stringshare *; /*@ title of application */ + [[Get title of application]] + return: Eina_Stringshare *; [[title of application]] } save { - /*@ Save the state of all views */ + [[Save the state of all views]] } } implements { diff --git a/src/lib/elm_app_server_view.eo b/src/lib/elm_app_server_view.eo index dc48472..51e32c5 100644 --- a/src/lib/elm_app_server_view.eo +++ b/src/lib/elm_app_server_view.eo @@ -71,10 +71,10 @@ class Elm_App_Server_View (Eo.Base) } @property pixels { get { -/*@ Get application raw icon. */ +[[Get application raw icon.]] } set
[EGIT] [core/elementary] master 01/01: elm_bg: convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=3656fb4e2269c013d55419d5e606fbc2429aa19c commit 3656fb4e2269c013d55419d5e606fbc2429aa19c Author: Vivek Ellur Date: Thu Jul 16 11:21:15 2015 +0100 elm_bg: convert eo docs to new format Summary: Converted docs of elm_bg.eo to new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Differential Revision: https://phab.enlightenment.org/D2819 --- src/lib/elm_atspi_bridge.eo | 4 +- src/lib/elm_bg.eo | 97 + 2 files changed, 47 insertions(+), 54 deletions(-) diff --git a/src/lib/elm_atspi_bridge.eo b/src/lib/elm_atspi_bridge.eo index eafd9f4..378060c 100644 --- a/src/lib/elm_atspi_bridge.eo +++ b/src/lib/elm_atspi_bridge.eo @@ -4,7 +4,7 @@ class Elm.Atspi_Bridge (Eo.Base) methods { @property connected { get { -/*@ Indicate if connection with AT-SPI2 bus has been established. */ +[[Indicate if connection with AT-SPI2 bus has been established.]] values { ret: bool; } @@ -12,7 +12,7 @@ class Elm.Atspi_Bridge (Eo.Base) } @property root { get { -/*@ Get root object of accessible object hierarchy */ +[[Get root object of accessible object hierarchy]] values { ret: Eo*; } diff --git a/src/lib/elm_bg.eo b/src/lib/elm_bg.eo index 2492926..01a9677 100644 --- a/src/lib/elm_bg.eo +++ b/src/lib/elm_bg.eo @@ -19,95 +19,88 @@ class Elm.Bg (Elm.Layout, Efl.File) methods { @property option { set { -/*@ -Set the mode of display for a given background widget's image +[[Set the mode of display for a given background widget's image -This sets how the background widget will display its image. This -will only work if the elm_bg_file_set() was previously called with -an image file on @a obj. The image can be display tiled, scaled, -centered or stretched. #ELM_BG_OPTION_SCALE by default. + This sets how the background widget will display its image. This + will only work if the @Efl.File.file.set was previously called with + an image file on $obj. The image can be display tiled, scaled, + centered or stretched. @Elm.Bg.Option.scale by default. -@see elm_bg_option_get() + See also @.option.get. +]] -@ingroup Bg */ } get { -/*@ -Get the mode of display for a given background widget's image +[[Get the mode of display for a given background widget's image. -@return The image displaying mode in use for @a obj or #ELM_BG_OPTION_LAST, -on errors. + See also @.option.set for more details -@see elm_bg_option_set() for more details - -@ingroup Bg */ +]] } values { -option: Elm.Bg.Option; /*@ The desired background option (see #Elm_Bg_Option) */ +option: Elm.Bg.Option; [[The desired background option(See @Elm.Bg.Option)]] } } @property color { set { -/*@ -Set the color on a given background widget +[[Set the color on a given background widget -This sets the color used for the background rectangle, in RGB -format. Each color component's range is from 0 to 255. + This sets the color used for the background rectangle, in RGB + format. Each color component's range is from 0 to 255. -@note You probably only want to use this function if you haven't -previously called elm_bg_file_set(), so that you just want a solid -color background. + Note: You probably only want to use this function if you haven't + previously called @Efl.File.file.set, so that you just want a solid + color background. -@note You can reset the color by setting @p r, @p g, @p b as -1, -1, -1. + Note: You can reset the color by setting $r, $g, $b as -1, -1, -1. -@see elm_bg_color_get() + See also @.color.get -@ingroup Bg */ +]] legacy: null; /* legacy doesn't have 'a' param */ } get { -/*@ -Get the color set on a given background widget +[[Get the color set on a given background widget -@note Use @c NULL pointers on the file components you're not -interested in: they'll be ignored by the function. + Note: Use $null pointers on the file components you'r
[EGIT] [core/elementary] master 02/02: elm_button: Converted docs of elm_button eo to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=77b436736990c413d21f2d7bae1a67da32b30e6e commit 77b436736990c413d21f2d7bae1a67da32b30e6e Author: Vivek Ellur Date: Thu Jul 16 15:13:27 2015 +0100 elm_button: Converted docs of elm_button eo to new format Summary: Changed the docs of elm_bubble.eo and elm_button.eo to the new format Signed-off-by: Vivek Ellur Reviewers: q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2827 --- src/lib/elm_bubble.eo | 24 ++- src/lib/elm_button.eo | 81 +-- 2 files changed, 43 insertions(+), 62 deletions(-) diff --git a/src/lib/elm_bubble.eo b/src/lib/elm_bubble.eo index 94a1812..a98c07d 100644 --- a/src/lib/elm_bubble.eo +++ b/src/lib/elm_bubble.eo @@ -18,28 +18,22 @@ class Elm.Bubble (Elm.Layout, Evas.Clickable_Interface) methods { @property pos { set { -/*@ -Set the corner of the bubble +[[Set the corner of the bubble -This function sets the corner of the bubble. The corner will be used to -determine where the arrow in the frame points to and where label, icon and -info are shown. + This function sets the corner of the bubble. The corner will be used to + determine where the arrow in the frame points to and where label, icon and + info are shown. - -@ingroup Bubble */ +]] } get { -/*@ -Get the corner of the bubble - -@return The given corner for the bubble. - -This function gets the selected corner of the bubble. +[[Get the corner of the bubble -@ingroup Bubble */ + This function gets the selected corner of the bubble. +]] } values { -pos: Elm.Bubble.Pos; /*@ The given corner for the bubble. */ +pos: Elm.Bubble.Pos; [[The given corner for the bubble.]] } } } diff --git a/src/lib/elm_button.eo b/src/lib/elm_button.eo index cd09409..ad58c37 100644 --- a/src/lib/elm_button.eo +++ b/src/lib/elm_button.eo @@ -5,90 +5,77 @@ class Elm.Button (Elm.Layout, Evas.Clickable_Interface, methods { @property autorepeat_initial_timeout { set { -/*@ -Set the initial timeout before the autorepeat event is generated +[[Set the initial timeout before the autorepeat event is generated -Sets the timeout, in seconds, since the button is pressed until the -first @c repeated signal is emitted. If @p t is 0.0 or less, there -won't be any delay and the event will be fired the moment the button is -pressed. + Sets the timeout, in seconds, since the button is pressed until the + first $repeated signal is emitted. If $t is 0.0 or less, there + won't be any delay and the event will be fired the moment the button is + pressed. -@see elm_button_autorepeat_set() -@see elm_button_autorepeat_gap_timeout_set() + See also @.autorepeat.set, + @.autorepeat_gap_timeout.set. -@ingroup Button */ +]] } get { -/*@ -Get the initial timeout before the autorepeat event is generated +[[Get the initial timeout before the autorepeat event is generated -@return Timeout in seconds + See also @.autorepeat_initial_timeout.set. -@see elm_button_autorepeat_initial_timeout_set() - -@ingroup Button */ +]] } values { -t: double; /*@ Timeout in seconds */ +t: double; [[Timeout in seconds]] } } @property autorepeat_gap_timeout { set { -/*@ -Set the interval between each generated autorepeat event +[[Set the interval between each generated autorepeat event -After the first @c repeated event is fired, all subsequent ones will -follow after a delay of @p t seconds for each. + After the first $repeated event is fired, all subsequent ones will + follow after a delay of $t seconds for each. -@see elm_button_autorepeat_initial_timeout_set() + See also @.autorepeat_initial_timeout.set. -@ingroup Button */ +]] } get { -/*@ -Get the interval between each generated autorepeat event - -@return Interval in seconds - -@ingroup Button */ +[[Get the interval between each generated autorepeat event]] } values { -t: double; /*
[EGIT] [core/elementary] master 01/02: elm_box: convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=dc060651185f1e1e90a4885e2b4dd8004d1c660a commit dc060651185f1e1e90a4885e2b4dd8004d1c660a Author: Vivek Ellur Date: Thu Jul 16 15:13:21 2015 +0100 elm_box: convert eo docs to new format Summary: Converted elm_box.eo documentation to new format Signed-off-by: Vivek Ellur Reviewers: q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2826 --- src/lib/elm_box.eo | 338 - 1 file changed, 155 insertions(+), 183 deletions(-) diff --git a/src/lib/elm_box.eo b/src/lib/elm_box.eo index 6610970..ca33d26 100644 --- a/src/lib/elm_box.eo +++ b/src/lib/elm_box.eo @@ -4,304 +4,276 @@ class Elm.Box (Elm.Widget) methods { @property homogeneous { set { -/*@ -Set the box to arrange its children homogeneously +[[Set the box to arrange its children homogeneously -If enabled, homogeneous layout makes all items the same size, according -to the size of the largest of its children. + If enabled, homogeneous layout makes all items the same size, according + to the size of the largest of its children. -@note This flag is ignored if a custom layout function is set. + Note: This flag is ignored if a custom layout function is set. -@ingroup Box */ +]] } get { -/*@ -Get whether the box is using homogeneous mode or not - -@return @c EINA_TRUE if it's homogeneous, @c EINA_FALSE otherwise - -@ingroup Box */ +[[Get whether the box is using homogeneous mode or not ($true if + it's homogeneous, $false otherwise)]] } values { -homogeneous: bool; /*@ The homogeneous flag */ +homogeneous: bool; [[The homogeneous flag]] } } @property align { set { -/*@ -Set the alignment of the whole bounding box of contents. +[[Set the alignment of the whole bounding box of contents. -Sets how the bounding box containing all the elements of the box, after -their sizes and position has been calculated, will be aligned within -the space given for the whole box widget. + Sets how the bounding box containing all the elements of the box, after + their sizes and position has been calculated, will be aligned within + the space given for the whole box widget. -@ingroup Box */ +]] } get { -/*@ -Get the alignment of the whole bounding box of contents. +[[Get the alignment of the whole bounding box of contents. -@see elm_box_align_set() + See also @.align.set. -@ingroup Box */ +]] } values { -horizontal: double; /*@ The horizontal alignment of elements */ -vertical: double; /*@ The vertical alignment of elements */ +horizontal: double; [[The horizontal alignment of elements]] +vertical: double; [[The vertical alignment of elements]] } } @property horizontal { set { -/*@ -Set the horizontal orientation +[[Set the horizontal orientation -By default, box object arranges their contents vertically from top to -bottom. -By calling this function with @p horizontal as @c EINA_TRUE, the box will -become horizontal, arranging contents from left to right. + By default, box object arranges their contents vertically from top to + bottom. + By calling this function with $horizontal as $true, the box will + become horizontal, arranging contents from left to right. -@note This flag is ignored if a custom layout function is set. + Note: This flag is ignored if a custom layout function is set. -@ingroup Box */ +]] } get { -/*@ -Get the horizontal orientation - -@return @c EINA_TRUE if the box is set to horizontal mode, @c EINA_FALSE otherwise - -@ingroup Box */ +[[Get the horizontal orientation ($true if the box is set to + horizontal mode, $false otherwise)]] } values { -horizontal: bool; /*@ The horizontal flag (@c EINA_TRUE = horizontal, -@c EINA_FALSE = vertical) */ +horizontal: bool; [[The horizontal flag]] } } @property padding { set { -/*@ -Set the space (padding) between
[EGIT] [core/elementary] master 01/01: elm_calendar: Convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=a92650ed19cc3e0e6e41fec6a2478e68339dc064 commit a92650ed19cc3e0e6e41fec6a2478e68339dc064 Author: Vivek Ellur Date: Tue Jul 21 11:53:55 2015 +0100 elm_calendar: Convert eo docs to new format Summary: Changed the docs of elm_calendar.eo to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2846 --- src/lib/elm_calendar.eo | 464 +--- 1 file changed, 207 insertions(+), 257 deletions(-) diff --git a/src/lib/elm_calendar.eo b/src/lib/elm_calendar.eo index d7807cb..d494e6a 100644 --- a/src/lib/elm_calendar.eo +++ b/src/lib/elm_calendar.eo @@ -76,386 +76,336 @@ class Elm.Calendar (Elm.Layout, Elm_Interface_Atspi_Widget_Action) methods { @property first_day_of_week { set { -/*@ -Set the first day of week to use on calendar widgets'. - -@ingroup Calendar */ +[[Set the first day of week to use on calendar widgets'.]] } get { -/*@ -Get the first day of week, who are used on calendar widgets'. - -@return An int which correspond to the first day of the week (Sunday = 0, Monday = 1, -..., Saturday = 6) +[[Get the first day of week, who are used on calendar widgets'. -@see elm_calendar_first_day_of_week_set() for more details + See also @.first_day_of_week.set for more details. -@ingroup Calendar */ +]] } values { -day: Elm.Calendar.Weekday; /*@ An int which correspond to the first day of the week (Sunday = 0, Monday = 1, -..., Saturday = 6) */ +day: Elm.Calendar.Weekday; [[An int which correspond to the first day of the week (Sunday = 0, Monday = 1, +..., Saturday = 6).]] } } @property selectable { set { -/*@ -Define which fields of a @b tm struct will be taken into account, when -elm_calendar_selected_time_set() is invoked. +[[Define which fields of a tm struct will be taken into account, when + Elm.Calendar.selected_time.set is invoked. + + By Default the bitmask is set to use all fields of a tm struct (year, + month and day of the month). -By Default the bitmask is set to use all fields of a @b tm struct (year, -month and day of the month). -@ingroup Calendar -@see elm_calendar_selected_time_set -@since 1.8 */ + See also @.selected_time_set. + + @since 1.8 +]] } get { -/*@ -Get how elm_calendar_selected_time_set manage a date +[[Get how elm_calendar_selected_time_set manage a date -@return The flag used to manage a date with a elm_calendar_selected_time_set + See also @.selectable.set, + @.selected_time_set. -@ingroup Calendar -@see elm_calendar_selectable_set -@see elm_calendar_selected_time_set -@since 1.8 */ + @since 1.8 +]] } values { -selectable: Elm.Calendar.Selectable; /*@ A bitmask of Elm_Calendar_Selectable */ +selectable: Elm.Calendar.Selectable; [[A bitmask of Elm_Calendar_Selectable]] } } @property interval { set { -/*@ -Set the interval on time updates for an user mouse button hold -on calendar widgets' month/year selection. - -This interval value is @b decreased while the user holds the -mouse pointer either selecting next or previous month/year. +[[Set the interval on time updates for an user mouse button hold + on calendar widgets' month/year selection. -This helps the user to get to a given month distant from the -current one easier/faster, as it will start to change quicker and -quicker on mouse button holds. + This interval value is decreased while the user holds the + mouse pointer either selecting next or previous month/year. -The calculation for the next change interval value, starting from -the one set with this call, is the previous interval divided by -1.05, so it decreases a little bit. + This helps the user to get to a given month distant from the + current one easier/faster, as it will start to change quicker and + quicker on mouse button holds. -The default starting interval value for automatic c
[EGIT] [core/elementary] master 01/01: elm_color_item: Convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=3f3c0f364d104cbf524859ac2d3ce9115209e0c1 commit 3f3c0f364d104cbf524859ac2d3ce9115209e0c1 Author: Vivek Ellur Date: Tue Jul 21 15:01:46 2015 +0100 elm_color_item: Convert eo docs to new format Summary: Updated docs for elm_color_item.eo and elm_colorselector.eo files Signed-off-by: Vivek Ellur Reviewers: q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2850 --- src/lib/elm_color_item.eo| 78 +-- src/lib/elm_colorselector.eo | 109 +++ 2 files changed, 71 insertions(+), 116 deletions(-) diff --git a/src/lib/elm_color_item.eo b/src/lib/elm_color_item.eo index 99320cb..b918c49 100644 --- a/src/lib/elm_color_item.eo +++ b/src/lib/elm_color_item.eo @@ -2,54 +2,42 @@ class Elm.Color_Item(Elm.Widget_Item) { eo_prefix: elm_obj_color_item; methods { -@property color { - get { - /*@ - Get Palette item's color. + @property color { + get { +[[Get Palette item's color.]] + } + set { +[[Set Palette item's color.]] + } + values { +r: int; [[red-value of color]] +g: int; [[green-value of color]] +b: int; [[blue-value of color]] +a: int; [[alpha-value of color]] + } + } + @property selected { + get { +[[Get the selected state of color palette item - @ingroup Colorselector - */ - } - set { - /*@ - Set Palette item's color. + @since 1.9 +]] + } + set { +[[Set the selected state of color palette item - @ingroup Colorselector - */ - } - values { - r: int; /*@ red-value of color */ - g: int; /*@ green-value of color */ - b: int; /*@ blue-value of color */ - a: int; /*@ alpha-value of color */ - } -} -@property selected { - get { - /*@ - Get the selected state of color palette item - - @since 1.9 - @ingroup Colorselector - */ - } - set { - /*@ - Set the selected state of color palette item - - @since 1.9 - @ingroup Colorselector - */ - } - values { - selected: bool; /*@ @c EINA_TRUE if selected @c EINA_FALSE otherwise */ - } -} + @since 1.9 +]] + } + values { + selected: bool; [[$true if selected $false otherwise]] + } + } } implements { -Eo.Base.constructor; -Eo.Base.destructor; -Elm.Widget_Item.access_register; -Elm.Widget_Item.signal_emit; + Eo.Base.constructor; + Eo.Base.destructor; + Elm.Widget_Item.access_register; + Elm.Widget_Item.signal_emit; } } diff --git a/src/lib/elm_colorselector.eo b/src/lib/elm_colorselector.eo index fee1c23..cc036c7 100644 --- a/src/lib/elm_colorselector.eo +++ b/src/lib/elm_colorselector.eo @@ -19,121 +19,88 @@ class Elm.Colorselector (Elm.Layout, Elm_Interface_Atspi_Widget_Action, methods { @property color { set { -/*@ -Set color to colorselector +[[Set color to colorselector.]] -@ingroup Colorselector */ } get { -/*@ -Get current color from colorselector - -@ingroup Colorselector */ +[[Get current color from colorselector.]] } values { -r: int; /*@ r-value of color */ -g: int; /*@ g-value of color */ -b: int; /*@ b-value of color */ -a: int; /*@ a-value of color */ +r: int; [[r-value of color]] +g: int; [[g-value of color]] +b: int; [[b-value of color]] +a: int; [[a-value of color]] } } @property palette_name { set { -/*@ -Set current palette's name - -When colorpalette name is set, colors will be loaded from and saved to config -using the set name. If no name is set then colors will be loaded from or -saved to "default" config. +[[Set current palette's name -@ingroup Colorselector */ + When colorpalette name is set, colors will be loaded from and saved to config + using the set name. If no name is
[EGIT] [core/elementary] master 01/01: elm_clock: convert elm_clock eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=8edb1d7254ef751566485d98714c7a167f0a4f75 commit 8edb1d7254ef751566485d98714c7a167f0a4f75 Author: Vivek Ellur Date: Wed Jul 22 10:20:35 2015 +0100 elm_clock: convert elm_clock eo docs to new format Summary: Converted docs of elm_clock.eo to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2849 --- src/lib/elm_clock.eo | 253 +-- 1 file changed, 105 insertions(+), 148 deletions(-) diff --git a/src/lib/elm_clock.eo b/src/lib/elm_clock.eo index 04f8224..7809538 100644 --- a/src/lib/elm_clock.eo +++ b/src/lib/elm_clock.eo @@ -24,239 +24,196 @@ class Elm.Clock (Elm.Layout) methods { @property show_am_pm { set { -/*@ -Set if the given clock widget must show hours in military or -am/pm mode +[[Set if the given clock widget must show hours in military or + am/pm mode -This function sets if the clock must show hours in military or -am/pm mode. In some countries like Brazil the military mode -(00-24h-format) is used, in opposition to the USA, where the -am/pm mode is more commonly used. + This function sets if the clock must show hours in military or + am/pm mode. In some countries like Brazil the military mode + (00-24h-format) is used, in opposition to the USA, where the + am/pm mode is more commonly used. -@see elm_clock_show_am_pm_get() - -@ingroup Clock */ + See also @.show_am_pm.get. +]] } get { -/*@ -Get if the given clock widget shows hours in military or am/pm -mode - -@return @c EINA_TRUE, if in am/pm mode, @c EINA_FALSE if in -military - -This function gets if the clock shows hours in military or am/pm -mode. +[[Get if the given clock widget shows hours in military or am/pm + mode -@see elm_clock_show_am_pm_set() for more details + This function gets if the clock shows hours in military or am/pm + mode. -@ingroup Clock */ + See also @.show_am_pm.set for more details. +]] } values { -am_pm: bool; /*@ @c EINA_TRUE to put it in am/pm mode, @c EINA_FALSE -to military mode */ +am_pm: bool; [[$true to put it in am/pm mode, + $false to military mode]] } } @property first_interval { set { -/*@ -Set the first interval on time updates for a user mouse button hold -on clock widgets' time edition. +[[Set the first interval on time updates for a user mouse button hold + on clock widgets' time edition. -This interval value is @b decreased while the user holds the -mouse pointer either incrementing or decrementing a given the -clock digit's value. + This interval value is decreased while the user holds the + mouse pointer either incrementing or decrementing a given the + clock digit's value. -This helps the user to get to a given time distant from the -current one easier/faster, as it will start to flip quicker and -quicker on mouse button holds. + This helps the user to get to a given time distant from the + current one easier/faster, as it will start to flip quicker and + quicker on mouse button holds. -The calculation for the next flip interval value, starting from -the one set with this call, is the previous interval divided by -1.05, so it decreases a little bit. + The calculation for the next flip interval value, starting from + the one set with this call, is the previous interval divided by + 1.05, so it decreases a little bit. -The default starting interval value for automatic flips is -@b 0.85 seconds. + The default starting interval value for automatic flips is + 0.85 seconds. -@see elm_clock_first_interval_get() - -@ingroup Clock */ + See also @.first_interval.get. +]] } get { -/*@ -Get the first interval on time updates for a user mouse button hold -on clock widgets' time edition. - -@return The first interval value, in seconds, set on it +[[Get the first interval on time
[EGIT] [core/elementary] master 01/01: elm_container: Updated eo docs for elm_container
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=e921412f2ae41b2bfe856aefd4175ab5889a7e17 commit e921412f2ae41b2bfe856aefd4175ab5889a7e17 Author: Vivek Ellur Date: Wed Jul 22 10:21:24 2015 +0100 elm_container: Updated eo docs for elm_container Summary: Updated docs of elm_container.eo to the new format Signed-off-by: Vivek Ellur Reviewers: q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2852 --- src/lib/elm_container.eo | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/elm_container.eo b/src/lib/elm_container.eo index b9aa60f..82463a0 100644 --- a/src/lib/elm_container.eo +++ b/src/lib/elm_container.eo @@ -6,29 +6,29 @@ class Elm.Container (Elm.Widget) methods { @property content_swallow_list { get { -/*@ Get the list of swallow parts in the object. */ +[[Get the list of swallow parts in the object.]] } values { -ret: free(own(list *), eina_list_free); /*@ list */ +ret: free(own(list *), eina_list_free); [[list]] } } content_set { - /*@ Swallow the given object into the given part of the container. */ + [[Swallow the given object into the given part of the container.]] params { -@in name: const(char)*; /*@ the part in which to swallow the object */ -@in content: Evas.Object *; /*@ the object to swallow */ +@in name: const(char)*; [[the part in which to swallow the object]] +@in content: Evas.Object *; [[the object to swallow.]] } return: bool; } content_get { - /*@ Get the object swallowed in the given part of the container. */ + [[Get the object swallowed in the given part of the container.]] params { -@in name: const(char)* @nullable; /*@ the part in which the object is swallowed */ +@in name: const(char)* @nullable; [[the part in which the object is swallowed.]] } return: Evas.Object *; } content_unset { - /*@ Unswallow the object in the given part of the container and return it. */ + [[Unswallow the object in the given part of the container and return it.]] params { @in name: const(char)* @nullable; } --
[EGIT] [core/elementary] master 01/01: elm_dayselector: converted eo docs of dayselector to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=5c14fa2f3197a5867de1b42ce697c897c5fe13ce commit 5c14fa2f3197a5867de1b42ce697c897c5fe13ce Author: Vivek Ellur Date: Fri Jul 24 13:43:36 2015 +0100 elm_dayselector: converted eo docs of dayselector to new format Summary: Converted docs of elm_dayselector.eo to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2863 --- src/lib/elm_dayselector.eo | 173 +++-- 1 file changed, 72 insertions(+), 101 deletions(-) diff --git a/src/lib/elm_dayselector.eo b/src/lib/elm_dayselector.eo index 5cc6ea9..457cb7a 100644 --- a/src/lib/elm_dayselector.eo +++ b/src/lib/elm_dayselector.eo @@ -23,154 +23,125 @@ class Elm.Dayselector (Elm.Layout) methods { @property week_start { set { -/*@ -Set the starting day of Dayselector. +[[Set the starting day of Dayselector. -@see Elm_Dayselector_Day -@see elm_dayselector_week_start_get() - -@ingroup Dayselector */ + See also @Elm.Dayselector.Day, + @.week_start.get. +]] } get { -/*@ -Get the starting day of Dayselector. - -@return Day from where Dayselector displays all the weekdays in order. - -@see Elm_Dayselector_Day -@see elm_dayselector_week_start_set() +[[Get the starting day of Dayselector. -@ingroup Dayselector */ + See also @Elm.Dayselector.Day, + @.week_start.set. +]] } values { -day: Elm.Dayselector.Day; /*@ Dayselector_Day the first day that the user wants to display. */ +day: Elm.Dayselector.Day; [[Dayselector_Day the first day that the user wants to display.]] } } @property weekend_length { set { -/*@ -Set the weekend length of Dayselector. +[[Set the weekend length of Dayselector. -@see elm_dayselector_weekend_length_get() - -@ingroup Dayselector */ + See also @.weekend_length.get. +]] } get { -/*@ -Get the weekend length of Dayselector. - -@return Number of days marked as a weekend. - -@see Elm_Dayselector_Day -@see elm_dayselector_weekend_length_set() +[[Get the weekend length of Dayselector. -@ingroup Dayselector */ + See also @Elm.Dayselector.Day, + @.weekend_length.set. +]] } values { -length: uint; /*@ Weekend length, number of days as an integer. */ +length: uint; [[Weekend length, number of days as an integer.]] } } @property weekend_start { set { -/*@ -Set the weekend starting day of Dayselector. +[[Set the weekend starting day of Dayselector. -@see Elm_Dayselector_Day -@see elm_dayselector_weekend_start_get() - -@ingroup Dayselector */ + See also @Elm.Dayselector.Day, + @.weekend_start.get. +]] } get { -/*@ -Get the weekend starting day of Dayselector. - -@return Elm.Dayselector.Day Day from where weekend starts. - -@see Elm_Dayselector_Day -@see elm_dayselector_weekend_start_set() +[[Get the weekend starting day of Dayselector. -@ingroup Dayselector */ + See also @Elm.Dayselector.Day, + @.weekend_start.set. +]] } values { -day: Elm.Dayselector.Day; /*@ Dayselector_Day the first day from where weekend starts. */ +day: Elm.Dayselector.Day; [[Dayselector_Day the first day from where weekend starts.]] } } weekdays_names_set { - /*@ - Set weekdays names to be displayed by the Dayselector. - - By default or if @a weekdays is @c NULL, weekdays abbreviations get from system are displayed: - E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat" - - The first string should be related to Sunday, the second to Monday... - - The usage should be like this: - @code - const char *weekdays[] = - { - "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday" - }; - elm_dayselector_wekdays_names_set(calendar, weekdays); - @endcode - - @see elm_dayselector_weekdays_name_get() - @see
[EGIT] [core/elementary] master 01/02: elm_ctxpopup: convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=110fb9499fb0097a181d55960f8bac642850fe19 commit 110fb9499fb0097a181d55960f8bac642850fe19 Author: Vivek Ellur Date: Mon Jul 27 10:18:37 2015 +0100 elm_ctxpopup: convert eo docs to new format Summary: Converted docs of elm_ctxpopup.eo and elm_ctxpopup_item.eo to new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2862 --- src/lib/elm_ctxpopup.eo | 240 ++- src/lib/elm_ctxpopup_item.eo | 30 +++--- 2 files changed, 112 insertions(+), 158 deletions(-) diff --git a/src/lib/elm_ctxpopup.eo b/src/lib/elm_ctxpopup.eo index 916272c..bd89305 100644 --- a/src/lib/elm_ctxpopup.eo +++ b/src/lib/elm_ctxpopup.eo @@ -14,241 +14,201 @@ class Elm.Ctxpopup (Elm.Layout, Elm_Interface_Atspi_Widget_Action) methods { @property horizontal { set { -/*@ -@brief Change the ctxpopup's orientation to horizontal or vertical. - -@ingroup Ctxpopup */ +[[Change the ctxpopup's orientation to horizontal or vertical.]] } get { -/*@ -@brief Get the value of current ctxpopup object's orientation. - -@return @c EINA_TRUE for horizontal mode, @c EINA_FALSE for vertical mode (or errors) +[[Get the value of current ctxpopup object's orientation. -@see elm_ctxpopup_horizontal_set() - -@ingroup Ctxpopup */ + See also @.horizontal.set. +]] } values { -horizontal: bool; /*@ @c EINA_TRUE for horizontal mode, @c EINA_FALSE for vertical */ +horizontal: bool; [[$true for horizontal mode, $false for vertical.]] } } @property auto_hide_disabled { set { -/*@ -@brief Set ctxpopup auto hide mode triggered by ctxpopup policy. -@since 1.9 +[[Set ctxpopup auto hide mode triggered by ctxpopup policy. -Use this function when user wants ctxpopup not to hide automatically. -By default, ctxpopup is dismissed whenever mouse clicked its background area, language is changed, -and its parent geometry is updated(changed). -Not to hide ctxpopup automatically, disable auto hide function by calling this API, -then ctxpopup won't be dismissed in those scenarios. + Use this function when user wants ctxpopup not to hide automatically. + By default, ctxpopup is dismissed whenever mouse clicked its background area, language is changed, + and its parent geometry is updated(changed). + Not to hide ctxpopup automatically, disable auto hide function by calling this API, + then ctxpopup won't be dismissed in those scenarios. -Default value of disabled is @c EINA_FALSE. + Default value of disabled is $false. -@see elm_ctxpopup_auto_hide_disabled_get() + See also @.auto_hide_disabled.get. -@ingroup Ctxpopup */ + @since 1.9 +]] } get { -/*@ -@brief Get ctxpopup auto hide mode triggered by ctxpopup policy. -@since 1.9 - -@return auto hide mode's state of a ctxpopup +[[Get ctxpopup auto hide mode triggered by ctxpopup policy. -@see elm_ctxpopup_auto_hide_disabled_set() for more information. + See also @.auto_hide_disabled.set for more information. -@ingroup Ctxpopup */ + @since 1.9 +]] } values { -disabled: bool; /*@ auto hide enable/disable. */ +disabled: bool; [[auto hide enable/disable.]] } } @property hover_parent { set { -/*@ -@brief Set the Ctxpopup's parent +[[Set the Ctxpopup's parent -Set the parent object. + Set the parent object. -@note elm_ctxpopup_add() will automatically call this function -with its @c parent argument. + Note: \@ref elm_ctxpopup_add will automatically call this function + with its $parent argument. -@see elm_ctxpopup_add() -@see elm_hover_parent_set() - -@ingroup Ctxpopup */ + See also \@ref elm_ctxpopup_add, + \@ref elm_hover_parent_set. +]] } get { -/*@ -@brief Get the Ctxpopup's parent - -@see elm_ctxpopup_hover_parent_set() for more information +[[Get the Ctxpopup's parent -@ingroup Ctxpopup
[EGIT] [core/elementary] master 02/02: elm_diskselector: convert eo docs of diskselector to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=217971caccb381dc7de01fe4f3cca83f1885ff87 commit 217971caccb381dc7de01fe4f3cca83f1885ff87 Author: Vivek Ellur Date: Mon Jul 27 10:18:43 2015 +0100 elm_diskselector: convert eo docs of diskselector to new format Summary: Converted docs of elm_diskselector.eo and elm_diskselector_item.eo to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2864 --- src/lib/elm_diskselector.eo | 281 +-- src/lib/elm_diskselector_item.eo | 74 +-- 2 files changed, 151 insertions(+), 204 deletions(-) diff --git a/src/lib/elm_diskselector.eo b/src/lib/elm_diskselector.eo index 9c1a55f..d0d4d51 100644 --- a/src/lib/elm_diskselector.eo +++ b/src/lib/elm_diskselector.eo @@ -7,230 +7,189 @@ class Elm.Diskselector (Elm.Widget, Elm_Interface_Scrollable, methods { @property side_text_max_length { set { -/*@ -Set the side labels max length. +[[Set the side labels max length. -Length is the number of characters of items' label that will be -visible when it's set on side positions. It will just crop -the string after defined size. E.g.: + Length is the number of characters of items' label that will be + visible when it's set on side positions. It will just crop + the string after defined size. E.g.: -An item with label "January" would be displayed on side position as -"Jan" if max length is set to 3, or "Janu", if this property -is set to 4. + An item with label "January" would be displayed on side position as + "Jan" if max length is set to 3, or "Janu", if this property + is set to 4. -When it's selected, the entire label will be displayed, except for -width restrictions. In this case label will be cropped and "..." -will be concatenated. + When it's selected, the entire label will be displayed, except for + width restrictions. In this case label will be cropped and "..." + will be concatenated. -Default side label max length is 3. + Default side label max length is 3. -This property will be applied over all items, included before or -later this function call. - -@ingroup Diskselector */ + This property will be applied over all items, included before or + later this function call. +]] } get { -/*@ -Get the side labels max length. - -@see elm_diskselector_side_text_max_length_set() for details. +[[Get the side labels max length. -@return The max length defined for side labels, or 0 if not a valid -diskselector. - -@ingroup Diskselector */ + See also @.side_text_max_length.set for details. +]] } values { -len: int; /*@ The max length defined for side labels. */ +len: int; [[The max length defined for side labels.]] } } @property round_enabled { set { -/*@ -Enable or disable round mode. - -Disabled by default. If round mode is enabled the items list will -work like a circular list, so when the user reaches the last item, -the first one will popup. +[[Enable or disable round mode. -@see elm_diskselector_round_enabled_get() + Disabled by default. If round mode is enabled the items list will + work like a circular list, so when the user reaches the last item, + the first one will popup. -@ingroup Diskselector */ + See also @.round_enabled.get. +]] } get { -/*@ -Get a value whether round mode is enabled or not. +[[Get a value whether round mode is enabled or not. -@see elm_diskselector_round_enabled_set() for details. - -@return @c EINA_TRUE means round mode is enabled. @c EINA_FALSE indicates -it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. - -@ingroup Diskselector */ + See also @.round_enabled.set for details. +]] } values { -enabled: bool; /*@ @c EINA_TRUE to enable round mode or @c EINA_FALSE to -disable it. */ +enabled: bool; [[$true to enable round
[EGIT] [core/efl] master 03/09: eina_quaternion: add test cases for eina f16p16 quaternion functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=309962ed8f8bcc9f73d1a28b9a46cb3dca78cc27 commit 309962ed8f8bcc9f73d1a28b9a46cb3dca78cc27 Author: Vivek Ellur Date: Tue Jul 28 00:48:25 2015 +0200 eina_quaternion: add test cases for eina f16p16 quaternion functions Summary: Added test cases for various operations on eina f16p16 quaternions Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2792 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_quaternion.c | 58 +++ 1 file changed, 58 insertions(+) diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index dd704d5..78d1e2e 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -123,6 +123,63 @@ START_TEST(eina_test_quaternion_op) } END_TEST +START_TEST(eina_test_quaternion_f16p16) +{ + Eina_F16p16 x = 65536, y = 65536; + Eina_F16p16 z = 65536, w = 65536; + Eina_F16p16 res; + Eina_Quaternion p, q = {65536, 65536, 65536, 65536}; + Eina_Quaternion_F16p16 t, s, r = {65536, 65536, 65536, 65536}; + + + eina_init(); + + eina_quaternion_f16p16_set(&p, x, y, z, w); + fail_if(!eina_quaternion_cmp(&p, &q)); + + res = eina_quaternion_f16p16_norm(&r); + fail_if(res != 131072); + + eina_quaternion_f16p16_negative(&s, &r); + fail_if(s.x != s.y || + s.y != s.z || + s.z != s.w || + s.w != -65536); + + eina_quaternion_f16p16_add(&t, &s, &r); + fail_if(t.x != t.y || + t.y != t.z || + t.z != t.w || + t.w != 0); + + res = 1; + eina_quaternion_f16p16_scale(&t, &r, res); + fail_if(t.x != t.y || + t.y != t.z || + t.z != t.w || + t.w != 65536); + + eina_quaternion_f16p16_conjugate(&t, &r); + fail_if(t.x != -65536 || + t.y != -65536 || + t.z != -65536 || + t.w != 65536); + + s.x = 65536; + s.y = 65536; + s.z = 65536; + s.w = 65536; + res = eina_quaternion_f16p16_dot(&s, &r); + fail_if(res != 262144); + + eina_quaternion_f16p16_mul(&t, &s, &r); + fail_if(t.x != 131072 || + t.y != 131072 || + t.z != 131072 || + t.w != 0); +} +END_TEST + void eina_test_quaternion(TCase *tc) { @@ -130,4 +187,5 @@ eina_test_quaternion(TCase *tc) tcase_add_test(tc, eina_test_quaternion_conjugate); tcase_add_test(tc, eina_test_quaternion_matrix); tcase_add_test(tc, eina_test_quaternion_op); + tcase_add_test(tc, eina_test_quaternion_f16p16); } --
[EGIT] [core/efl] master 05/09: eina_quaternion: add forgotten implementation of converting eina_matrix3 to eina_quaternion
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f3768834c52d37f1cc13d4293e3322180ff5d6d7 commit f3768834c52d37f1cc13d4293e3322180ff5d6d7 Author: Vivek Ellur Date: Tue Jul 28 01:00:34 2015 +0200 eina_quaternion: add forgotten implementation of converting eina_matrix3 to eina_quaternion Summary: Implemenation of eina_matrix3_quaternion_get function Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2786 This was a function I forgot to finish implement. Thanks Vivek to take care of it. As it comes with a test case, is self contained and fix a missing bit of code I will push it at this point in time of our release process. Sorry everyone for that late push. Signed-off-by: Cedric BAIL --- src/lib/eina/eina_quaternion.c| 50 +-- src/tests/eina/eina_test_quaternion.c | 5 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_quaternion.c b/src/lib/eina/eina_quaternion.c index 8c751ac..0334d57 100644 --- a/src/lib/eina/eina_quaternion.c +++ b/src/lib/eina/eina_quaternion.c @@ -624,7 +624,53 @@ eina_quaternion_rotation_matrix3_get(Eina_Matrix3 *m, } EAPI void -eina_matrix3_quaternion_get(Eina_Quaternion *q EINA_UNUSED, -const Eina_Matrix3 *m EINA_UNUSED) +eina_matrix3_quaternion_get(Eina_Quaternion *q, +const Eina_Matrix3 *m) { + double tval; + double w, x, y, z; + + tval = m->xx + m->yy + m->zz; + + if (tval > 0) + { + +double s = 0.5 / sqrtf(tval + 1.0); + +w = (0.25 / s); +x = ((m->zy - m->yz) * s); +y = ((m->xz - m->zx) * s); +z = ((m->yx - m->xy) * s); + } + else if ((m->xx > m->yy) && (m->xx > m->zz)) + { +double s = 2.0 * sqrtf(1.0 + m->xx - m->yy - m->zz); + +w = ((m->zy - m->yz) / s); +x = (0.25 * s); +y = ((m->xy + m->yx) / s); +z = ((m->xz + m->zx) / s); + } + else if (m->yy > m->zz) + { +double s = 2.0 * sqrtf(1.0 + m->yy - m->xx - m->zz); + +w = ((m->xz - m->zx) / s); +x = ((m->xy + m->yx) / s); +y = (0.25 * s); +z = ((m->yz + m->zy) / s); + } + else + { +double s = 2.0 * sqrtf(1.0 + m->zz - m->xx - m->yy); + +w = ((m->yx - m->xy) / s); +x = ((m->xz + m->zx) / s); +y = ((m->yz + m->zy) / s); +z = (0.25 * s); + } + q->w = w; + q->x = x; + q->y = y; + q->z = z; } diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index 2e47580..1ffbc1a 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -90,6 +90,8 @@ END_TEST START_TEST(eina_test_quaternion_matrix) { Eina_Quaternion q = { 7, 9, 5, 1 }; + Eina_Quaternion q1 = {7, 9, 5, -1 }; + Eina_Quaternion tq; Eina_Matrix3 m = { -211, 136, 52, 116, -147, 104, @@ -102,6 +104,9 @@ START_TEST(eina_test_quaternion_matrix) eina_quaternion_rotation_matrix3_get(&tm, &q); fail_if(!eina_matrix3_cmp(&tm, &m)); + eina_matrix3_quaternion_get(&tq, &m); + fail_if(!eina_quaternion_cmp(&tq, &q) && !eina_quaternion_cmp(&tq, &q1)); + eina_shutdown(); } END_TEST --
[EGIT] [core/efl] master 04/09: eina_quaternion: add test cases for various eina quaternion operations
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=df50704764e0fd75b4be70c36a85611d85446bff commit df50704764e0fd75b4be70c36a85611d85446bff Author: Vivek Ellur Date: Tue Jul 28 00:55:56 2015 +0200 eina_quaternion: add test cases for various eina quaternion operations Summary: Added test cases for scale, multiply, normalize,dot operations for quaternion Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2790 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_quaternion.c | 79 +++ 1 file changed, 79 insertions(+) diff --git a/src/tests/eina/eina_test_quaternion.c b/src/tests/eina/eina_test_quaternion.c index 78d1e2e..2e47580 100644 --- a/src/tests/eina/eina_test_quaternion.c +++ b/src/tests/eina/eina_test_quaternion.c @@ -180,6 +180,80 @@ START_TEST(eina_test_quaternion_f16p16) } END_TEST +START_TEST(eina_test_quaternion_dot) +{ + Eina_Quaternion q = {1, 3, 4, 5}; + Eina_Quaternion r = {7, 9, 5, 1}; + double res; + + eina_init(); + + res = eina_quaternion_dot(&q, &r); + fail_if(res != 59); + + eina_shutdown(); +} +END_TEST + +START_TEST(eina_test_quaternion_scale) +{ + Eina_Quaternion q = {1, 3, 4, 5}; + double scale = 2; + Eina_Quaternion r, res = {2, 6, 8, 10}; + + eina_init(); + + eina_quaternion_scale(&r, &q, scale); + fail_if(!eina_quaternion_cmp(&r, &res)); + + eina_shutdown(); +} +END_TEST + +START_TEST(eina_test_quaternion_set) +{ + Eina_Quaternion q, r = {1, 3, 4, 5}; + + eina_init(); + + eina_quaternion_set(&q, 1, 3, 4, 5); + + fail_if(!eina_quaternion_cmp(&q, &r)); + + eina_shutdown(); +} +END_TEST + +START_TEST(eina_test_quaternion_mul) +{ + Eina_Quaternion p = {1, 3, 4, 5}; + Eina_Quaternion q = {7, 9, 5, 1}; + Eina_Quaternion r, res = {15, 71, 17, -49}; + + eina_init(); + + eina_quaternion_mul(&r, &p, &q); + fprintf(stderr, "%f %f %f %f\n", res.w, res.x, res.y, res.z); + fail_if(!eina_quaternion_cmp(&r, &res)); + + eina_shutdown(); +} +END_TEST + +START_TEST(eina_test_quaternion_normalized) +{ + Eina_Quaternion p = {1, 1, 1, 1}; + Eina_Quaternion res, q = {0.5, 0.5, 0.5, 0.5}; + + eina_init(); + + eina_quaternion_normalized(&res, &p); + fail_if(!eina_quaternion_cmp(&q, &res)); + + eina_shutdown(); +} +END_TEST + void eina_test_quaternion(TCase *tc) { @@ -188,4 +262,9 @@ eina_test_quaternion(TCase *tc) tcase_add_test(tc, eina_test_quaternion_matrix); tcase_add_test(tc, eina_test_quaternion_op); tcase_add_test(tc, eina_test_quaternion_f16p16); + tcase_add_test(tc, eina_test_quaternion_dot); + tcase_add_test(tc, eina_test_quaternion_scale); + tcase_add_test(tc, eina_test_quaternion_set); + tcase_add_test(tc, eina_test_quaternion_mul); + tcase_add_test(tc, eina_test_quaternion_normalized); } --
[EGIT] [core/elementary] master 02/03: elm_flipselector: convert docs of elm_flipselector.eo to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=0882c1ecb61bebb100c567d254de50b2585eee1f commit 0882c1ecb61bebb100c567d254de50b2585eee1f Author: Vivek Ellur Date: Wed Jul 29 14:44:07 2015 +0100 elm_flipselector: convert docs of elm_flipselector.eo to new format Summary: Changed docs of elm_flipselector.eo and elm_flipselector_item.eo to new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2884 --- src/lib/elm_flipselector.eo | 221 --- src/lib/elm_flipselector_item.eo | 59 --- 2 files changed, 113 insertions(+), 167 deletions(-) diff --git a/src/lib/elm_flipselector.eo b/src/lib/elm_flipselector.eo index 00598ed..4260e3f 100644 --- a/src/lib/elm_flipselector.eo +++ b/src/lib/elm_flipselector.eo @@ -5,190 +5,153 @@ class Elm.Flipselector (Elm.Layout, Elm_Interface_Atspi_Widget_Action, methods { @property first_interval { set { -/*@ -Set the interval on time updates for a user mouse button hold -on a flip selector widget. +[[Set the interval on time updates for a user mouse button hold + on a flip selector widget. -This interval value is @b decreased while the user holds the -mouse pointer either flipping up or flipping down a given flip -selector. + This interval value is decreased while the user holds the + mouse pointer either flipping up or flipping down a given flip + selector. -This helps the user to get to a given item distant from the -current one easier/faster, as it will start to flip quicker and -quicker on mouse button holds. + This helps the user to get to a given item distant from the + current one easier/faster, as it will start to flip quicker and + quicker on mouse button holds. -The calculation for the next flip interval value, starting from -the one set with this call, is the previous interval divided by -1.05, so it decreases a little bit. + The calculation for the next flip interval value, starting from + the one set with this call, is the previous interval divided by + 1.05, so it decreases a little bit. -The default starting interval value for automatic flips is -@b 0.85 seconds. + The default starting interval value for automatic flips is + 0.85 seconds. -@see elm_flipselector_first_interval_get() - -@ingroup Flipselector */ + See also @.first_interval.get. +]] } get { -/*@ -Get the interval on time updates for an user mouse button hold -on a flip selector widget. - -@return The (first) interval value, in seconds, set on it - -@see elm_flipselector_first_interval_set() for more details +[[Get the interval on time updates for an user mouse button hold + on a flip selector widget. -@ingroup Flipselector */ + See also @.first_interval.set for more details. +]] } values { -interval: double; /*@ The (first) interval value in seconds */ +interval: double; [[The (first) interval value in seconds.]] } } @property items { get { -/*@ -Get the internal list of items in a given flip selector widget. - -@return The list of items (#Elm_Object_Item as data) or -@c NULL on errors. - -This list is @b not to be modified in any way and must not be -freed. Use the list members with functions like -elm_object_item_text_set(), -elm_object_item_text_get(), -elm_object_item_del(), -elm_flipselector_item_selected_get(), -elm_flipselector_item_selected_set(). - -@warning This list is only valid until @p obj object's internal -items list is changed. It should be fetched again with another -call to this function when changes happen. - -@ingroup Flipselector */ +[[Get the internal list of items in a given flip selector widget. + + This list is not to be modified in any way and must not be + freed. Use the list members with functions like + \@ref elm_object_item_text_set, + \@ref elm_object_item_text_get, + \@ref elm_object_item_del, + \@ref elm_flipselector_item_selected_get, + \@ref elm_flipselector_item_selected_set. + + Warning: This list is only
[EGIT] [core/elementary] master 03/03: elm_frame: Changed eo docs of elm_frame to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=a043cd62bf4fe0e49adfd01bca78975d56dd70c3 commit a043cd62bf4fe0e49adfd01bca78975d56dd70c3 Author: Vivek Ellur Date: Wed Jul 29 14:44:12 2015 +0100 elm_frame: Changed eo docs of elm_frame to new format Summary: Changed docsw of elm_frame.eo according to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2885 --- src/lib/elm_frame.eo | 58 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/src/lib/elm_frame.eo b/src/lib/elm_frame.eo index aa95b68..6e24604 100644 --- a/src/lib/elm_frame.eo +++ b/src/lib/elm_frame.eo @@ -4,59 +4,45 @@ class Elm.Frame (Elm.Layout, Evas.Clickable_Interface) methods { @property collapse { set { -/*@ -@brief Manually collapse a frame without animations -Use this to toggle the collapsed state of a frame, bypassing animations. - -@ingroup Frame */ +[[Manually collapse a frame without animations + Use this to toggle the collapsed state of a frame, bypassing animations. +]] } get { -/*@ -@brief Determine the collapse state of a frame -@return true if collapsed, false otherwise - -Use this to determine the collapse state of a frame. - -@ingroup Frame */ +[[Determine the collapse state of a frame + Use this to determine the collapse state of a frame. +]] } values { -collapse: bool; /*@ true to collapse, false to expand */ +collapse: bool; [[$true to collapse, $false to expand.]] } } @property autocollapse { set { -/*@ -@brief Toggle autocollapsing of a frame -When @p enable is EINA_TRUE, clicking a frame's label will collapse the frame -vertically, shrinking it to the height of the label. -By default, this is DISABLED. - -@ingroup Frame */ +[[Toggle autocollapsing of a frame + When $enable is $true, clicking a frame's label will collapse the frame + vertically, shrinking it to the height of the label. + By default, this is DISABLED. +]] } get { -/*@ -@brief Determine autocollapsing of a frame -@return Whether autocollapse is enabled +[[Determine autocollapsing of a frame -When this returns EINA_TRUE, clicking a frame's label will collapse the frame -vertically, shrinking it to the height of the label. -By default, this is DISABLED. - -@ingroup Frame */ + When this returns $true, clicking a frame's label will collapse the frame + vertically, shrinking it to the height of the label. + By default, this is DISABLED. +]] } values { -autocollapse: bool; /*@ Whether to enable autocollapse */ +autocollapse: bool; [[Whether to enable autocollapse.]] } } collapse_go { - /*@ - @brief Manually collapse a frame with animations - Use this to toggle the collapsed state of a frame, triggering animations. - - @ingroup Frame */ - + [[Manually collapse a frame with animations + Use this to toggle the collapsed state of a frame, triggering animations. + ]] params { -@in collapse: bool; /*@ true to collapse, false to expand */ +@in collapse: bool; [[$true to collapse, $false to expand.]] } } } --
[EGIT] [core/elementary] master 01/03: elm_fileselector: Converted eo docs of fileselector_entry to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=a95a7297eabc839a51bce1c027cc63f45b3ab629 commit a95a7297eabc839a51bce1c027cc63f45b3ab629 Author: Vivek Ellur Date: Wed Jul 29 14:44:00 2015 +0100 elm_fileselector: Converted eo docs of fileselector_entry to new format Summary: Converted docs of elm_fileselector_entry.eo to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2882 --- src/lib/elm_fileselector_entry.eo | 103 -- 1 file changed, 43 insertions(+), 60 deletions(-) diff --git a/src/lib/elm_fileselector_entry.eo b/src/lib/elm_fileselector_entry.eo index 065cd84..00c51c2 100644 --- a/src/lib/elm_fileselector_entry.eo +++ b/src/lib/elm_fileselector_entry.eo @@ -5,95 +5,78 @@ class Elm.Fileselector_Entry (Elm.Layout, Elm_Interface_Fileselector, methods { @property inwin_mode { set { -/*@ -Set whether a given file selector entry widget's internal file -selector will raise an Elementary "inner window", instead of a -dedicated Elementary window. By default, it depends on the current -profile. - -@see elm_win_inwin_add() for more information on inner windows -@see elm_fileselector_entry_inwin_mode_get() - -@ingroup File_Selector_Entry */ +[[Set whether a given file selector entry widget's internal file + selector will raise an Elementary "inner window", instead of a + dedicated Elementary window. By default, it depends on the current + profile. + + See also \@ref elm_win_inwin_add for more information on inner windows, + @.inwin_mode.get. +]] } get { -/*@ -Get whether a given file selector entry widget's internal file -selector will raise an Elementary "inner window", instead of a -dedicated Elementary window. - -@return @c EINA_TRUE if will use an inner window, @c EINA_FALSE -if it will use a dedicated window +[[Get whether a given file selector entry widget's internal file + selector will raise an Elementary "inner window", instead of a + dedicated Elementary window. -@see elm_fileselector_entry_inwin_mode_set() for more details - -@ingroup File_Selector_Entry */ + See also @.inwin_mode.set for more details. +]] } values { -value: bool; /*@ @c EINA_TRUE to make it use an inner window, @c -EINA_FALSE to make it use a dedicated window */ +value: bool; [[$true to make it use an inner window, $false +to make it use a dedicated window.]] } } @property window_size { set { -/*@ -Set the size of a given file selector entry widget's window, -holding the file selector itself. - -@note it will only take any effect if the file selector entry -widget is @b not under "inwin mode". The default size for the -window (when applicable) is 400x400 pixels. +[[Set the size of a given file selector entry widget's window, + holding the file selector itself. -@see elm_fileselector_entry_window_size_get() + Note: it will only take any effect if the file selector entry + widget is not under "inwin mode". The default size for the + window (when applicable) is 400x400 pixels. -@ingroup File_Selector_Entry */ + See also @.window_size.get. +]] } get { -/*@ -Get the size of a given file selector entry widget's window, -holding the file selector itself. +[[Get the size of a given file selector entry widget's window, + holding the file selector itself. -@note Use @c NULL pointers on the size values you're not -interested in: they'll be ignored by the function. + Note: Use $null pointers on the size values you're not + interested in: they'll be ignored by the function. -@see elm_fileselector_entry_window_size_set(), for more details - -@ingroup File_Selector_Entry */ + See also @.window_size.set, for more details. +]] } values { -width: Evas.Coord; /*@ The window's width */ -height: Evas.Coord; /*@ The window's height */ +width: Evas.Coord; [[The window'
[EGIT] [core/elementary] master 01/01: elm_entry: Convert eo docs to new format
q66 pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=f218bbb01c1d1671bb3ac92b9d48b5f8c1b89692 commit f218bbb01c1d1671bb3ac92b9d48b5f8c1b89692 Author: Vivek Ellur Date: Fri Aug 7 13:04:27 2015 +0100 elm_entry: Convert eo docs to new format Summary: Changed elm_entry.eo docs to the new format Signed-off-by: Vivek Ellur Reviewers: cedric, q66 Reviewed By: q66 Differential Revision: https://phab.enlightenment.org/D2924 --- src/lib/elm_entry.eo | 1092 +- 1 file changed, 365 insertions(+), 727 deletions(-) diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo index e15334a..33819e1 100644 --- a/src/lib/elm_entry.eo +++ b/src/lib/elm_entry.eo @@ -104,97 +104,74 @@ class Elm.Entry (Elm.Layout, Elm_Interface_Scrollable, Evas.Clickable_Interface, methods { @property scrollable { set { -/*@ -Enable or disable scrolling in entry +[[Enable or disable scrolling in entry -Normally the entry is not scrollable unless you enable it with this call. - -@ingroup Entry */ + Normally the entry is not scrollable unless you enable it with this call. +]] } get { -/*@ -Get the scrollable state of the entry - -Normally the entry is not scrollable. This gets the scrollable state -of the entry. See elm_entry_scrollable_set() for more information. - -@return The scrollable state +[[Get the scrollable state of the entry -@ingroup Entry */ + Normally the entry is not scrollable. This gets the scrollable state + of the entry. +]] } values { -scroll: bool; /*@ true if it is to be scrollable, false otherwise */ +scroll: bool; [[$true if it is to be scrollable, $false otherwise.]] } } @property input_panel_show_on_demand { set { -/*@ -Set the attribute to show the input panel in case of only an user's explicit Mouse Up event. -It doesn't request to show the input panel even though it has focus. - -@ingroup Entry */ +[[Set the attribute to show the input panel in case of only an user's explicit Mouse Up event. + It doesn't request to show the input panel even though it has focus. +]] } get { -/*@ -Get the attribute to show the input panel in case of only an user's explicit Mouse Up event. - -@return $true if the input panel will be shown in case of only Mouse up event. -@since 1.9 +[[Get the attribute to show the input panel in case of only an user's explicit Mouse Up event. -@ingroup Entry */ + @since 1.9 +]] } values { -ondemand: bool; /*@ If true, the input panel will be shown in case of only Mouse up event. +ondemand: bool; [[If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.) -@since 1.9 */ + +@since 1.9.]] } } @property context_menu_disabled { set { -/*@ -This disables the entry's contextual (longpress) menu. - -@ingroup Entry */ +[[This disables the entry's contextual (longpress) menu.]] } get { -/*@ -This returns whether the entry's contextual (longpress) menu is -disabled. - -@return If true, the menu is disabled - -@ingroup Entry */ +[[This returns whether the entry's contextual (longpress) menu is + disabled. +]] } values { -disabled: bool; /*@ If true, the menu is disabled */ +disabled: bool; [[If $true, the menu is disabled.]] } } @property cnp_mode { set { -/*@ -Control pasting of text and images for the widget. +[[Control pasting of text and images for the widget. -Normally the entry allows both text and images to be pasted. -By setting cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past. -By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all tags in text . + Normally the entry allows both text and images to be pasted. + By setting cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past. + By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all tags in text . -
[EGIT] [core/elementary] master 01/01: elementary: Port evas smart callbacks to Eo callbacks
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=74981a3dbe01702181331c19fb880274faa2a0a7 commit 74981a3dbe01702181331c19fb880274faa2a0a7 Author: Vivek Ellur Date: Fri Aug 28 15:58:54 2015 +0900 elementary: Port evas smart callbacks to Eo callbacks Summary: Changed evas_object_smart_callback_add to eo_event_callback_add functions Signed-off-by: Vivek Ellur Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2997 --- .../datetime_input_ctxpopup.c | 47 ++ 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c index 05d59dc..8e2d397 100644 --- a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c +++ b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c @@ -33,13 +33,16 @@ _diskselector_item_free_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event free(data); } -static void -_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) +static Eina_Bool +_ctxpopup_dismissed_cb(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED) { Ctxpopup_Module_Data *ctx_mod; ctx_mod = (Ctxpopup_Module_Data *)data; evas_object_del(obj); ctx_mod->ctxpopup = NULL; + + return EINA_TRUE; } static void @@ -84,15 +87,16 @@ _field_value_get(struct tm *tim, Elm_Datetime_Field_Type field_type) return (*timearr[field_type]); } -static void -_diskselector_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +static Eina_Bool +_diskselector_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info) { DiskItem_Data *disk_data; struct tm curr_time; const char *fmt; disk_data = (DiskItem_Data *)elm_object_item_data_get(event_info); - if (!disk_data || !(disk_data->ctx_mod)) return; + if (!disk_data || !(disk_data->ctx_mod)) return EINA_FALSE; elm_datetime_value_get(disk_data->ctx_mod->mod_data.base, &curr_time); fmt = disk_data->ctx_mod->mod_data.field_format_get(disk_data->ctx_mod->mod_data.base, disk_data->sel_field_type); @@ -102,25 +106,32 @@ _diskselector_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve _field_value_set(&curr_time, disk_data->sel_field_type, disk_data->sel_field_value); elm_datetime_value_set(disk_data->ctx_mod->mod_data.base, &curr_time); evas_object_hide(disk_data->ctx_mod->ctxpopup); + + return EINA_TRUE; } -static void -_ampm_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +static Eina_Bool +_ampm_clicked_cb(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED) { Ctxpopup_Module_Data *ctx_mod; struct tm curr_time; ctx_mod = (Ctxpopup_Module_Data *)data; - if (!ctx_mod) return; + if (!ctx_mod) return EINA_FALSE; elm_datetime_value_get(ctx_mod->mod_data.base, &curr_time); if (curr_time.tm_hour >= 12) curr_time.tm_hour -= 12; else curr_time.tm_hour += 12; elm_datetime_value_set(ctx_mod->mod_data.base, &curr_time); + return EINA_TRUE; } -static void -_field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) +static Eina_Bool +_field_clicked_cb(void *data, Eo *obj, + const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED) { Ctxpopup_Module_Data *ctx_mod; Evas_Object *diskselector; @@ -136,7 +147,7 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) Evas_Coord x = 0, y = 0, w = 0, h = 0, width; ctx_mod = (Ctxpopup_Module_Data *)data; - if (!ctx_mod) return; + if (!ctx_mod) return EINA_FALSE; snprintf(buf, sizeof(buf), "datetime/%s", elm_object_style_get(obj)); @@ -146,12 +157,13 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 0.5); - evas_object_smart_callback_add(ctx_mod->ctxpopup, "dismissed", - _ctxpopup_dismissed_cb, ctx_mod); + eo_do(ctx_mod->ctxpopup, eo_event_callback_add + (ELM_CTXPOPUP_EVENT_DISMISSED, _ctxpopup_dismissed_cb, ctx_mod)); elm_ctxpopup_hover_parent_set(ctx_mod->ctxpopup, elm_widget_top_get(obj)); diskselector = elm_diskselector_add(elm_widget_top_g
[EGIT] [core/elementary] master 01/01: elm_conform: Port evas smart callbacks to eo
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=0b65301d3bbc9e843a45b6c399560ffb85718bc2 commit 0b65301d3bbc9e843a45b6c399560ffb85718bc2 Author: Vivek Ellur Date: Fri Aug 28 16:14:31 2015 +0900 elm_conform: Port evas smart callbacks to eo Summary: Changed evas_object_smart_callback_add functions to eo_event_callback_add functions Signed-off-by: Vivek Ellur Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2996 --- src/lib/elm_conform.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 543aa7d..dd32aa4 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -348,9 +348,10 @@ _land_indicator_connect_cb(void *data) return ECORE_CALLBACK_RENEW; } -static void +static Eina_Bool _land_indicator_disconnected(void *data, - Evas_Object *obj EINA_UNUSED, + Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *conform = data; @@ -359,11 +360,13 @@ _land_indicator_disconnected(void *data, sd->land_indi_timer = ecore_timer_add(ELM_CONFORM_INDICATOR_TIME, _land_indicator_connect_cb, conform); + return EINA_TRUE; } -static void +static Eina_Bool _port_indicator_disconnected(void *data, - Evas_Object *obj EINA_UNUSED, + Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *conform = data; @@ -372,6 +375,7 @@ _port_indicator_disconnected(void *data, sd->port_indi_timer = ecore_timer_add(ELM_CONFORM_INDICATOR_TIME, _port_indicator_connect_cb, conform); + return EINA_TRUE; } static Evas_Object * @@ -407,8 +411,8 @@ _create_portrait_indicator(Evas_Object *obj) } elm_widget_sub_object_add(obj, port_indicator); - evas_object_smart_callback_add(port_indicator, "image.deleted", _port_indicator_disconnected, obj); - + eo_do(port_indicator, eo_event_callback_add + (ELM_PLUG_EVENT_IMAGE_DELETED, _port_indicator_disconnected, NULL)); evas_object_size_hint_min_set(port_indicator, -1, 0); evas_object_size_hint_max_set(port_indicator, -1, 0); @@ -448,8 +452,8 @@ _create_landscape_indicator(Evas_Object *obj) } elm_widget_sub_object_add(obj, land_indicator); - evas_object_smart_callback_add(land_indicator, "image.deleted",_land_indicator_disconnected, obj); - + eo_do(land_indicator, eo_event_callback_add + (ELM_PLUG_EVENT_IMAGE_DELETED, _land_indicator_disconnected, NULL)); evas_object_size_hint_min_set(land_indicator, -1, 0); evas_object_size_hint_max_set(land_indicator, -1, 0); return land_indicator; --
[EGIT] [core/elementary] master 01/01: elm_colorclass: Changed evas object smart callbacks to use eo event callbacks
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=97a3144827ce65296c8a19fef0209b767db497c6 commit 97a3144827ce65296c8a19fef0209b767db497c6 Author: Vivek Ellur Date: Fri Aug 28 16:16:37 2015 +0900 elm_colorclass: Changed evas object smart callbacks to use eo event callbacks Summary: Replaced evas_object_smart_callback_add with eo_event_callback_add api Signed-off-by: Vivek Ellur Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2998 --- src/lib/elm_color_class.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/lib/elm_color_class.c b/src/lib/elm_color_class.c index 9c1b384..aa014d5 100644 --- a/src/lib/elm_color_class.c +++ b/src/lib/elm_color_class.c @@ -127,8 +127,10 @@ _colorclass_select(void *data, Evas_Object *obj EINA_UNUSED, const char *sig, co cc->current->color[cc->num].b, cc->current->color[cc->num].a); } -static void -_colorclass_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +static Eina_Bool +_colorclass_changed(void *data, Evas_Object *obj EINA_UNUSED, +const Eo_Event_Description *desc EINA_UNUSED, +void *event_info EINA_UNUSED) { Colorclass_UI *cc = data; @@ -148,15 +150,18 @@ _colorclass_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info E _colorclass_cc_update(cc, cc->num); cc->change_reset = 0; cc->changed = 1; + return EINA_TRUE; } -static void -_colorclass_reset(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +static Eina_Bool +_colorclass_reset(void *data, Evas_Object *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, + void *event_info EINA_UNUSED) { Colorclass_UI *cc = data; Colorclass color; - if (!cc->current) return; + if (!cc->current) return EINA_FALSE; if (cc->winid && remote_iface) { Eldbus_Message *msg; @@ -166,7 +171,7 @@ _colorclass_reset(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EIN eldbus_message_arguments_append(msg, "s", cc->current->name); eldbus_service_signal_send(remote_iface, msg); cc->change_reset = 1; -return; +return EINA_FALSE; } edje_color_class_del(cc->current->name); edje_color_class_get(cc->current->name, @@ -185,10 +190,13 @@ _colorclass_reset(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EIN _colorclass_cc_update(cc, 0); _colorclass_cc_update(cc, 1); _colorclass_cc_update(cc, 2); + return EINA_TRUE; } -static void -_colorclass_activate(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +static Eina_Bool +_colorclass_activate(void *data, Eo *obj EINA_UNUSED, + const Eo_Event_Description *desc EINA_UNUSED, + void *event_info) { Colorclass_UI *cc = data; Elm_Object_Item *it = event_info; @@ -224,6 +232,7 @@ _colorclass_activate(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) elm_colorselector_color_set(cc->cs, cc->current->color[0].r, cc->current->color[0].g, cc->current->color[0].b, cc->current->color[0].a); elm_layout_signal_emit(cc->ly, "elm,colors,show", "elm"); + return EINA_TRUE; } static void @@ -730,19 +739,22 @@ elm_color_class_editor_add(Evas_Object *obj, uint64_t winid) elm_scroller_policy_set(gl, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); elm_genlist_mode_set(gl, ELM_LIST_COMPRESS); elm_object_part_content_set(ly, "elm.swallow.list", gl); - evas_object_smart_callback_add(gl, "selected", _colorclass_activate, cc); + eo_do(gl, eo_event_callback_add + (EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _colorclass_activate, cc)); cc->reset = bt = elm_button_add(ly); elm_object_style_set(bt, "colorclass"); /* FIXME: translate */ elm_object_text_set(bt, "Reset"); elm_object_part_content_set(ly, "elm.swallow.reset", bt); - evas_object_smart_callback_add(bt, "clicked", _colorclass_reset, cc); + eo_do(bt, eo_event_callback_add + (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _colorclass_reset, cc)); cc->cs = cs = elm_colorselector_add(ly); elm_colorselector_mode_set(cs, ELM_COLORSELECTOR_COMPONENTS); elm_object_part_content_set(ly, "elm.swallow.colors", cs); - evas_object_smart_callback_add(cs, "changed,user", _colorclass_changed, cc); + eo_do(cs, eo_event_callback_add + (ELM_COLORSELECTOR_EVENT_CHANGED_USER, _colorclass_changed, cc)); EINA_LIST_FREE(ccs, ecc) elm_genlist_item_append(gl, &itc, ecc, NULL, 0, NULL, NULL); --
[EGIT] [core/elementary] master 01/01: elementary: Port evas object smart callbacks to use eo event callbacks
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=d040f90d15a69f394e17ab19119e541d95bf9c4c commit d040f90d15a69f394e17ab19119e541d95bf9c4c Author: Vivek Ellur Date: Fri Aug 28 16:30:27 2015 +0900 elementary: Port evas object smart callbacks to use eo event callbacks Summary: Changed evas_object_smart_callback_add APIs to use eo_event_callback_add API Signed-off-by: Vivek Ellur Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2995 --- src/modules/prefs/Makefile.am| 1 + src/modules/prefs/elm_button.c | 8 +--- src/modules/prefs/elm_check.c| 9 + src/modules/prefs/elm_datetime.c | 8 +--- src/modules/prefs/elm_entry.c| 13 - src/modules/prefs/elm_slider.c | 9 + src/modules/prefs/elm_spinner.c | 8 +--- 7 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/modules/prefs/Makefile.am b/src/modules/prefs/Makefile.am index c7b4759..d7280cb 100644 --- a/src/modules/prefs/Makefile.am +++ b/src/modules/prefs/Makefile.am @@ -14,6 +14,7 @@ elm_prefs_swallow.edj: Makefile elm_prefs_swallow.edc $(top_builddir)/src/modules/prefs/elm_prefs_swallow.edj AM_CPPFLAGS = \ +-DELM_INTERNAL_API_ARGESFSDFEFC=1 \ -I. \ -I$(top_builddir) \ -I$(top_srcdir) \ diff --git a/src/modules/prefs/elm_button.c b/src/modules/prefs/elm_button.c index 53c03f3..cff42e3 100644 --- a/src/modules/prefs/elm_button.c +++ b/src/modules/prefs/elm_button.c @@ -8,14 +8,15 @@ static Elm_Prefs_Item_Type supported_types[] = ELM_PREFS_TYPE_UNKNOWN }; -static void +static Eina_Bool _item_changed_cb(void *data, - Evas_Object *obj, + Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; prefs_it_changed_cb(obj); + return EINA_TRUE; } static Evas_Object * @@ -27,7 +28,8 @@ elm_prefs_button_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED, { Evas_Object *obj = elm_button_add(prefs); - evas_object_smart_callback_add(obj, "clicked", _item_changed_cb, cb); + eo_do(obj, eo_event_callback_add + (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _item_changed_cb, cb)); return obj; } diff --git a/src/modules/prefs/elm_check.c b/src/modules/prefs/elm_check.c index 8940c3b..b41243e 100644 --- a/src/modules/prefs/elm_check.c +++ b/src/modules/prefs/elm_check.c @@ -6,14 +6,15 @@ static Elm_Prefs_Item_Type supported_types[] = ELM_PREFS_TYPE_UNKNOWN }; -static void +static Eina_Bool _item_changed_cb(void *data, - Evas_Object *obj, + Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; prefs_it_changed_cb(obj); +return EINA_TRUE; } static Evas_Object * @@ -25,8 +26,8 @@ elm_prefs_check_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED, { Evas_Object *obj = elm_check_add(prefs); - evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); - + eo_do(obj, eo_event_callback_add + (ELM_CHECK_EVENT_CHANGED, _item_changed_cb, cb)); elm_check_state_set(obj, spec.b.def); return obj; diff --git a/src/modules/prefs/elm_datetime.c b/src/modules/prefs/elm_datetime.c index 72c9f79..3637e91 100644 --- a/src/modules/prefs/elm_datetime.c +++ b/src/modules/prefs/elm_datetime.c @@ -6,14 +6,15 @@ static Elm_Prefs_Item_Type supported_types[] = ELM_PREFS_TYPE_UNKNOWN }; -static void +static Eina_Bool _item_changed_cb(void *data, - Evas_Object *obj, + Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) { Elm_Prefs_Item_Changed_Cb prefs_it_changed_cb = data; prefs_it_changed_cb(obj); + return EINA_TRUE; } static Evas_Object * @@ -32,7 +33,8 @@ elm_prefs_datetime_add(const Elm_Prefs_Item_Iface *iface EINA_UNUSED, elm_datetime_field_visible_set(obj, ELM_DATETIME_MINUTE, EINA_FALSE); elm_datetime_field_visible_set(obj, ELM_DATETIME_AMPM, EINA_FALSE); - evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); + eo_do(obj, eo_event_callback_add + (ELM_DATETIME_EVENT_CHANGED, _item_changed_cb, cb)); t.tm_year = spec.d.min.y - 1900; t.tm_mon = spec.d.min.m - 1; diff --git a/src/modules/prefs/elm_entry.c b/src/modules/prefs/elm_entry.c index e6cf68f..301842d 100644 --- a/src/modules/prefs/elm_entry.c +++ b/src/modules/prefs/elm_entry.c @@ -1,4 +1,5 @@ #include "private.h" +#include "elm_widget.h" #include #include @@ -93,14 +94,15 @@ mismatch: return EINA_FALSE; } -static void +static Eina_Bool _item_changed_cb(void *data, - Evas_Object *obj, +
[EGIT] [core/efl] master 01/01: edje_embryo: Fix null dereference issue
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=abe131d1d7c6fc8963a27620e315fe511a6b3576 commit abe131d1d7c6fc8963a27620e315fe511a6b3576 Author: Vivek Ellur Date: Wed Dec 23 19:12:06 2015 +0900 edje_embryo: Fix null dereference issue Summary: Fix Coverity issue ID 1299026 Signed-off-by: Vivek Ellur Reviewers: cedric, raster Reviewed By: raster Subscribers: raster, cedric Differential Revision: https://phab.enlightenment.org/D3218 --- src/lib/edje/edje_embryo.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c index 2595603..c4cba4f 100644 --- a/src/lib/edje/edje_embryo.c +++ b/src/lib/edje/edje_embryo.c @@ -1293,6 +1293,7 @@ _edje_embryo_fn_set_tween_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(8)) { GETSTR(tmp, params[8]); + if (!tmp) return 0; if (!strcmp(tmp, "CURRENT")) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } @@ -1303,6 +1304,7 @@ _edje_embryo_fn_set_tween_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(9)) { GETSTR(tmp, params[9]); + if (!tmp) return 0; if (!strcmp(tmp, "CURRENT")) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } @@ -1319,6 +1321,7 @@ _edje_embryo_fn_set_tween_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(10)) { GETSTR(tmp, params[10]); + if (!tmp) return 0; if (!strcmp(tmp, "CURRENT")) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } @@ -1335,6 +1338,7 @@ _edje_embryo_fn_set_tween_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(12)) { GETSTR(tmp, params[10]); + if (!tmp) return 0; if (!strcmp(tmp, "CURRENT")) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } --
[EGIT] [core/efl] master 02/04: eina_strbuf: add test cases for eina strbuf prepend functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d8166c75079d16211de75ea5007353ee57d5ab33 commit d8166c75079d16211de75ea5007353ee57d5ab33 Author: Vivek Ellur Date: Wed Feb 17 14:24:20 2016 -0800 eina_strbuf: add test cases for eina strbuf prepend functions Summary: Added test cases for eina_strbuf_prepend_printf and eina_strbuf_prepend_vprintf functions Signed-off-by: Vivek Ellur Reviewers: raster, jpeg, cedric Subscribers: seoz, jpeg, raster, cedric Differential Revision: https://phab.enlightenment.org/D3163 --- src/tests/eina/eina_test_strbuf.c | 60 +++ 1 file changed, 60 insertions(+) diff --git a/src/tests/eina/eina_test_strbuf.c b/src/tests/eina/eina_test_strbuf.c index b8f27f0..3b2fe33 100644 --- a/src/tests/eina/eina_test_strbuf.c +++ b/src/tests/eina/eina_test_strbuf.c @@ -534,6 +534,7 @@ START_TEST(strbuf_substr_get) const char *str; eina_init(); + buf = eina_strbuf_new(); fail_unless(buf != NULL); @@ -567,6 +568,64 @@ START_TEST(strbuf_substr_get) fail_if(substr); eina_strbuf_free(buf); + + eina_shutdown(); +} +END_TEST + +static const char* +test_prepend_vprintf(Eina_Strbuf *buf, char *fmt, va_list ap) +{ + const char *str; + + eina_strbuf_prepend_vprintf(buf, fmt, ap); + str = eina_strbuf_string_get(buf); + return str; +} + +static const char* +test_prepend(Eina_Strbuf *buf, ...) +{ + const char *str; + + va_list ap; + + va_start(ap, buf); + str = test_prepend_vprintf(buf, "%s %s %s %s", ap); + return str; +} + +START_TEST(strbuf_prepend_print) +{ + Eina_Bool ret; + Eina_Strbuf* buf; + const char *str; + + eina_init(); + buf = eina_strbuf_new(); + fail_unless(buf != NULL); + + ret = eina_strbuf_prepend_printf(buf, "%s", "string"); + fail_if(ret != EINA_TRUE); + str = eina_strbuf_string_get(buf); + fail_if(str == NULL || strcmp(str, "string") != 0); + + ret = eina_strbuf_prepend_printf(buf, "This is %d ", 1); + fail_if(ret != EINA_TRUE); + str = eina_strbuf_string_get(buf); + fail_if(str == NULL || strcmp(str, "This is 1 string") != 0); + + ret = eina_strbuf_prepend_printf(buf, "%s ", "hello"); + fail_if(ret != EINA_TRUE); + str = eina_strbuf_string_get(buf); + fail_if(str == NULL || strcmp(str, "hello This is 1 string") != 0); + eina_strbuf_reset(buf); + + str = test_prepend(buf, "This", "is", "test", "string"); + fail_if(str == NULL || strcmp(str, "This is test string") != 0); + + eina_strbuf_free(buf); + eina_shutdown(); } END_TEST @@ -586,4 +645,5 @@ eina_test_strbuf(TCase *tc) tcase_add_test(tc, strbuf_trim); tcase_add_test(tc, strbuf_tolower); tcase_add_test(tc, strbuf_substr_get); + tcase_add_test(tc, strbuf_prepend_print); } --
[EGIT] [core/efl] master 02/02: eina: fix eina_inarray_search to do linear search
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=756ed9ccbabc202027ab2c15f25f48483e800b86 commit 756ed9ccbabc202027ab2c15f25f48483e800b86 Author: Vivek Ellur Date: Thu May 14 19:37:06 2015 +0200 eina: fix eina_inarray_search to do linear search Summary: Currently eina_inarray_search was using binary search to search elements which would not work on unsorted array so modified it to work as linear search. There is already a function eina_inarray_search_sorted to work on sorted array. Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2501 Signed-off-by: Cedric BAIL --- src/lib/eina/eina_inarray.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lib/eina/eina_inarray.c b/src/lib/eina/eina_inarray.c index 2d52e6f..a216f02 100644 --- a/src/lib/eina/eina_inarray.c +++ b/src/lib/eina/eina_inarray.c @@ -150,12 +150,23 @@ _eina_inarray_get(const Eina_Inarray *array, unsigned int position) static int _eina_inarray_search(const Eina_Inarray *array, const void *data, Eina_Compare_Cb compare) { - const unsigned char *start, *found; - start = array->members; - found = bsearch(data, start, array->len, array->member_size, compare); - if (!found) + unsigned int found, pos=-1; + void *p; + + if (array->len == 0) + return -1; + + for (pos = 0; pos < array->len; ++pos) + { +p = _eina_inarray_get(array, pos); +found = compare(data, p); +if (found == 0) + break; + } + if (pos < array->len) + return pos; + else return -1; - return (found - start) / array->member_size; } static unsigned int --
[EGIT] [core/efl] master 01/02: eina: add test cases for various eina_inarray functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c3a644acff12751891ef0ee78c1bba5106c7d9a4 commit c3a644acff12751891ef0ee78c1bba5106c7d9a4 Author: Vivek Ellur Date: Thu May 14 19:36:25 2015 +0200 eina: add test cases for various eina_inarray functions Summary: Added test cases for eina_inarray_search, eina_inarray_search_sorted, eina_inarray_foreach_remove and other functions Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2504 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_inarray.c | 105 + 1 file changed, 105 insertions(+) diff --git a/src/tests/eina/eina_test_inarray.c b/src/tests/eina/eina_test_inarray.c index 5139770..e54a5cf 100644 --- a/src/tests/eina/eina_test_inarray.c +++ b/src/tests/eina/eina_test_inarray.c @@ -389,6 +389,110 @@ START_TEST(eina_inarray_test_itr) } END_TEST +int +cmp(const void *a, const void *b) +{ + return *(int *)a - *(int *)b; +} + +int +compare(const void *a, const void *b) +{ + return *(int *)a > *(int *)b; +} + +static Eina_Bool +match_cb(const void *array EINA_UNUSED, void *p, void *user_data) +{ + int *member = p; + int *i = user_data; + + if (*i == *member) + return EINA_TRUE; + else + return EINA_FALSE; +} + +START_TEST(eina_inarray_test_search) +{ + Eina_Inarray *iarr; + int i, ret, temp=92, ret1; + int arr[] = {91, 95, 97, 93, 92, 94}; + int arr_size = sizeof(arr)/sizeof(arr[0]); + unsigned int curr_len; + Eina_Bool rval; + + eina_init(); + + iarr = eina_inarray_new(sizeof(int), 0); + + //search in empty array + ret = eina_inarray_search(iarr, &temp, cmp); + fail_if(ret != -1); + + //search in single element array + temp = 91; + eina_inarray_push(iarr, &arr[0]); + ret = eina_inarray_search(iarr, &temp, cmp); + fail_if(ret != 0); + + temp = 92; + ret = eina_inarray_search(iarr, &temp, cmp); + fail_if(ret != -1); + + for (i = 1; i < arr_size; ++i) + { +ret = eina_inarray_push(iarr, &arr[i]); +fail_unless(ret == i); + } + temp = 92; + ret = eina_inarray_search(iarr, &temp, cmp); + fail_if(ret != 4); + + temp = 100; + ret = eina_inarray_search(iarr, &temp, cmp); + fail_if(ret != -1); + + rval = eina_inarray_replace_at(iarr, 3, &temp); + fail_if(rval != EINA_TRUE); + ret = eina_inarray_search(iarr, &temp, cmp); + fail_if(ret != 3); + + rval = eina_inarray_replace_at(iarr, arr_size+1, &temp); + fail_if(rval != EINA_FALSE); + + ret = eina_inarray_remove(iarr, &temp); + fail_if(ret != 3); + + temp = 101; + ret = eina_inarray_remove(iarr, &temp); + fail_if(ret != -1); + + eina_inarray_sort(iarr, compare); + + temp = 92; + ret = eina_inarray_search(iarr, &temp, cmp); + ret1 = eina_inarray_search_sorted(iarr, &temp, cmp); + fail_if(ret != ret1); + + temp = 100; + ret = eina_inarray_search(iarr, &temp, cmp); + ret1 = eina_inarray_search_sorted(iarr, &temp, cmp); + fail_if(ret != ret1); + + temp = 105; + ret = eina_inarray_push(iarr, &temp); + ret = eina_inarray_push(iarr, &temp); + ret = eina_inarray_push(iarr, &temp); + curr_len = iarr->len; + rval = eina_inarray_foreach_remove(iarr, match_cb, &temp); + fail_if(iarr->len != curr_len-3); + + eina_inarray_free(iarr); + eina_shutdown(); +} +END_TEST + void eina_test_inarray(TCase *tc) { @@ -398,4 +502,5 @@ eina_test_inarray(TCase *tc) tcase_add_test(tc, eina_inarray_test_sort); tcase_add_test(tc, eina_inarray_test_reverse); tcase_add_test(tc, eina_inarray_test_itr); + tcase_add_test(tc, eina_inarray_test_search); } --
[EGIT] [core/efl] master 05/05: eina: add tests cases for eina_rectangle and eina_str functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6c33bbfa807e3935ba36d9956c24fd8a93d928fa commit 6c33bbfa807e3935ba36d9956c24fd8a93d928fa Author: Vivek Ellur Date: Tue May 19 14:13:17 2015 +0200 eina: add tests cases for eina_rectangle and eina_str functions Summary: Added test cases for eina_rectangle_union and eina_streq functions Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2541 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_rectangle.c | 36 +--- src/tests/eina/eina_test_str.c | 7 +++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/tests/eina/eina_test_rectangle.c b/src/tests/eina/eina_test_rectangle.c index e5a211f..089b68b 100644 --- a/src/tests/eina/eina_test_rectangle.c +++ b/src/tests/eina/eina_test_rectangle.c @@ -72,9 +72,9 @@ START_TEST(eina_rectangle_pool) } END_TEST -START_TEST(eina_rectangle_intersect) +START_TEST(eina_rectangle_union_intersect) { - Eina_Rectangle r1, r2, r3, r4, rd; + Eina_Rectangle r1, r2, r3, r4, r5, r6, rd; fail_if(!eina_init()); @@ -82,6 +82,8 @@ START_TEST(eina_rectangle_intersect) EINA_RECTANGLE_SET(&r2, 20, 20, 20, 20); EINA_RECTANGLE_SET(&r3, 0, 0, 10, 10); EINA_RECTANGLE_SET(&r4, 30, 30, 50, 50); + EINA_RECTANGLE_SET(&r5, 10, 10, 0, 0); + EINA_RECTANGLE_SET(&r6, 30, 30, 0, 0); rd = r1; @@ -102,6 +104,34 @@ START_TEST(eina_rectangle_intersect) || rd.w != 30 || rd.h != 30); + rd = r1; + eina_rectangle_union(&rd, &r2); + fail_if(rd.x != r1.x + || rd.y != r1.y + || rd.w != r1.w + || rd.h != r1.h); + + rd = r1; + eina_rectangle_union(&rd, &r3); + fail_if(rd.x != 0 + || rd.y != 0 + || rd.w != 60 + || rd.h != 60); + + rd = r3; + eina_rectangle_union(&rd, &r4); + fail_if(rd.x != 0 + || rd.y != 0 + || rd.w != 80 + || rd.h != 80); + + rd = r5; + eina_rectangle_union(&rd, &r6); + fail_if(rd.x != 10 + || rd.y != 10 + || rd.w != 20 + || rd.h != 20); + eina_shutdown(); } END_TEST @@ -110,6 +140,6 @@ void eina_test_rectangle(TCase *tc) { tcase_add_test(tc, eina_rectangle_pool); - tcase_add_test(tc, eina_rectangle_intersect); + tcase_add_test(tc, eina_rectangle_union_intersect); } diff --git a/src/tests/eina/eina_test_str.c b/src/tests/eina/eina_test_str.c index be879db..8233dd8 100644 --- a/src/tests/eina/eina_test_str.c +++ b/src/tests/eina/eina_test_str.c @@ -80,6 +80,13 @@ fail_if(eina_str_has_extension("xab", "xYz")); fail_if(eina_str_has_extension("", "x")); + fail_if(eina_streq("xab", NULL)); + fail_if(eina_streq(NULL, "xab")); + fail_if(eina_streq("x", "xab")); + fail_if(eina_streq("xab", "XAB")); + fail_if(eina_streq("x", "x ")); + fail_if(!eina_streq("xab", "xab")); + fail_if(eina_strlen_bounded("abc", 1024) != strlen("abc")); fail_if(eina_strlen_bounded("abc", 2) != (size_t)-1); --
[EGIT] [core/efl] master 03/08: eina: add test cases for various APIs in eina_quad module.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=331068b84a9f2adb1bed55d2c44278315a8de061 commit 331068b84a9f2adb1bed55d2c44278315a8de061 Author: Vivek Ellur Date: Tue May 26 18:31:55 2015 +0200 eina: add test cases for various APIs in eina_quad module. Summary: Added test cases for all the APIs in einq_quad module Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2551 Signed-off-by: Cedric BAIL --- src/Makefile_Eina.am| 3 +- src/tests/eina/eina_suite.c | 1 + src/tests/eina/eina_suite.h | 1 + src/tests/eina/eina_test_quad.c | 64 + 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am index 3a181b6..532c051 100644 --- a/src/Makefile_Eina.am +++ b/src/Makefile_Eina.am @@ -309,7 +309,8 @@ tests/eina/eina_test_tmpstr.c \ tests/eina/eina_test_trash.c \ tests/eina/eina_test_lock.c \ tests/eina/eina_test_xattr.c \ -tests/eina/eina_test_crc.c +tests/eina/eina_test_crc.c \ +tests/eina/eina_test_quad.c # tests/eina/eina_test_model.c diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c index 1a08480..17706cf 100644 --- a/src/tests/eina/eina_suite.c +++ b/src/tests/eina/eina_suite.c @@ -80,6 +80,7 @@ static const Eina_Test_Case etc[] = { { "Xattr", eina_test_xattr }, #endif {"Crc", eina_test_crc }, + {"Quad", eina_test_quad }, { NULL, NULL } }; diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h index 63d76cd..9f3df3a 100644 --- a/src/tests/eina/eina_suite.h +++ b/src/tests/eina/eina_suite.h @@ -65,5 +65,6 @@ void eina_test_abi(TCase *tc); void eina_test_trash(TCase *tc); void eina_test_xattr(TCase *tc); void eina_test_crc(TCase *tc); +void eina_test_quad(TCase *tc); #endif /* EINA_SUITE_H_ */ diff --git a/src/tests/eina/eina_test_quad.c b/src/tests/eina/eina_test_quad.c new file mode 100644 index 000..eb1638f --- /dev/null +++ b/src/tests/eina/eina_test_quad.c @@ -0,0 +1,64 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include "eina_suite.h" +#include "Eina.h" + +START_TEST(eina_quad_simple) +{ + Eina_Rectangle r1; + Eina_Quad r2; + double x0, x1, x2, x3; + double y0, y1, y2, y3; + + fail_if(!eina_init()); + + eina_quad_coords_set(&r2, +0.0, 5.0, +5.0, 0.0, + 10.0, 5.0, +5.0, 10.0); + + eina_quad_coords_get(&r2, +&x0, &y0, +&x1, &y1, +&x2, &y2, +&x3, &y3); + fail_if (r2.x0 != 0.0 || r2.y0 != 5.0 + || r2.x1 != 5.0 || r2.y1 != 0.0 + || r2.x2 != 10.0 || r2.y2 != 5.0 + || r2.x3 != 5.0 || r2.y3 != 10.0); + + eina_quad_rectangle_to(&r2, &r1); + fail_if (r1.x != 0 || r1.y != 0 + || r1.w != 10 || r1.h != 10); + + eina_quad_coords_set(&r2, +0.0, 0.0, +0.0, 0.0, +0.0, 0.0, +0.0, 0.0); + eina_quad_rectangle_to(&r2, &r1); + fail_if (r1.x != 0 || r1.y != 0 + || r1.w != 0 || r1.h != 0); + + EINA_RECTANGLE_SET(&r1, 5, 10, 20, 30); + eina_quad_rectangle_from(&r2, &r1); + fail_if (r2.x0 != 5.0 || r2.y0 != 10.0 + || r2.x1 != 25.0 || r2.y1 != 10.0 + || r2.x2 != 25.0 || r2.y2 != 40.0 + || r2.x3 != 5.0 || r2.y3 != 40.0); + + eina_shutdown(); +} +END_TEST + +void +eina_test_quad(TCase *tc) +{ + tcase_add_test(tc, eina_quad_simple); +} --
[EGIT] [core/efl] master 01/01: eina: add test cases for eina_matrix3 APIs
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=81b52fb0ec452989e5f17072669bb8a1bb9b40a1 commit 81b52fb0ec452989e5f17072669bb8a1bb9b40a1 Author: Vivek Ellur Date: Thu Jun 4 10:32:01 2015 +0200 eina: add test cases for eina_matrix3 APIs Summary: Added test cases for eina_matrix3_values_get, eina_matrix3_values_set, eina_matrix3_equal, eina_matrix3_type_get APIs Signed-off-by: Vivek Ellur Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2623 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_matrix.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index 046876d..28983e1 100644 --- a/src/tests/eina/eina_test_matrix.c +++ b/src/tests/eina/eina_test_matrix.c @@ -92,9 +92,60 @@ START_TEST(eina_matrix4_2_3) } END_TEST +START_TEST(eina_matrix3) +{ + Eina_Bool ret; + Eina_Matrix3 m, m1, m2; + double xx, xy, xz, + yx, yy, yz, + zx, zy, zz; + + eina_init(); + + eina_matrix3_values_set(&m, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1); + + eina_matrix3_values_set(&m1, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1); + + eina_matrix3_values_set(&m2, + 1, 1, 1, + 0, 1, 0, + 0, 0, 1); + fail_if(eina_matrix3_type_get(&m) != EINA_MATRIX_TYPE_IDENTITY); + + eina_matrix3_values_get(&m, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + + fail_if(xx != yy || + yy != zz || + zz != 1); + + fail_if(xy != xz || + yx != yz || + zx != zy || + zy != 0); + + ret = eina_matrix3_equal(&m, &m1); + fail_if(ret != EINA_TRUE); + + ret = eina_matrix3_equal(&m1, &m2); + fail_if(ret != EINA_FALSE); + + eina_shutdown(); +} +END_TEST + void eina_test_matrix(TCase *tc) { tcase_add_test(tc, eina_matrix4); tcase_add_test(tc, eina_matrix4_2_3); + tcase_add_test(tc, eina_matrix3); } --
[EGIT] [core/efl] master 01/01: eina: add test cases for various eina_matrix operations
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=02d825f116e3b791c784791b10cfe613c5f18385 commit 02d825f116e3b791c784791b10cfe613c5f18385 Author: Vivek Ellur Date: Mon Jun 15 09:06:31 2015 +0200 eina: add test cases for various eina_matrix operations Summary: Added test cases for various operations of 3*3 matrix Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2692 Signed-off-by: Cedric BAIL --- src/tests/eina/eina_test_matrix.c | 161 ++ 1 file changed, 161 insertions(+) diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index 28983e1..36d3963 100644 --- a/src/tests/eina/eina_test_matrix.c +++ b/src/tests/eina/eina_test_matrix.c @@ -142,10 +142,171 @@ START_TEST(eina_matrix3) } END_TEST +START_TEST(eina_matrix3_operations) +{ + Eina_Matrix3 m1, m2, m3; + double xx, xy, xz, + yx, yy, yz, + zx, zy, zz; + double tx = 20, ty = 30, ret; + + eina_matrix3_values_set(&m1, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1); + + eina_matrix3_values_set(&m2, + 1, 1, 1, + 1, 1, 1, + 1, 1, 1); + + + eina_matrix3_compose(&m1, &m2, &m3); + eina_matrix3_values_get(&m3, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if (xx != xy || +xy != xz || +yx != yy || +yy != yz || +zx != zy || +zy != zz || +zz != 1); + + eina_matrix3_translate(&m1, tx, ty); + eina_matrix3_values_get(&m1, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if (xx != 1 || xy != 0 || xz != tx || +yx != 0 || yy != 1 || yz != ty || +zx != 0 || zy != 0 || zz != 1); + + eina_matrix3_values_set(&m1, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1); + + eina_matrix3_scale(&m1, tx, ty); + eina_matrix3_values_get(&m1, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if (xx != tx || xy != 0 || xz != 0 || +yx != 0 || yy != ty || yz != 0 || +zx != 0 || zy != 0 || zz != 1); + + eina_matrix3_values_set(&m1, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1); + eina_matrix3_rotate(&m1, M_PI/2); + + fail_if (round(m1.xx) != 0 || round(m1.xy) != -1 || +round(m1.xz) != 0 || round(m1.yx) != 1 || +round(m1.yy) != 0 || round(m1.yz) !=0 || +round(m1.zx) != 0 || round(m1.zy) != 0|| +round(m1.zz) != 1); + + eina_matrix3_values_set(&m1, + 1, 1, 1, + 1, 1, 1, + 1, 1, 1); + eina_matrix3_identity(&m1); + eina_matrix3_values_get(&m1, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if(xx != yy || + yy != zz || + zz != 1); + + fail_if(xy != xz || + yx != yz || + zx != zy || + zy != 0); + + + eina_matrix3_values_set(&m1, + 1, 2, 1, + 2, 1, 1, + 1, 2, 2); + ret = eina_matrix3_determinant(&m1); + fail_if(ret != -3); + + eina_matrix3_values_set(&m1, + 3, 3, 3, + 3, 3, 3, + 3, 3, 3); + eina_matrix3_divide(&m1, 2); + eina_matrix3_values_get(&m1, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if (xx != xy || +xy != xz || +yx != yy || +yy != yz || +zx != zy || +zy != zz || +zz != 1.5); + + eina_matrix3_values_set(&m1, + 0, 2, 0, + 2, 2, 0, + 2, 1, 2); + eina_matrix3_inverse(&m1, &m2); + eina_matrix3_values_get(&m2, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if (xx !=
[EGIT] [core/efl] master 01/01: eina_matrix: Added test cases for fixed point matrix functions
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f2606fe151a786d89fe8f27ba1e4da4e14823e66 commit f2606fe151a786d89fe8f27ba1e4da4e14823e66 Author: Vivek Ellur Date: Tue Jun 16 17:47:29 2015 +0200 eina_matrix: Added test cases for fixed point matrix functions Summary: Added test cases for all the functions related to fixed point matrix Signed-off-by: Vivek Ellur Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2701 --- src/tests/eina/eina_test_matrix.c | 65 +++ 1 file changed, 65 insertions(+) diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index 36d3963..ed7c7ef 100644 --- a/src/tests/eina/eina_test_matrix.c +++ b/src/tests/eina/eina_test_matrix.c @@ -302,6 +302,70 @@ START_TEST(eina_matrix3_operations) } END_TEST +START_TEST(eina_matrix3_f16p16) +{ + Eina_Matrix3_F16p16 m1; + Eina_Matrix3 m2; + Eina_F16p16 xx, xy, xz, + yx, yy, yz, + zx, zy, zz; + Eina_Matrix3_F16p16 m3; + + eina_init(); + + eina_matrix3_values_set(&m2, + 1, 0, 0, + 0, 1, 0, + 0, 0, 1); + eina_matrix3_matrix3_f16p16_to(&m2, &m1); + fail_if (eina_matrix3_f16p16_type_get(&m1) != EINA_MATRIX_TYPE_IDENTITY); + + eina_matrix3_fixed_values_get(&m2, + &xx, &xy, &xz, + &yx, &yy, &yz, + &zx, &zy, &zz); + fail_if(xx != yy || + yy != zz || + zz != 65536); + + fail_if(xy != xz || + yx != yz || + zx != zy || + zy != 0); + + eina_matrix3_values_set(&m2, + 1, 2, 3, + 4, 5, 6, + 7, 8, 9); + eina_matrix3_matrix3_f16p16_to(&m2, &m1); + eina_matrix3_f16p16_identity(&m1); + fail_if(m1.xx != m1.yy || + m1.yy != m1.zz || + m1.zz != 65536); + + fail_if(m1.xy != m1.xz || + m1.yx != m1.yz || + m1.zx != m1.zy || + m1.zy != 0); + + eina_matrix3_values_set(&m2, + 1, 1, 1, + 1, 1, 1, + 1, 1, 1); + eina_matrix3_matrix3_f16p16_to(&m2, &m1); + eina_matrix3_f16p16_compose(&m1, &m1, &m3); + fail_if (m3.xx != m3.xy || +m3.xy != m3.xz || +m3.yx != m3.yy || +m3.yy != m3.yz || +m3.zx != m3.zy || +m3.zy != m3.zz || +m3.zz != 196608); + + eina_shutdown(); +} +END_TEST + void eina_test_matrix(TCase *tc) { @@ -309,4 +373,5 @@ eina_test_matrix(TCase *tc) tcase_add_test(tc, eina_matrix4_2_3); tcase_add_test(tc, eina_matrix3); tcase_add_test(tc, eina_matrix3_operations); + tcase_add_test(tc, eina_matrix3_f16p16); } --