cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=914043d567448de8553132d0c98dff586cc36c03
commit 914043d567448de8553132d0c98dff586cc36c03 Author: Cedric Bail <[email protected]> Date: Tue Aug 2 15:28:20 2016 -0700 eina: test safepointer in the correct range for 32bits system. The generation counter on 32bits system is on 8bits, obviously 1024 is more than that. T4265 --- src/tests/eina/eina_test_safepointer.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tests/eina/eina_test_safepointer.c b/src/tests/eina/eina_test_safepointer.c index 543f77e..30f696f 100644 --- a/src/tests/eina/eina_test_safepointer.c +++ b/src/tests/eina/eina_test_safepointer.c @@ -27,8 +27,8 @@ #include "eina_suite.h" static int test_array[1024] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -static int test_array2[1024] = { 8, 9, 10, 11, 12, 13, 14 }; -static const void *pointers[2048] = { NULL }; +static int test_array2[64] = { 8, 9, 10, 11, 12, 13, 14 }; +static const void *pointers[1088] = { NULL }; START_TEST(eina_test_reusable) { @@ -44,11 +44,6 @@ START_TEST(eina_test_reusable) fail_if(&test_array[i] != eina_safepointer_get(pointers[i])); } - for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++) - { - eina_safepointer_unregister(pointers[i]); - } - for (i = 0; i < sizeof (test_array2) / sizeof (test_array2[0]); i++) { pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] = eina_safepointer_register(&test_array2[i]); @@ -58,6 +53,11 @@ START_TEST(eina_test_reusable) eina_safepointer_unregister(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]); } + for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++) + { + eina_safepointer_unregister(pointers[i]); + } + for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++) { unsigned int j; @@ -89,11 +89,6 @@ _thread1(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED) fail_if(&test_array[i] != eina_safepointer_get(pointers[i])); } - for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++) - { - eina_safepointer_unregister(pointers[i]); - } - return NULL; } @@ -135,6 +130,11 @@ START_TEST(eina_test_threading) eina_thread_join(t1); eina_thread_join(t2); + for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++) + { + eina_safepointer_unregister(pointers[i]); + } + eina_barrier_free(&b); for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++) --
