Commit b012c7c3 authored by Pavel Vainerman's avatar Pavel Vainerman Committed by Pavel Vainerman

fixed tests

parent 2e01bbf4
......@@ -14,12 +14,24 @@ using namespace uniset;
using namespace uniset::extensions;
// -----------------------------------------------------------------------------
static std::shared_ptr<SMInterface> shm;
static uniset::ObjectId testOID = DefaultObjectId;
static ObjectId aid = DefaultObjectId;
static const std::string aidName = "AI_AS";
// -----------------------------------------------------------------------------
static void init_test()
{
shm = smiInstance();
REQUIRE( shm != nullptr );
REQUIRE( uniset_conf() != nullptr );
shm = smiInstance();
REQUIRE( shm != nullptr );
auto conf = uniset_conf();
REQUIRE( conf != nullptr );
testOID = conf->getObjectID("TestProc");
CHECK( testOID != DefaultObjectId );
aid = conf->getSensorID(aidName);
CHECK( aid != DefaultObjectId );
}
// -----------------------------------------------------------------------------
TEST_CASE("[REST API: conf]", "[restapi][conf]")
......
......@@ -1322,13 +1322,12 @@ Poco::JSON::Object::Ptr IONotifyController::getConsumers(ObjectId sid, ConsumerL
* }
*/
Poco::JSON::Object::Ptr jret = new Poco::JSON::Object();
uniset_rwmutex_rlock lock(ci.mut);
if( ci.clst.empty() && ifNotEmpty )
return jret;
return nullptr;
Poco::JSON::Object::Ptr jret = new Poco::JSON::Object();
auto oind = uniset_conf()->oind;
auto jsens = uniset::json::make_child(jret, "sensor");
jsens->set("id", sid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment