summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-30 13:39:00 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-30 13:39:00 +0200
commita63faf6fa95017dbbfeaf0ff43fdb526c4ae7068 (patch)
tree42ee1836e80d6bbbc9cb2b2cff2b39116320c7da /src/test.cpp
parent8eb9e535a3514a7d9254819f499dcb169c56b51e (diff)
downloadbiboumi-a63faf6fa95017dbbfeaf0ff43fdb526c4ae7068.tar.gz
biboumi-a63faf6fa95017dbbfeaf0ff43fdb526c4ae7068.tar.bz2
biboumi-a63faf6fa95017dbbfeaf0ff43fdb526c4ae7068.tar.xz
biboumi-a63faf6fa95017dbbfeaf0ff43fdb526c4ae7068.zip
Use libuuid to generate unique IDs for iq and adhoc sessions
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/test.cpp b/src/test.cpp
index 8fe739c..ac14377 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -121,9 +121,14 @@ int main()
/**
* Id generation
*/
- assert(XmppComponent::next_id() == "0");
- assert(XmppComponent::next_id() == "1");
- assert(XmppComponent::next_id() == "2");
+ std::cout << color << "Testing id generation…" << reset << std::endl;
+ const std::string first_uuid = XmppComponent::next_id();
+ const std::string second_uuid = XmppComponent::next_id();
+ std::cout << first_uuid << std::endl;
+ std::cout << second_uuid << std::endl;
+ assert(first_uuid.size() == 36);
+ assert(second_uuid.size() == 36);
+ assert(first_uuid != second_uuid);
/**
* Utils