//The only case when this entity handler is for a non-existing resource.
OCEntityHandlerResult
OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
- OCEntityHandlerRequest *entityHandlerRequest, char* uri, void* callbackParam)
+ OCEntityHandlerRequest *entityHandlerRequest, char* uri, void* /*callbackParam*/)
{
OC_LOG_V(INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
OCEntityHandlerRequest * ehRequest,
- void* callback)
+ void* /*callback*/)
{
OCEntityHandlerResult ret = OC_EH_OK;
OCEntityHandlerResponse response;
}
OCEntityHandlerResult OCEntityHandlerLightCb(OCEntityHandlerFlag flag,
- OCEntityHandlerRequest * ehRequest,void* callbackParam)
+ OCEntityHandlerRequest * ehRequest,void* /*callbackParam*/)
{
OCEntityHandlerResult ret = OC_EH_OK;
OCEntityHandlerResponse response;
}
OCEntityHandlerResult OCEntityHandlerFanCb(OCEntityHandlerFlag flag,
- OCEntityHandlerRequest * ehRequest, void* callback)
+ OCEntityHandlerRequest * ehRequest, void* /*callback*/)
{
OCEntityHandlerResult ret = OC_EH_OK;
OCEntityHandlerResponse response;
//-----------------------------------------------------------------------------
static const char TAG[] = "TestHarness";
+char gDeviceUUID[] = "myDeviceUUID";
+char gManufacturerName[] = "myName";
+char gTooLongManufacturerName[] = "extremelylongmanufacturername";
+char gManufacturerUrl[] = "www.foooooooooooooooo.baaaaaaaaaaaaar";
+
std::chrono::seconds const SHORT_TEST_TIMEOUT = std::chrono::seconds(5);
//-----------------------------------------------------------------------------
// Callback functions
//-----------------------------------------------------------------------------
-extern "C" OCStackApplicationResult asyncDoResourcesCallback(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+extern "C" OCStackApplicationResult asyncDoResourcesCallback(void* ctx,
+ OCDoHandle /*handle*/, OCClientResponse * clientResponse)
{
OC_LOG(INFO, TAG, "Entering asyncDoResourcesCallback");
//-----------------------------------------------------------------------------
// Entity handler
//-----------------------------------------------------------------------------
-OCEntityHandlerResult entityHandler(OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest,
- void* callbackParam)
+OCEntityHandlerResult entityHandler(OCEntityHandlerFlag /*flag*/,
+ OCEntityHandlerRequest * /*entityHandlerRequest*/,
+ void* /*callbackParam*/)
{
OC_LOG(INFO, TAG, "Entering entityHandler");
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
- OCPlatformInfo info = {};
- info.platformID = (char *) "platform_id";
- info.manufacturerName = (char *) "manufac_name";
-
+ OCPlatformInfo info =
+ {
+ gDeviceUUID,
+ gManufacturerName,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
EXPECT_EQ(OC_STACK_OK, OCSetPlatformInfo(info));
EXPECT_EQ(OC_STACK_OK, OCStop());
}
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
- OCPlatformInfo info = {};
- info.manufacturerName = (char *) "manufac_name";
+ OCPlatformInfo info =
+ {
+ 0,
+ gDeviceUUID,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
EXPECT_EQ(OC_STACK_INVALID_PARAM, OCSetPlatformInfo(info));
EXPECT_EQ(OC_STACK_OK, OCStop());
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
- OCPlatformInfo info = {};
- info.platformID = (char *) "platform_id";
+ OCPlatformInfo info =
+ {
+ gDeviceUUID,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
EXPECT_EQ(OC_STACK_INVALID_PARAM, OCSetPlatformInfo(info));
EXPECT_EQ(OC_STACK_OK, OCStop());
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
- OCPlatformInfo info = {};
- info.platformID = (char *) "platform_id";
+ OCPlatformInfo info =
+ {
+ gDeviceUUID,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
info.manufacturerName = (char *) "";
EXPECT_EQ(OC_STACK_INVALID_PARAM, OCSetPlatformInfo(info));
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
- OCPlatformInfo info = {};
- info.platformID = (char *) "platform_id";
- info.manufacturerName = (char *) "extremelylongmanufacturername";
+ OCPlatformInfo info =
+ {
+ gDeviceUUID,
+ gTooLongManufacturerName,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
EXPECT_EQ(OC_STACK_INVALID_PARAM, OCSetPlatformInfo(info));
EXPECT_EQ(OC_STACK_OK, OCStop());
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER));
-
- OCPlatformInfo info = {};
- info.platformID = (char *) "platform_id";
- info.manufacturerName = (char *) "extremelylongmanufacturername";
- info.manufacturerUrl = (char *)"www.foooooooooooooooo.baaaaaaaaaaaaar";
+ OCPlatformInfo info =
+ {
+ gDeviceUUID,
+ gManufacturerName,
+ gManufacturerUrl,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
EXPECT_EQ(OC_STACK_INVALID_PARAM, OCSetPlatformInfo(info));
EXPECT_EQ(OC_STACK_OK, OCStop());
}
-
TEST(StackDiscovery, DISABLED_DoResourceDeviceDiscovery)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);