stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0683552037cdc8999e76c098b6d2f06eaf20a952

commit 0683552037cdc8999e76c098b6d2f06eaf20a952
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Mar 29 16:43:33 2018 -0400

    tests: simplify eina_rbtree_fuzzy test and speedup by infinity%
    
    this test is to try and match values in a tree which have not been
    inserted, so remove irrelevant insert/remove operations as well as
    insane looping
    
    fix T6830
    
    Reviewed-by: Stefan Schmidt <ste...@osg.samsung.com>
---
 src/tests/eina/eina_test_rbtree.c | 55 +++++++--------------------------------
 1 file changed, 9 insertions(+), 46 deletions(-)

diff --git a/src/tests/eina/eina_test_rbtree.c 
b/src/tests/eina/eina_test_rbtree.c
index eaed5c2cc0..c1fe04ff08 100644
--- a/src/tests/eina/eina_test_rbtree.c
+++ b/src/tests/eina/eina_test_rbtree.c
@@ -553,62 +553,25 @@ EFL_START_TEST(eina_rbtree_fuzzy)
 {
    Eina_Rbtree_Int *child;
    Eina_Rbtree *root = NULL;
-   Eina_List *added = NULL;
    unsigned int i;
-   unsigned int j;
-
-
-   Eina_Rbtree_Int *mem, *mem2;
+   Eina_Rbtree_Int *mem;
 
-   mem = _eina_rbtree_int_init(10000);
-   for (i = 0; i < 10000; i++)
+   mem = _eina_rbtree_int_init(100);
+   for (i = 0; i < 100; i++)
      {
         child = _eina_rbtree_int_new(r2[i], mem, i);
         root = eina_rbtree_inline_insert(root, (Eina_Rbtree*) child,
                                          
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
      }
 
-   mem2 = _eina_rbtree_int_init(20 * 1000);
-   for (j = 0; j < 20; j++)
+   for (i = 0; i < 100; i++)
      {
-        for (i = 0; i < 1000; i++)
-          {
-             int r;
-
-             do
-               {
-                  r = r1[i];
-
-                  child = (Eina_Rbtree_Int *) eina_rbtree_inline_lookup(root, 
&r, sizeof (int),
-                                                                        
EINA_RBTREE_CMP_KEY_CB(eina_rbtree_int_key), NULL);
-                  if (child)
-                    {
-                       child = NULL;
-                       continue ;
-                    }
-
-                  child = _eina_rbtree_int_new(r, mem2, j * 1000 + i);
-                  root = eina_rbtree_inline_insert(root, (Eina_Rbtree*) child,
-                                                   
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
-                  added = eina_list_append(added, child);
-               }
-             while (child == NULL);
-          }
-
-        EINA_LIST_FREE(added, child)
-          {
-             Eina_Rbtree *lookup;
-
-             lookup = eina_rbtree_inline_lookup(root, &child->value, sizeof 
(int),
-                                                
EINA_RBTREE_CMP_KEY_CB(eina_rbtree_int_key), NULL);
-             fail_if(lookup == NULL);
-             fail_if(lookup != (Eina_Rbtree*) child);
-
-             root = eina_rbtree_inline_remove(root, (Eina_Rbtree*) child,
-                                              
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp), NULL);
-          }
+        int r;
+
+        r = r1[i];
+        ck_assert_ptr_null(eina_rbtree_inline_lookup(root, &r, sizeof (int),
+                                                     
EINA_RBTREE_CMP_KEY_CB(eina_rbtree_int_key), NULL));
      }
-   free(mem2);
    free(mem);
 }
 EFL_END_TEST

-- 


Reply via email to