From e08647faf449d1e8b4b214e0e1891203e322f76a Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 1 Sep 2011 13:58:54 +0300 Subject: [PATCH 1/1] Add assertions on OpenSearch result --- projects/stargazer/plugins/other/smux/sensors.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.44.2