summaryrefslogtreecommitdiff
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
parentf7396703c5a5b27e396312466498de302537a0c2 (diff)
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
-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 @@
27#include "eina_suite.h" 27#include "eina_suite.h"
28 28
29static int test_array[1024] = { 0, 1, 2, 3, 4, 5, 6, 7 }; 29static int test_array[1024] = { 0, 1, 2, 3, 4, 5, 6, 7 };
30static int test_array2[1024] = { 8, 9, 10, 11, 12, 13, 14 }; 30static int test_array2[64] = { 8, 9, 10, 11, 12, 13, 14 };
31static const void *pointers[2048] = { NULL }; 31static const void *pointers[1088] = { NULL };
32 32
33START_TEST(eina_test_reusable) 33START_TEST(eina_test_reusable)
34{ 34{
@@ -44,11 +44,6 @@ START_TEST(eina_test_reusable)
44 fail_if(&test_array[i] != eina_safepointer_get(pointers[i])); 44 fail_if(&test_array[i] != eina_safepointer_get(pointers[i]));
45 } 45 }
46 46
47 for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
48 {
49 eina_safepointer_unregister(pointers[i]);
50 }
51
52 for (i = 0; i < sizeof (test_array2) / sizeof (test_array2[0]); i++) 47 for (i = 0; i < sizeof (test_array2) / sizeof (test_array2[0]); i++)
53 { 48 {
54 pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] = eina_safepointer_register(&test_array2[i]); 49 pointers[i + (sizeof (test_array) / sizeof (test_array[0]))] = eina_safepointer_register(&test_array2[i]);
@@ -58,6 +53,11 @@ START_TEST(eina_test_reusable)
58 eina_safepointer_unregister(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]); 53 eina_safepointer_unregister(pointers[i + (sizeof (test_array) / sizeof (test_array[0]))]);
59 } 54 }
60 55
56 for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
57 {
58 eina_safepointer_unregister(pointers[i]);
59 }
60
61 for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++) 61 for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++)
62 { 62 {
63 unsigned int j; 63 unsigned int j;
@@ -89,11 +89,6 @@ _thread1(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
89 fail_if(&test_array[i] != eina_safepointer_get(pointers[i])); 89 fail_if(&test_array[i] != eina_safepointer_get(pointers[i]));
90 } 90 }
91 91
92 for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
93 {
94 eina_safepointer_unregister(pointers[i]);
95 }
96
97 return NULL; 92 return NULL;
98} 93}
99 94
@@ -135,6 +130,11 @@ START_TEST(eina_test_threading)
135 eina_thread_join(t1); 130 eina_thread_join(t1);
136 eina_thread_join(t2); 131 eina_thread_join(t2);
137 132
133 for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
134 {
135 eina_safepointer_unregister(pointers[i]);
136 }
137
138 eina_barrier_free(&b); 138 eina_barrier_free(&b);
139 139
140 for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++) 140 for (i = 0; i < sizeof (pointers) / sizeof (pointers[0]); i++)