]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: make conditional (to HAVE_LIBIDN) any IDN related checks
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 8 Dec 2016 14:54:07 +0000 (15:54 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 8 Dec 2016 14:59:03 +0000 (15:59 +0100)
This allows the test suite to successfully complete even when compiled
without libidn.

tests/crq_apis.c
tests/crt_apis.c

index 99c02cb4cf66e217c124fc3ddda953dfcf1bdb5d..7ad717ff13d473c2bcf9ccfe5d970b24afe34ee8 100644 (file)
@@ -448,8 +448,10 @@ void doit(void)
 
        assert(gnutls_x509_crq_export2(crq, GNUTLS_X509_FMT_PEM, &out) >= 0);
 
+#ifdef HAVE_LIBIDN
        assert(out.size == saved_crq.size);
        assert(memcmp(out.data, saved_crq.data, out.size)==0);
+#endif
 
        gnutls_free(out.data);
        gnutls_x509_crq_deinit(crq);
index 8b8ebbea9b4f8aaade09ee6c8e8389465a3ab42e..ed316408237cf457b81f2f473ad9d248de749034 100644 (file)
@@ -183,10 +183,12 @@ void doit(void)
        if (ret != 0)
                fail("gnutls_x509_crt_set_subject_alt_name\n");
 
+#ifdef HAVE_LIBIDN
        ret = gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_RFC822NAME,
                                                   "test@νίκο.org", strlen("test@νίκο.org"), 1);
        if (ret != 0)
                fail("gnutls_x509_crt_set_subject_alt_name\n");
+#endif
 
        s = 0;
        ret = gnutls_x509_crt_get_key_purpose_oid(crt, 0, NULL, &s, NULL);
@@ -275,8 +277,10 @@ void doit(void)
        }
        assert(gnutls_x509_crt_export2(crt, GNUTLS_X509_FMT_PEM, &out) >= 0);
 
+#ifdef HAVE_LIBIDN
        assert(out.size == saved_crt.size);
        assert(memcmp(out.data, saved_crt.data, out.size)==0);
+#endif
 
        gnutls_free(out.data);