aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2016-08-02 15:28:20 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-08-02 15:35:15 -0700
commit914043d567448de8553132d0c98dff586cc36c03 (patch)
tree890ff93dd89c0dc6ff9a24a4c899e7a74164ae3c
parentFix text check in Elm_Code T4264 (diff)
downloadefl-914043d567448de8553132d0c98dff586cc36c03.tar.gz
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. https://phab.enlightenment.org/T4265
-rw-r--r--src/tests/eina/eina_test_safepointer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tests/eina/eina_test_safepointer.c b/src/tests/eina/eina_test_safepointer.c
index 543f77e1ec..30f696fde7 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++)