summaryrefslogtreecommitdiff
path: root/src/connectionhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/connectionhandler.cc')
-rw-r--r--src/connectionhandler.cc108
1 files changed, 0 insertions, 108 deletions
diff --git a/src/connectionhandler.cc b/src/connectionhandler.cc
index d0fb9e1..eb0f935 100644
--- a/src/connectionhandler.cc
+++ b/src/connectionhandler.cc
@@ -111,111 +111,3 @@ SubscriberList ConnectionHandler::subscriberlist(NodeIdList nodes)
return clients;
}
-
-
-#ifdef TEST_CONNECTIONHANDLER
-//deps:
-//cflags:
-//libs:
-
-#include "test.h"
-
-TEST_BEGIN;
-
-ConnectionHandler &h = connection_handler;
-
-h.init((clientid_t)1);
-h.subscribe((clientid_t)1, (nodeid_t)1);
-h.subscribe((clientid_t)1, (nodeid_t)2);
-
-h.init((clientid_t)2);
-h.subscribe((clientid_t)2, (nodeid_t)1);
-h.subscribe((clientid_t)2, (nodeid_t)2);
-
-h.init((clientid_t)3);
-h.subscribe((clientid_t)3, (nodeid_t)3);
-
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)1);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_TRUE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_TRUE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_FALSE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)3);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_FALSE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_FALSE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_TRUE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)4);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_FALSE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_FALSE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_FALSE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)1);
- nodes.push_back((nodeid_t)2);
- nodes.push_back((nodeid_t)3);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_TRUE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_TRUE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_TRUE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-h.close((clientid_t)1);
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)1);
- nodes.push_back((nodeid_t)2);
- nodes.push_back((nodeid_t)3);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_FALSE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_TRUE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_TRUE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-h.close((clientid_t)2);
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)1);
- nodes.push_back((nodeid_t)2);
- nodes.push_back((nodeid_t)3);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_FALSE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_FALSE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_TRUE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-h.close((clientid_t)3);
-{
- NodeIdList nodes;
- nodes.push_back((nodeid_t)1);
- nodes.push_back((nodeid_t)2);
- nodes.push_back((nodeid_t)3);
- SubscriberList clst = h.subscriberlist(nodes);
-
- TEST_FALSE(clst.find((clientid_t)1) != clst.end(), "Got client 1?");
- TEST_FALSE(clst.find((clientid_t)2) != clst.end(), "Got client 2?");
- TEST_FALSE(clst.find((clientid_t)3) != clst.end(), "Got client 3?");
-}
-
-TEST_END;
-
-#endif/*TEST_CONNECTIONHANDLER*/