diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-10-24 15:19:55 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-10-24 15:19:55 +0200 |
commit | 83bd57b1909a6a0fa8675548d796073bd8054dae (patch) | |
tree | b9b55f0bf8d8b52a0685b6bdbebf28f6a2050f4e /src/test.cpp | |
parent | 74c73799ab83ac1569ddee7a3dddb12df3bc8a6d (diff) | |
download | biboumi-83bd57b1909a6a0fa8675548d796073bd8054dae.tar.gz biboumi-83bd57b1909a6a0fa8675548d796073bd8054dae.tar.bz2 biboumi-83bd57b1909a6a0fa8675548d796073bd8054dae.tar.xz biboumi-83bd57b1909a6a0fa8675548d796073bd8054dae.zip |
Some little fixes in test.cpp
Diffstat (limited to 'src/test.cpp')
-rw-r--r-- | src/test.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/test.cpp b/src/test.cpp index 0a3b4c8..f6fb629 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -6,7 +6,6 @@ #include <network/dns_handler.hpp> #include <utils/timed_events.hpp> #include <database/database.hpp> -#include <xmpp/xmpp_parser.hpp> #include <network/resolver.hpp> #include <utils/encoding.hpp> #include <network/poller.hpp> @@ -22,17 +21,14 @@ #include <xmpp/jid.hpp> #include <irc/iid.hpp> #include <unistd.h> -#include <string.h> -#include <iostream> #include <thread> -#include <vector> - -#include "biboumi.h" #undef NDEBUG #include <assert.h> +using namespace std::chrono_literals; + static const std::string color("[35m"); static const std::string reset("[m"); @@ -109,7 +105,7 @@ int main() */ std::cout << color << "Testing encoding…" << reset << std::endl; const char* valid = "C̡͔͕̩͙̽ͫ̈́ͥ̿̆ͧ̚r̸̩̘͍̻͖̆͆͛͊̉̕͡o͇͈̳̤̱̊̈͢q̻͍̦̮͕ͥͬͬ̽ͭ͌̾ͅǔ͉͕͇͚̙͉̭͉̇̽ȇ͈̮̼͍͔ͣ͊͞͝ͅ ͫ̾ͪ̓ͥ̆̋̔҉̢̦̠͈͔̖̲̯̦ụ̶̯͐̃̋ͮ͆͝n̬̱̭͇̻̱̰̖̤̏͛̏̿̑͟ë́͐҉̸̥̪͕̹̻̙͉̰ ̹̼̱̦̥ͩ͑̈́͑͝ͅt͍̥͈̹̝ͣ̃̔̈̔ͧ̕͝ḙ̸̖̟̙͙ͪ͢ų̯̞̼̲͓̻̞͛̃̀́b̮̰̗̩̰̊̆͗̾̎̆ͯ͌͝.̗̙͎̦ͫ̈́ͥ͌̈̓ͬ"; - assert(utils::is_valid_utf8(valid) == true); + assert(utils::is_valid_utf8(valid)); const char* invalid = "\xF0\x0F"; assert(utils::is_valid_utf8(invalid) == false); const char* invalid2 = "\xFE\xFE\xFF\xFF"; @@ -302,7 +298,7 @@ int main() assert(jid2.resource == "coucou@coucou/coucou"); // Jidprep - const std::string& badjid("~zigougou™@EpiK-7D9D1FDE.poez.io/Boujour/coucou/slt™"); + const std::string badjid("~zigougou™@EpiK-7D9D1FDE.poez.io/Boujour/coucou/slt™"); const std::string correctjid = jidprep(badjid); std::cout << correctjid << std::endl; assert(correctjid == "~zigougoutm@epik-7d9d1fde.poez.io/Boujour/coucou/sltTM"); |