- libgnutls-dev
- libgpgme11-dev
- libgss-dev
+ - libidn2-0-dev
- libkyotocabinet-dev
- liblmdb-dev
- liblua5.2-dev
#include <idn/stringprep.h>
#endif
#ifdef HAVE_IDN2_H
+#include <idna.h>
#include <idn2.h>
#elif defined(HAVE_IDN_IDN2_H)
#include <idn/idn2.h>
*/
int mutt_idna_to_ascii_lz(const char *input, char **output, int flags)
{
+ if (!input || !output)
+ return 1;
+
return idna_to_ascii_lz(input, output, flags);
}
#endif /* HAVE_LIBIDN */
cc-with [list -cflags -I$idn_prefix/include -libs -L$idn_prefix/lib] {
set idn2 [cc-check-includes idn2.h]
incr idn2 [cc-check-includes idn/idn2.h]
+ set sprcv [cc-check-function-in-lib stringprep_check_version idn]
set lu8 [cc-check-function-in-lib idn2_lookup_u8 idn2]
if {$idn2 == 0 || $lu8 == 0} {
user-error "Unable to find GNU libidn2"
* Add your test cases to this list.
*****************************************************************************/
#define NEOMUTT_TEST_LIST \
- NEOMUTT_TEST_ITEM(mutt_idna_intl_to_local) \
- NEOMUTT_TEST_ITEM(mutt_idna_local_to_intl) \
- NEOMUTT_TEST_ITEM(mutt_idna_print_version) \
- NEOMUTT_TEST_ITEM(mutt_idna_to_ascii_lz)
+ NEOMUTT_TEST_ITEM(test_mutt_idna_intl_to_local) \
+ NEOMUTT_TEST_ITEM(test_mutt_idna_local_to_intl) \
+ NEOMUTT_TEST_ITEM(test_mutt_idna_print_version) \
+ NEOMUTT_TEST_ITEM(test_mutt_idna_to_ascii_lz)
/******************************************************************************
* You probably don't need to touch what follows.
{
// char * mutt_idna_intl_to_local(const char *user, const char *domain, int flags);
+#ifdef HAVE_LIBIDN
{
TEST_CHECK(!mutt_idna_intl_to_local(NULL, "banana", 0));
}
{
TEST_CHECK(!mutt_idna_intl_to_local("apple", NULL, 0));
}
+#endif
}
{
// char * mutt_idna_local_to_intl(const char *user, const char *domain);
+#ifdef HAVE_LIBIDN
{
TEST_CHECK(!mutt_idna_local_to_intl(NULL, "banana"));
}
{
TEST_CHECK(!mutt_idna_local_to_intl("apple", NULL));
}
+#endif
}
void test_mutt_idna_print_version(void)
{
// const char *mutt_idna_print_version(void);
+#ifdef HAVE_LIBIDN
+#endif
}
{
// int mutt_idna_to_ascii_lz(const char *input, char **output, int flags);
+#ifdef HAVE_LIBIDN
{
char *out = NULL;
- TEST_CHECK(mutt_idna_to_ascii_lz(NULL, &out, 0) == -1);
+ TEST_CHECK(mutt_idna_to_ascii_lz(NULL, &out, 0) != 0);
}
{
- TEST_CHECK(mutt_idna_to_ascii_lz("apple", NULL, 0) == -1);
+ TEST_CHECK(mutt_idna_to_ascii_lz("apple", NULL, 0) != 0);
}
+#endif
}