]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: gnutls_x509_crt_list_import: verify that return code is as documented
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 28 Jun 2019 12:59:19 +0000 (14:59 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 28 Jun 2019 12:59:24 +0000 (14:59 +0200)
That checks whether the return code of gnutls_x509_crt_list_import()
contains the number of loaded certificates.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
tests/gnutls_x509_crt_list_import.c

index a8cad7fbf2062f3d2e2234caaa2bcfc95f59aafe..51fdfcb9f418c4bb7c320a70f57dd2275208e918 100644 (file)
@@ -80,6 +80,9 @@ static void load_list(const char *name, const gnutls_datum_t *txt,
        if (max != ncerts)
                testfail("imported number (%d) doesn't match expected (%d)\n", max, ncerts);
 
+       if (ret != (int)ncerts)
+               testfail("imported number (%d) doesn't match return value (%d)\n", ncerts, ret);
+
        return;
 }