[git] GPGME - branch, aheinecke/json-test, updated. gpgme-1.12.0-62-g27ca12e

by Andre Heinecke cvs at cvs.gnupg.org
Wed Nov 14 15:19:16 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, aheinecke/json-test has been updated
       via  27ca12e815c0a582d357641a04b889d648b8766e (commit)
      from  dd4b80a5f640232bb44eb825ff5a74ec295fad10 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 27ca12e815c0a582d357641a04b889d648b8766e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Nov 14 15:17:18 2018 +0100

    tests,json: Fix match if the first child differs
    
    * tests/json/t-json.c (test_contains): Try all siblings of
    the haystack child.
    
    --
    This fixes the case where we don't match against the
    first child because the order might have changed or
    a new element was inserted at the top. Then we
    have to try out also all the siblings.

diff --git a/tests/json/t-json.c b/tests/json/t-json.c
index 1f45feb..7a4d906 100644
--- a/tests/json/t-json.c
+++ b/tests/json/t-json.c
@@ -154,7 +154,19 @@ test_contains (cjson_t needle, cjson_t hay)
         }
       if (test_contains (needle->child, hay->child))
         {
-          return 1;
+          int found = 0;
+          for (cjson_t hit = hay->child; hit; hit = hit->next)
+            {
+              found |= !test_contains (needle->child, hit);
+              if (found)
+                {
+                  break;
+                }
+            }
+          if (!found)
+            {
+              return 1;
+            }
         }
     }
 

-----------------------------------------------------------------------

Summary of changes:
 tests/json/t-json.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list