Only run tests that require libidn when we have libidn available release-2.x.y

Tue, 14 Sep 2021 19:24:43 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 14 Sep 2021 19:24:43 -0500
branch
release-2.x.y
changeset 41046
581ae0eecd0d
parent 41045
c8e2ffe9b4d0
child 41047
addb2327cde0

Only run tests that require libidn when we have libidn available

This should eliminate the need for https://gitweb.gentoo.org/repo/gentoo.git/tree/net-im/pidgin/files/pidgin-2.13.0-disable-one-jid-test.patch

Testing Done:
Compiled with and with out `--disable-idn`, also added a `#warning` during testing to verify if the code was being include properly.

Reviewed at https://reviews.imfreedom.org/r/922/

libpurple/tests/test_jabber_jutil.c file | annotate | diff | comparison | revisions
--- a/libpurple/tests/test_jabber_jutil.c	Mon Sep 13 17:07:15 2021 -0500
+++ b/libpurple/tests/test_jabber_jutil.c	Tue Sep 14 19:24:43 2021 -0500
@@ -3,6 +3,7 @@
 #include "tests.h"
 #include "../account.h"
 #include "../conversation.h"
+#include "../internal.h"
 #include "../xmlnode.h"
 #include "../protocols/jabber/jutil.h"
 
@@ -138,6 +139,7 @@
 	assert_invalid_jid("paul@2[::1]124/as");
 	assert_invalid_jid("paul@まつ.おおかみ/\x01");
 
+#ifdef USE_IDN
 	/*
 	 * RFC 3454 Section 6 reads, in part,
 	 * "If a string contains any RandALCat character, the
@@ -145,6 +147,7 @@
 	 * The character is U+066D (ARABIC FIVE POINTED STAR).
 	 */
 	assert_invalid_jid("foo@example.com/٭simplexe٭");
+#endif /* USE_IDN */
 
 	/* Ensure that jabber_id_new is properly lowercasing node and domains */
 	assert_jid_parts("paul", "darkrain42.org", "PaUL@darkrain42.org");

mercurial