diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2013-02-13 03:20:52 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2013-02-13 03:20:52 +0200 |
commit | e255c37eca94d4d9c23f689b473b106575b9e2fa (patch) | |
tree | 0d7916bcd872d3da2367acbec6d0594c837193fd /proto_lib/utilities.cpp | |
parent | 85a13d70cc5249e2f583bb16f0914646aefe4fe6 (diff) |
some testing code
Diffstat (limited to 'proto_lib/utilities.cpp')
-rw-r--r-- | proto_lib/utilities.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/proto_lib/utilities.cpp b/proto_lib/utilities.cpp index 64f69bb..b54e45a 100644 --- a/proto_lib/utilities.cpp +++ b/proto_lib/utilities.cpp @@ -81,4 +81,30 @@ const unsigned char *to_internal_type(packet_type t) return type; } +#ifdef DEBUG +bool service_s::cmd::operator==(const cmd& c) +{ + if(c.command != command) + return false; + if(c.description != description) + return false; + return true; +} + +bool service_s::operator==(service_s& s) +{ + if(s.service != service) + return false; + for(std::list<service_s::cmd>::iterator i = s.cmds.begin(), end = s.cmds.end(); i != end; ++i) + { + if(std::find(cmds.begin(), cmds.end(), *i) == cmds.end()) + return false; + } + return true; +} +bool service_s::operator!=(service_s& s) +{ + return !(*this == s); +} +#endif }; |