summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-10-26 19:33:45 +0100
committerFlorent Le Coz <louiz@louiz.org>2015-10-26 20:01:57 +0100
commite43ca29e94342ab8e3cd8be54d6935bb450c00fe (patch)
tree6e76e5f995d4ea27f18199415e23988415451670
parentd799dc10b6045837dd58a1945b3227a2b08d40d6 (diff)
downloadbiboumi-e43ca29e94342ab8e3cd8be54d6935bb450c00fe.tar.gz
biboumi-e43ca29e94342ab8e3cd8be54d6935bb450c00fe.tar.bz2
biboumi-e43ca29e94342ab8e3cd8be54d6935bb450c00fe.tar.xz
biboumi-e43ca29e94342ab8e3cd8be54d6935bb450c00fe.zip
Fix the jidprep tests when built without libidn
-rw-r--r--src/test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test.cpp b/src/test.cpp
index ae36460..14ba929 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -302,8 +302,9 @@ int main()
const std::string badjid("~zigougou™@EpiK-7D9D1FDE.poez.io/Boujour/coucou/slt™");
const std::string correctjid = jidprep(badjid);
std::cout << correctjid << std::endl;
+#ifdef LIBIDN_FOUND
assert(correctjid == "~zigougoutm@epik-7d9d1fde.poez.io/Boujour/coucou/sltTM");
- // Check that the cache do not break things when we prep the same string
+ // Check that the cache does not break things when we prep the same string
// multiple times
assert(jidprep(badjid) == "~zigougoutm@epik-7d9d1fde.poez.io/Boujour/coucou/sltTM");
assert(jidprep(badjid) == "~zigougoutm@epik-7d9d1fde.poez.io/Boujour/coucou/sltTM");
@@ -317,6 +318,9 @@ int main()
const std::string fixed_crappy = jidprep(crappy);
std::cout << fixed_crappy << std::endl;
assert(fixed_crappy == "~bisous@7ea8beb1-c5fd2849-da9a048e-ip");
+#else // Without libidn, jidprep always returns an empty string
+ assert(jidprep(badjid) == "");
+#endif
/**
* IID parsing