request->obsInfo.action = action;
request->obsInfo.obsId = id++;
- std::string query = std::string(NS_QUERY_CONSUMER_ID)
+ const std::string query = std::string(NS_QUERY_CONSUMER_ID)
+ "=" + testConsumerId;
- request->query = (char *)malloc(query.size() + 1);
+ request->query = strdup(query.c_str());
EXPECT_NE((void *)NULL, request->query);
- strncpy(request->query, query.c_str(), query.size() + 1);
}
request->method = method;
request->numRcvdVendorSpecificHeaderOptions = 0;
{
OCEntityHandlerFlag flag = OC_REQUEST_FLAG;
OCEntityHandlerRequest * getRequest = getEntityRequest(OC_REST_GET, OC_OBSERVE_NO_OPTION);
- std::string query = std::string("if=") + "test.invalid";
+ const std::string query = std::string("if=") + "test.invalid";
getRequest->query = strdup(query.c_str());
auto ret = NSEntityHandlerNotificationCb(flag, getRequest, NULL);
{
OCEntityHandlerFlag flag = OC_REQUEST_FLAG;
OCEntityHandlerRequest * getRequest = getEntityRequest(OC_REST_GET, OC_OBSERVE_NO_OPTION);
- std::string query = std::string("if=") + "test.invalid";
+ const std::string query = std::string("if=") + "test.invalid";
getRequest->query = strdup(query.c_str());
auto ret = NSEntityHandlerMessageCb(flag, getRequest, NULL);
{
OCEntityHandlerFlag flag = OC_REQUEST_FLAG;
OCEntityHandlerRequest * getRequest = getEntityRequest(OC_REST_GET, OC_OBSERVE_NO_OPTION);
- std::string query = std::string("if=") + "test.invalid";
+ const std::string query = std::string("if=") + "test.invalid";
getRequest->query = strdup(query.c_str());
auto ret = NSEntityHandlerSyncCb(flag, getRequest, NULL);
{
OCEntityHandlerFlag flag = OC_REQUEST_FLAG;
OCEntityHandlerRequest * getRequest = getEntityRequest(OC_REST_GET, OC_OBSERVE_NO_OPTION);
- std::string query = std::string("if=") + "test.invalid";
+ const std::string query = std::string("if=") + "test.invalid";
getRequest->query = strdup(query.c_str());
auto ret = NSEntityHandlerTopicCb(flag, getRequest, NULL);
{
OCEntityHandlerFlag flag = OC_REQUEST_FLAG;
OCEntityHandlerRequest * getRequest = getEntityRequest(OC_REST_GET, OC_OBSERVE_NO_OPTION);
- std::string query = std::string("if=") + NS_INTERFACE_BASELINE;
+ const std::string query = std::string("if=") + NS_INTERFACE_BASELINE;
getRequest->query = strdup(query.c_str());
auto ret = NSEntityHandlerTopicCb(flag, getRequest, NULL);