asdfuser pushed a commit to branch master.
commit 07b5c33f90dbd75da3ab52d95a950d53ed020c68
Author: Daniel Willmann <[email protected]>
Date: Wed Mar 20 18:39:39 2013 +0000
eina_test_list: Move fail_if out of the hot path
fail_if() from libcheck always writes to a file created with tmpfile(),
so it is not a good idea to call it millions of times. This wastes
memory and time, let's use both for something better. :-)
Signed-off-by: Daniel Willmann <[email protected]>
---
src/tests/eina/eina_test_list.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/tests/eina/eina_test_list.c b/src/tests/eina/eina_test_list.c
index fd11f89..1a000da 100644
--- a/src/tests/eina/eina_test_list.c
+++ b/src/tests/eina/eina_test_list.c
@@ -416,8 +416,12 @@ START_TEST(eina_test_shuffle)
j = 0;
list = eina_list_sort(list, 0, (Eina_Compare_Cb)&uicmp);
EINA_LIST_FOREACH(list, item, p)
- fail_if(*p != j++);
- fail_if(j != SHUFFLE_SZ);
+ {
+ if (*p != j++)
+ fail_if(*p != j++);
+ }
+ if (j != SHUFFLE_SZ)
+ fail_if(j != SHUFFLE_SZ);
}
d = SHUFFLE_SZ/(float)(SHUFFLE_N);
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar