numRecvSceneActionCreationResp++;
if(numCreatedSceneAction == numRecvSceneActionCreationResp)
+ {
g_currentRun();
+ }
}
void onRemoteSceneExecuted(const std::string &sceneName, int eCode)
void createRemoteSceneCollection()
{
- if (!g_sceneList) return;
+ if (!g_sceneList)
+ {
+ return;
+ }
g_sceneList->addNewSceneCollection(onRemoteSceneCollectionCreated);
}
void showRemoteSceneCollection()
{
- if (!g_sceneList) return;
+ if (!g_sceneList)
+ {
+ return;
+ }
- if (g_sceneList->getRemoteSceneCollections().size() == 0) return;
+ if (g_sceneList->getRemoteSceneCollections().size() == 0)
+ {
+ return;
+ }
g_sceneCollection = g_sceneList->getRemoteSceneCollections().at(0);
- if( g_sceneCollection->getRemoteScenes().size() == 0) return;
+ if( g_sceneCollection->getRemoteScenes().size() == 0)
+ {
+ return;
+ }
g_scene = g_sceneCollection->getRemoteScenes().begin()->second;
}
void createRemoteScene()
{
- if (!g_sceneCollection) return;
+ if (!g_sceneCollection)
+ {
+ return;
+ }
g_sceneCollection->addNewScene(scene_name, onRemoteSceneCreated);
}
if (!std::cin.fail())
{
- if (input == max + 1) exit(0);
- if (min <= input && input <= max) return input;
+ if (input == max + 1)
+ {
+ exit(0);
+ }
+ if (min <= input && input <= max)
+ {
+ return input;
+ }
}
std::cin.clear();
void displaySceneList()
{
- if (!g_sceneList) return;
+ if (!g_sceneList)
+ {
+ return;
+ }
std::cout << "\t" << g_sceneList->getName() << "(SceneList)" << std::endl;
- if (!g_sceneCollection) return;
+ if (!g_sceneCollection)
+ {
+ return;
+ }
std::cout << "\t\t |_ _ _ " << g_sceneCollection->getId() << " (SceneCollection)" << std::endl;
displayClear(runRemoteSceneCollection);
break;
}
- } catch (std::exception &e)
+ }
+ catch (std::exception &e)
{
std::cout << e.what() << std::endl;
g_currentRun();
// if the found resource is a scene list resource
if (std::find(vecRTs.begin(), vecRTs.end(), "oic.wk.sceneList") != vecRTs.end())
+ {
g_foundListResource = foundResource;
+ }
// if the found resource is a light resource
else if (std::find(vecRTs.begin(), vecRTs.end(), "core.light") != vecRTs.end())
return 0;
}
- while (true) { }
+ while (true)
+ {
+ }
std::cout << "Stopping the scene client" << std::endl;
= m_requestor->getSceneMemberResourceRequestor(targetHref);
if (foundMemberRequestor == nullptr)
+ {
m_requestor->createSceneMemberResourceRequestor(href, id, target);
+ }
RCSResourceAttributes attrs;
attrs[key] = RCSResourceAttributes::Value(value);
newAction = createRemoteSceneAction(targetLink, attrs);
if (newAction)
+ {
result = SCENE_RESPONSE_SUCCESS;
+ }
}
clientCB(newAction, result);
std::condition_variable cond;
std::mutex mutex;
};
-void executeCallback(int /*code*/) {};
+void executeCallback(int /*code*/)
+{
+}
TEST_F(SceneTest, createSceneInstance)
{
TEST_F(SceneTest, executeScene)
{
- mocks.ExpectCallFunc(executeCallback).Do([this](int){ proceed(); });
+ mocks.ExpectCallFunc(executeCallback).Do([this](int)
+ {
+ proceed();
+ });
createServer("/a/testuri2_1", "/a/testuri2_2");
createSceneCollection();