summaryrefslogtreecommitdiff
path: root/proto_test/main.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2013-02-13 18:05:13 +0200
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2013-02-13 18:05:13 +0200
commit49729a7593320662545b7c795f028d0f87827b0f (patch)
tree7bba69ac6cca15c29d1187c7267bf917fae14fa3 /proto_test/main.cpp
parente255c37eca94d4d9c23f689b473b106575b9e2fa (diff)
proto lib fixes
Diffstat (limited to 'proto_test/main.cpp')
-rw-r--r--proto_test/main.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/proto_test/main.cpp b/proto_test/main.cpp
index 28d04e9..ba0b8e8 100644
--- a/proto_test/main.cpp
+++ b/proto_test/main.cpp
@@ -76,6 +76,7 @@ bool test_services_extraction()
c.description = "command 3 desc";
s1.cmds.push_back(c);
list1.push_back(s1);
+ s1.cmds.clear();
s1.service = "sd,fhjsiufhifhirhwiefbbbbvwyefgweyfuyvbwf service 2 aaaaaaaaaaaaaaaaaa111111111111111111111111asdasdasd";
c.command = "2command 1";
c.description = "2some desc";
@@ -87,6 +88,7 @@ bool test_services_extraction()
c.description = "2command 3 desc";
s1.cmds.push_back(c);
list1.push_back(s1);
+ s1.cmds.clear();
s1.service = "sd,fhjsiufhiadadsdfgdffghghjbnfdghdgffhirhwiefbbbbvwyefgweyfuyvbwf service 2 aaaaaaaaaaaaaaaaaa111111111111111111111111asdasdasd";
c.command = "32commanasdasdd 1";
c.description = "32some desc";
@@ -101,13 +103,24 @@ bool test_services_extraction()
delete p;
p = packet::serv_make_services_packet(list1);
std::list<service_s> *list2 = packet::cli_extract_services(*p);
- for(std::list<service_s>::iterator i = list2->begin(), end = list2->end(); i != end; ++i)
+/* std::cout<<"\n\nlist1 content\n\n\n";
+ for(std::list<service_s>::iterator i = list1.begin(), end = list1.end(); i != end; ++i)
{
- //if(std::find(list1.begin(), list1.end(), *i) == list1.end()) //fuck
- for(std::list<service_s>::iterator ii = list1.begin(), end = list1.end(); ii != end; ++ii)
- if(*ii != *i)
- return false;
+ std::cout<<"service name: "<<i->service<<"\n\t";
+ for(std::list<service_s::cmd>::iterator ii = i->cmds.begin(), eend = i->cmds.end(); ii != eend; ++ii)
+ std::cout<<ii->command<<"|"<<ii->description<<"; ";
+ std::cout<<"\n\n";
}
+ std::cout<<"\n\nlist2 content\n\n\n";
+ for(std::list<service_s>::iterator i = list2->begin(), end = list2->end(); i != end; ++i)
+ {
+ std::cout<<"service name: "<<i->service<<"\n\t";
+ for(std::list<service_s::cmd>::iterator ii = i->cmds.begin(), eend = i->cmds.end(); ii != eend; ++ii)
+ std::cout<<ii->command<<"|"<<ii->description<<"; ";
+ std::cout<<"\n\n";
+ } */
+ if(list1 != *list2)
+ return false;
return true;
}