From: Maxim Mamontov Date: Thu, 1 Sep 2011 10:58:54 +0000 (+0300) Subject: Add assertions on OpenSearch result X-Git-Tag: 2.408-alpha~7 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/e08647faf449d1e8b4b214e0e1891203e322f76a?hp=1147628fd6aa3e78322a596880c1d46f8e6468df Add assertions on OpenSearch result --- diff --git a/projects/stargazer/plugins/other/smux/sensors.cpp b/projects/stargazer/plugins/other/smux/sensors.cpp index 6018566c..9cfdadd0 100644 --- a/projects/stargazer/plugins/other/smux/sensors.cpp +++ b/projects/stargazer/plugins/other/smux/sensors.cpp @@ -1,3 +1,5 @@ +#include + #include "stg/INTEGER.h" #include "stg/user.h" @@ -7,8 +9,7 @@ bool UsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); -if (!handle) - return false; +assert(handle && "USERS::OpenSearch is always correct"); USER_PTR user; size_t count = 0; @@ -28,8 +29,7 @@ return true; std::string UsersSensor::ToString() const { int handle = users.OpenSearch(); -if (!handle) - return ""; +assert(handle && "USERS::OpenSearch is always correct"); USER_PTR user; size_t count = 0;