}
TEST(RandomGeneration,OCSeedRandom) {
- EXPECT_EQ((uint32_t )0, OCSeedRandom());
+ EXPECT_EQ(0, OCSeedRandom());
}
TEST(RandomGeneration,OCGetRandomByte) {
static char* GetJSONStringForPresence(uint32_t ttl, uint32_t nonce,
OCPresenceTrigger trigger, OCResourceType *resourceType)
{
- cJSON *rootObj = cJSON_CreateObject();
- if (!rootObj)
- {
- return NULL;
- }
-
char *jsonEncodedInfo = NULL;
const char * triggerStr = NULL;
+
+ cJSON *rootObj = cJSON_CreateObject();
+ VERIFY_NON_NULL (rootObj);
+
cJSON_AddItemToObject (rootObj, OC_RSRVD_TTL, cJSON_CreateNumber(ttl));
cJSON_AddItemToObject (rootObj, OC_RSRVD_NONCE, cJSON_CreateNumber(nonce));
static const char NOT_FOUND[] = "Resource Not Found";
static const char RESOURCE_ERROR[] = "Resource Error";
static const char SLOW_RESOURCE[] = "Slow Resource";
+ static const char DUPLICATE_REQUEST[] = "Duplicate Request";
static const char NO_OBSERVERS[] = "No Observers";
static const char OBSV_NO_FOUND[] = "Stack observer not found";
static const char OBSV_NOT_ADDED[] = "Stack observer not added";
return OC::Exception::RESOURCE_ERROR;
case OC_STACK_SLOW_RESOURCE:
return OC::Exception::SLOW_RESOURCE;
+ case OC_STACK_DUPLICATE_REQUEST:
+ return OC::Exception::DUPLICATE_REQUEST;
case OC_STACK_NO_OBSERVERS:
return OC::Exception::NO_OBSERVERS;
case OC_STACK_OBSERVER_NOT_FOUND:
OC_STACK_NO_RESOURCE,
OC_STACK_RESOURCE_ERROR,
OC_STACK_SLOW_RESOURCE,
+ OC_STACK_DUPLICATE_REQUEST,
OC_STACK_NO_OBSERVERS,
OC_STACK_OBSERVER_NOT_FOUND,
OC_STACK_VIRTUAL_DO_NOT_HANDLE,
OC::Exception::NOT_FOUND,
OC::Exception::RESOURCE_ERROR,
OC::Exception::SLOW_RESOURCE,
+ OC::Exception::DUPLICATE_REQUEST,
OC::Exception::NO_OBSERVERS,
OC::Exception::OBSV_NO_FOUND,
OC::Exception::VIRTUAL_DO_NOT_HANDLE,