/***************************************************************************
-*
-* Copyright 2010,2011 BMW Car IT GmbH
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-****************************************************************************/
+ *
+ * Copyright 2010,2011 BMW Car IT GmbH
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
#ifndef DBUSDBUSCommunicatorTest_H_
#define DBUSDBUSCommunicatorTest_H_
using ::testing::ElementsAre;
using ::testing::NotNull;
-std::string DBUSCOMMAND_SYSTEM = "dbus-send --system --type=method_call --print-reply --dest=org.genivi.layermanagementservice /org/genivi/layermanagementservice org.genivi.layermanagementservice.";
-std::string DBUSCOMMAND_SESSION = "dbus-send --type=method_call --print-reply --dest=org.genivi.layermanagementservice /org/genivi/layermanagementservice org.genivi.layermanagementservice.";
+std::string DBUSCOMMAND_SYSTEM =
+ "dbus-send --system --type=method_call --print-reply --dest=org.genivi.layermanagementservice /org/genivi/layermanagementservice org.genivi.layermanagementservice.";
+std::string DBUSCOMMAND_SESSION =
+ "dbus-send --type=method_call --print-reply --dest=org.genivi.layermanagementservice /org/genivi/layermanagementservice org.genivi.layermanagementservice.";
std::string DBUSCOMMAND = DBUSCOMMAND_SYSTEM;
-class DBUSCommunicatorTest : public ::testing::Test {
+class DBUSCommunicatorTest: public ::testing::Test {
public:
pthread_t processThread;
bool running;
ICommunicator* communicatorUnderTest;
MockCommandExecutor mockCommandExecutor;
MockLayerList layerlist;
-
- DBUSCommunicatorTest()
- {
+
+ DBUSCommunicatorTest() {
}
- virtual ~DBUSCommunicatorTest()
- {
+ virtual ~DBUSCommunicatorTest() {
}
- static void *processLoop (void * ptr)
- {
- while ( ((DBUSCommunicatorTest*)ptr)->running )
- {
- ((DBUSCommunicatorTest*)ptr)->communicatorUnderTest->process(100);
- }
- return NULL;
+
+ static void *processLoop(void * ptr) {
+ while (((DBUSCommunicatorTest*) ptr)->running) {
+ ((DBUSCommunicatorTest*) ptr)->communicatorUnderTest->process(100);
+ }
+ return NULL;
}
- void SetUp()
- {
+
+ void SetUp() {
char* useSessionBus = getenv("LM_USE_SESSION_BUS");
- if ( NULL != useSessionBus && strcmp(useSessionBus,"enable") == 0 )
- {
+ if (NULL != useSessionBus && strcmp(useSessionBus, "enable") == 0) {
DBUSCOMMAND = DBUSCOMMAND_SESSION;
} else {
DBUSCOMMAND = DBUSCOMMAND_SYSTEM;
communicatorUnderTest = new DBUSCommunicator(&mockCommandExecutor);
this->communicatorUnderTest->start();
running = true;
- pthread_create( &processThread, NULL, processLoop, (void*) this);
+ pthread_create(&processThread, NULL, processLoop, (void*) this);
}
- void TearDown()
- {
+ void TearDown() {
running = false;
this->communicatorUnderTest->stop();
- pthread_join( processThread, NULL);
- if (communicatorUnderTest)
- {
+ pthread_join(processThread, NULL);
+ if (communicatorUnderTest) {
delete communicatorUnderTest;
- }
+ }
}
};
-MATCHER_P(DebugCommandEq, onoff, "DebugCommand has onoff set to %(onoff)s")
-{
+MATCHER_P(DebugCommandEq, onoff, "DebugCommand has onoff set to %(onoff)s") {
return ((DebugCommand*)arg)->m_onoff == onoff;
}
-TEST_F(DBUSCommunicatorTest, TurnDebugOnAndOff)
-{
+TEST_F(DBUSCommunicatorTest, TurnDebugOnAndOff) {
EXPECT_CALL(this->mockCommandExecutor, execute(DebugCommandEq(false) ) ).Times(1);
- system((DBUSCOMMAND + std::string("Debug boolean:false")).c_str());
+ system((DBUSCOMMAND + std::string("Debug boolean:false")).c_str());
EXPECT_CALL(this->mockCommandExecutor, execute(DebugCommandEq(true) ) ).Times(1);
- system((DBUSCOMMAND + std::string("Debug boolean:true")).c_str());
+ system((DBUSCOMMAND + std::string("Debug boolean:true")).c_str());
EXPECT_CALL(this->mockCommandExecutor, execute(DebugCommandEq(false) ) ).Times(1);
- system((DBUSCOMMAND + std::string("Debug boolean:false")).c_str());
+ system((DBUSCOMMAND + std::string("Debug boolean:false")).c_str());
}
TEST_F(DBUSCommunicatorTest, ListAllLayerIDS) {
- DefaultValue<Scene*>::Set((Scene*)&this->layerlist);
- EXPECT_CALL(this->layerlist, getLayerIDs(NotNull(),NotNull() )).Times(1) ;
- system((DBUSCOMMAND + std::string("ListAllLayerIDS")).c_str());
+ DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
+ EXPECT_CALL(this->layerlist, getLayerIDs(NotNull(),NotNull() )).Times(1);
+ system((DBUSCOMMAND + std::string("ListAllLayerIDS")).c_str());
}
TEST_F(DBUSCommunicatorTest, listAlllayerGroupIDS) {
std::list<int> defaultlist;
// Sets the default return value for type Bar.
- DefaultValue<Scene*>::Set((Scene*)&this->layerlist);
- DefaultValue< std::list<int> >::Set(defaultlist);
- EXPECT_CALL(this->layerlist, getLayerGroupIDs(NotNull(),NotNull()) ).Times(1) ;
+ DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
+ DefaultValue<std::list<int> >::Set(defaultlist);
+ EXPECT_CALL(this->layerlist, getLayerGroupIDs(NotNull(),NotNull()) ).Times(1);
system((DBUSCOMMAND + std::string("ListAllLayerGroupIDS")).c_str());
}
TEST_F(DBUSCommunicatorTest, listAllSurfaceGroupIDS) {
std::list<int> defaultlist;
// Sets the default return value for type Bar.
- DefaultValue<Scene*>::Set((Scene*)&this->layerlist);
- DefaultValue< std::list<int> >::Set(defaultlist);
- EXPECT_CALL(this->layerlist, getSurfaceGroupIDs(NotNull(),NotNull() )).Times(1) ;
+ DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
+ DefaultValue<std::list<int> >::Set(defaultlist);
+ EXPECT_CALL(this->layerlist, getSurfaceGroupIDs(NotNull(),NotNull() )).Times(1);
system((DBUSCOMMAND + std::string("ListAllSurfaceGroupIDS")).c_str());
}
TEST_F(DBUSCommunicatorTest, listSurfacesOfSurfacegroup) {
std::list<int> defaultlist;
- DefaultValue<Scene*>::Set((Scene*)&this->layerlist);
+ DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
// Sets the default return value for type Bar.
- DefaultValue< std::list<int> >::Set(defaultlist);
- DefaultValue< SurfaceGroup* >::Set(new SurfaceGroup());
- EXPECT_CALL(this->layerlist, getSurfaceGroup(Eq(84567u) )).Times(1) ;
+ DefaultValue<std::list<int> >::Set(defaultlist);
+ DefaultValue<SurfaceGroup*>::Set(new SurfaceGroup());
+ EXPECT_CALL(this->layerlist, getSurfaceGroup(Eq(84567u) )).Times(1);
system((DBUSCOMMAND + std::string("ListSurfacesOfSurfacegroup uint32:84567")).c_str());
}
std::list<int> defaultlist;
// Sets the default return value for type Bar.
- DefaultValue<Scene*>::Set((Scene*)&this->layerlist);
- DefaultValue< std::list<int> >::Set(defaultlist);
- DefaultValue< LayerGroup* >::Set(new LayerGroup());
+ DefaultValue<Scene*>::Set((Scene*) &this->layerlist);
+ DefaultValue<std::list<int> >::Set(defaultlist);
+ DefaultValue<LayerGroup*>::Set(new LayerGroup());
- EXPECT_CALL(this->layerlist, getLayerGroup(Eq(345u) )).Times(1) ;
+ EXPECT_CALL(this->layerlist, getLayerGroup(Eq(345u) )).Times(1);
system((DBUSCOMMAND + std::string("ListLayersOfLayergroup uint32:345")).c_str());
}
TEST_F(DBUSCommunicatorTest, listSurfaceoflayer) {
Scene scene;
- DefaultValue< Layer* >::Set(scene.createLayer(234));
- DefaultValue<Scene*>::Set((Scene*)&layerlist);
- EXPECT_CALL(this->layerlist, getLayer(Eq(234u) )).Times(1) ;
+ DefaultValue<Layer*>::Set(scene.createLayer(234));
+ DefaultValue<Scene*>::Set((Scene*) &layerlist);
+ EXPECT_CALL(this->layerlist, getLayer(Eq(234u) )).Times(1);
system((DBUSCOMMAND + std::string("ListSurfaceofLayer uint32:234")).c_str());
}
TEST_F(DBUSCommunicatorTest, getPropertiesOfSurface) {
Scene scene;
- unsigned int newID=0;
- DefaultValue<Scene*>::Set((Scene*)&layerlist);
- DefaultValue< Surface* >::Set(scene.createSurface(newID));
- EXPECT_CALL(this->layerlist, getSurface(Eq(876u) )).Times(1) ;
+ unsigned int newID = 0;
+ DefaultValue<Scene*>::Set((Scene*) &layerlist);
+ DefaultValue<Surface*>::Set(scene.createSurface(newID));
+ EXPECT_CALL(this->layerlist, getSurface(Eq(876u) )).Times(1);
system((DBUSCOMMAND + std::string("GetPropertiesOfSurface uint32:876")).c_str());
}
TEST_F(DBUSCommunicatorTest, getPropertiesOflayer) {
Scene scene;
- DefaultValue< Layer* >::Set(scene.createLayer(0));
- DefaultValue<Scene*>::Set((Scene*)&layerlist);
- EXPECT_CALL(this->layerlist, getLayer(Eq(876u) )).Times(1) ;
+ DefaultValue<Layer*>::Set(scene.createLayer(0));
+ DefaultValue<Scene*>::Set((Scene*) &layerlist);
+ EXPECT_CALL(this->layerlist, getLayer(Eq(876u) )).Times(1);
system((DBUSCOMMAND + std::string("GetPropertiesOfLayer uint32:876")).c_str());
}
-MATCHER_P5(CreateCommandEq, nativeHandle,OriginalWidth,OriginalHeight,createType,pixelformat, "%(*)s") {
- return ((CreateCommand*)arg)->m_nativeHandle == nativeHandle
- && ((CreateCommand*)arg)->m_originalHeight == OriginalHeight
- && ((CreateCommand*)arg)->m_originalWidth == OriginalWidth
- && ((CreateCommand*)arg)->m_createType == createType
- && ((CreateCommand*)arg)->m_pixelformat == pixelformat;
+MATCHER_P4(SurfaceCreateCommandEq, nativeHandle, OriginalWidth, OriginalHeight, pixelformat, "%(*)s"){
+ return ((SurfaceCreateCommand*)arg)->m_nativeHandle == nativeHandle
+ && ((SurfaceCreateCommand*)arg)->m_originalHeight == OriginalHeight
+ && ((SurfaceCreateCommand*)arg)->m_originalWidth == OriginalWidth
+ && ((SurfaceCreateCommand*)arg)->m_pixelformat == pixelformat;
+}
- }
TEST_F(DBUSCommunicatorTest, CreateSurface) {
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(44u,33u,22u,TypeSurface,PIXELFORMAT_RGBA8888))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfaceCreateCommandEq(44u,33u,22u,PIXELFORMAT_RGBA8888))).Times(1);
system((DBUSCOMMAND + std::string("CreateSurface uint32:44 uint32:33 uint32:22 uint32:2 ")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(404u,303u,0u,TypeSurface,PIXELFORMAT_RGB888))).Times(1);
- system((DBUSCOMMAND + std::string("CreateSurface uint32:404 uint32:303 uint32:0 uint32:1 ")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfaceCreateCommandEq(404u,303u,0u,PIXELFORMAT_RGB888))).Times(1);
+ system((DBUSCOMMAND + std::string("CreateSurface uint32:404 uint32:303 uint32:0 uint32:1 ")).c_str());
+}
+MATCHER_P2(LayerCreateCommandEq, OriginalWidth, OriginalHeight, "%(*)s"){
+ return ((LayerCreateCommand*)arg)->m_originalHeight == OriginalHeight
+ && ((LayerCreateCommand*)arg)->m_originalWidth == OriginalWidth;
}
-TEST_F(DBUSCommunicatorTest, Createlayer) {
+TEST_F(DBUSCommunicatorTest, CreateLayer) {
- uint resolution[2] = {0,0};
+ uint resolution[2] = { 0, 0 };
DefaultValue<uint*>::Set(resolution);
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeLayer,PIXELFORMAT_R8))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute( LayerCreateCommandEq(0u,0u))).Times(1);
system((DBUSCOMMAND + std::string("CreateLayer")).c_str());
-
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeLayer,PIXELFORMAT_R8))).Times(1);
- system((DBUSCOMMAND + std::string("CreateLayer")).c_str());
-
-
}
-MATCHER_P2(RemoveCommandEq, idToRemove,typeToRemove, "%(*)s") {
- return ((RemoveCommand*)arg)->m_idToRemove == idToRemove
- && ((RemoveCommand*)arg)->m_typeToRemove == typeToRemove;
+MATCHER_P(SurfaceRemoveCommandEq, idToRemove, "%(*)s"){
+ return ((SurfaceRemoveCommand*)arg)->m_idToRemove == idToRemove;
+}
- }
TEST_F(DBUSCommunicatorTest, RemoveSurface) {
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(8u,TypeSurface))).Times(1);
- system((DBUSCOMMAND + std::string("RemoveSurface uint32:8")).c_str());
-
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(5u,TypeSurface))).Times(1);
- system((DBUSCOMMAND + std::string("RemoveSurface uint32:5")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfaceRemoveCommandEq(8u))).Times(1);
+ system((DBUSCOMMAND + std::string("RemoveSurface uint32:8")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfaceRemoveCommandEq(5u))).Times(1);
+ system((DBUSCOMMAND + std::string("RemoveSurface uint32:5")).c_str());
+}
+MATCHER_P(LayerRemoveCommandEq, idToRemove, "%(*)s"){
+ return ((LayerRemoveCommand*)arg)->m_idToRemove == idToRemove;
}
TEST_F(DBUSCommunicatorTest, Removelayer) {
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(8u,TypeLayer))).Times(1);
- system((DBUSCOMMAND + std::string("RemoveLayer uint32:8")).c_str());
-
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(5u,TypeLayer))).Times(1);
- system((DBUSCOMMAND + std::string("RemoveLayer uint32:5")).c_str());
-
+ EXPECT_CALL(this->mockCommandExecutor, execute( LayerRemoveCommandEq(8u))).Times(1);
+ system((DBUSCOMMAND + std::string("RemoveLayer uint32:8")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute( LayerRemoveCommandEq(5u))).Times(1);
+ system((DBUSCOMMAND + std::string("RemoveLayer uint32:5")).c_str());
}
-MATCHER_P3(SetOpacityCommandEq, id,type,Opacity, "%(*)s") {
- return ((SetOpacityCommand*)arg)->m_id == id
- && ((SetOpacityCommand*)arg)->m_type == type
- && ((SetOpacityCommand*)arg)->m_opacity == Opacity;
-
- }
+MATCHER_P2(SurfaceSetOpacityCommandEq, id, Opacity, "%(*)s"){
+ return ((SurfaceSetOpacityCommand*)arg)->m_id == id
+ && ((SurfaceSetOpacityCommand*)arg)->m_opacity == Opacity;
+}
TEST_F(DBUSCommunicatorTest, SetSurfaceOpacity) {
- EXPECT_CALL(this->mockCommandExecutor, execute(SetOpacityCommandEq(36u,TypeSurface,0.88) )).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetOpacityCommandEq(36u,0.88) )).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceOpacity uint32:36 double:0.88")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute(SetOpacityCommandEq(44u,TypeSurface,0.001) )).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceOpacity uint32:44 double:0.001")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetOpacityCommandEq(44u,0.001) )).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceOpacity uint32:44 double:0.001")).c_str());
+}
+/*
+TEST_F(DBUSCommunicatorTest, Exit) {
+ EXPECT_CALL(this->mockCommandExecutor, execute(Field(&Command::commandType,Eq(Command::Exit)) ) ).Times(1);
+ system((DBUSCOMMAND + std::string("Exit")).c_str());
+
+ //EXPECT_EXIT(system((DBUSCOMMAND + std::string("Exit")).c_str());, ::testing::ExitedWithCode(0), "");
}
+*/
-//TEST_F(DBUSCommunicatorTest, Exit) {
-// EXPECT_CALL(this->mockCommandExecutor, execute(Field(&Command::commandType,Eq(Command::Exit)) ) ).Times(1);
-// system((DBUSCOMMAND + std::string("Exit")).c_str());
-//
-//
-// //EXPECT_EXIT(system((DBUSCOMMAND + std::string("Exit")).c_str());, ::testing::ExitedWithCode(0), "");
-//
-//}
/*
TEST_F(DBUSCommunicatorTest, Commit) {
- EXPECT_CALL(this->mockCommandExecutor, execute(Field(&ICommand::commandType,Eq(ICommand::CommitChanges)) ) ).Times(1);
- system((DBUSCOMMAND + std::string("CommitChanges")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(Field(&ICommand::commandType, Eq(ICommand::CommitChanges)) ) ).Times(1);
+ system((DBUSCOMMAND + std::string("CommitChanges")).c_str());
}
*/
-MATCHER_P6(SetSourceRectangleCommandEq, id,typeToSet,x,y,width,height, "%(*)s") {
- return ((SetSourceRectangleCommand*)arg)->m_id == id
- && ((SetSourceRectangleCommand*)arg)->m_typeToSet == typeToSet
- && ((SetSourceRectangleCommand*)arg)->m_x == x
- && ((SetSourceRectangleCommand*)arg)->m_y == y
- && ((SetSourceRectangleCommand*)arg)->m_width == width
- && ((SetSourceRectangleCommand*)arg)->m_height == height;
-
- }
+MATCHER_P5(SurfaceSetSourceRectangleCommandEq, id, x, y, width, height, "%(*)s"){
+ return ((SurfaceSetSourceRectangleCommand*)arg)->m_id == id
+ && ((SurfaceSetSourceRectangleCommand*)arg)->m_x == x
+ && ((SurfaceSetSourceRectangleCommand*)arg)->m_y == y
+ && ((SurfaceSetSourceRectangleCommand*)arg)->m_width == width
+ && ((SurfaceSetSourceRectangleCommand*)arg)->m_height == height;
+}
TEST_F(DBUSCommunicatorTest, SetSurfaceSourceRegion) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetSourceRectangleCommandEq(36u,TypeSurface,1u,2u,3u,4u))).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceSourceRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfaceSetSourceRectangleCommandEq(36u,1u,2u,3u,4u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceSourceRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetSourceRectangleCommandEq(44u,TypeSurface,15u,25u,35u,45u))).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceSourceRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfaceSetSourceRectangleCommandEq(44u,15u,25u,35u,45u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceSourceRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
+}
+MATCHER_P5(LayerSetSourceRectangleCommandEq, id, x, y, width, height, "%(*)s"){
+ return ((LayerSetSourceRectangleCommand*)arg)->m_id == id
+ && ((LayerSetSourceRectangleCommand*)arg)->m_x == x
+ && ((LayerSetSourceRectangleCommand*)arg)->m_y == y
+ && ((LayerSetSourceRectangleCommand*)arg)->m_width == width
+ && ((LayerSetSourceRectangleCommand*)arg)->m_height == height;
}
TEST_F(DBUSCommunicatorTest, SetlayerSourceRegion) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetSourceRectangleCommandEq(36u,TypeLayer,1u,2u,3u,4u))).Times(1);
- system((DBUSCOMMAND + std::string("SetLayerSourceRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
-
- EXPECT_CALL(this->mockCommandExecutor, execute( SetSourceRectangleCommandEq(44u,TypeLayer,15u,25u,35u,45u))).Times(1);
- system((DBUSCOMMAND + std::string("SetLayerSourceRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
-
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetSourceRectangleCommandEq(36u,1u,2u,3u,4u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetLayerSourceRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetSourceRectangleCommandEq(44u,15u,25u,35u,45u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetLayerSourceRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
}
-MATCHER_P6(SetDestinationRectangleCommandEq, id,typeToSet,x,y,width,height, "%(*)s") {
- return ((SetDestinationRectangleCommand*)arg)->m_id == id
- && ((SetDestinationRectangleCommand*)arg)->m_typeToSet == typeToSet
- && ((SetDestinationRectangleCommand*)arg)->m_x == x
- && ((SetDestinationRectangleCommand*)arg)->m_y == y
- && ((SetDestinationRectangleCommand*)arg)->m_width == width
- && ((SetDestinationRectangleCommand*)arg)->m_height == height;
+MATCHER_P5(LayerSetDestinationRectangleCommandEq, id, x, y, width, height, "%(*)s") {
+ return ((LayerSetDestinationRectangleCommand*)arg)->m_id == id
+ && ((LayerSetDestinationRectangleCommand*)arg)->m_x == x
+ && ((LayerSetDestinationRectangleCommand*)arg)->m_y == y
+ && ((LayerSetDestinationRectangleCommand*)arg)->m_width == width
+ && ((LayerSetDestinationRectangleCommand*)arg)->m_height == height;
+}
- }
TEST_F(DBUSCommunicatorTest, SetlayerDestinationRegion) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDestinationRectangleCommandEq(36u,TypeLayer,1u,2u,3u,4u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetDestinationRectangleCommandEq(36u,1u,2u,3u,4u))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerDestinationRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDestinationRectangleCommandEq(44u,TypeLayer,15u,25u,35u,45u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetDestinationRectangleCommandEq(44u,15u,25u,35u,45u))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerDestinationRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
+}
+MATCHER_P5(SurfaceSetDestinationRectangleCommandEq, id, x, y, width, height, "%(*)s") {
+ return ((SurfaceSetDestinationRectangleCommand*)arg)->m_id == id
+ && ((SurfaceSetDestinationRectangleCommand*)arg)->m_x == x
+ && ((SurfaceSetDestinationRectangleCommand*)arg)->m_y == y
+ && ((SurfaceSetDestinationRectangleCommand*)arg)->m_width == width
+ && ((SurfaceSetDestinationRectangleCommand*)arg)->m_height == height;
}
TEST_F(DBUSCommunicatorTest, SetSurfaceDestinationRegion) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDestinationRectangleCommandEq(36u,TypeSurface,1u,2u,3u,4u))).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceDestinationRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
-
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDestinationRectangleCommandEq(44u,TypeSurface,15u,25u,35u,45u))).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceDestinationRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
-
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetDestinationRectangleCommandEq(36u,1u,2u,3u,4u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceDestinationRegion uint32:36 uint32:1 uint32:2 uint32:3 uint32:4")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetDestinationRectangleCommandEq(44u,15u,25u,35u,45u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceDestinationRegion uint32:44 uint32:15 uint32:25 uint32:35 uint32:45 ")).c_str());
}
-MATCHER_P4(SetPositionCommandEq, id,typeToSet,x,y, "%(*)s") {
- return ((SetPositionCommand*)arg)->m_id == id
- && ((SetPositionCommand*)arg)->m_typeToSet == typeToSet
- && ((SetPositionCommand*)arg)->m_x == x
- && ((SetPositionCommand*)arg)->m_y == y;
-
- }
+MATCHER_P3(LayerSetPositionCommandEq, id, x, y, "%(*)s"){
+ return ((LayerSetPositionCommand*)arg)->m_id == id
+ && ((LayerSetPositionCommand*)arg)->m_x == x
+ && ((LayerSetPositionCommand*)arg)->m_y == y;
+}
TEST_F(DBUSCommunicatorTest, SetlayerPosition) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetPositionCommandEq(36u,TypeLayer,1u,2u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetPositionCommandEq(36u,1u,2u))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerPosition uint32:36 uint32:1 uint32:2")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetPositionCommandEq(44u,TypeLayer,15u,25u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetPositionCommandEq(44u,15u,25u))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerPosition uint32:44 uint32:15 uint32:25 ")).c_str());
}
+MATCHER_P3(SurfaceSetPositionCommandEq, id, x, y, "%(*)s"){
+ return ((SurfaceSetPositionCommand*)arg)->m_id == id
+ && ((SurfaceSetPositionCommand*)arg)->m_x == x
+ && ((SurfaceSetPositionCommand*)arg)->m_y == y;
+}
+
TEST_F(DBUSCommunicatorTest, SetSurfacePosition) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetPositionCommandEq(36u,TypeSurface,3u,4u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetPositionCommandEq(36u,3u,4u))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacePosition uint32:36 uint32:3 uint32:4")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetPositionCommandEq(44u,TypeSurface,35u,45u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetPositionCommandEq(44u,35u,45u))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacePosition uint32:44 uint32:35 uint32:45 ")).c_str());
}
-MATCHER_P4(SetDimensionCommandEq, id,typeToSet, width,height, "%(*)s") {
- return ((SetDimensionCommand*)arg)->m_id == id
- && ((SetDimensionCommand*)arg)->m_typeToSet == typeToSet
- && ((SetDimensionCommand*)arg)->m_width == width
- && ((SetDimensionCommand*)arg)->m_height == height;
+MATCHER_P3(LayerSetDimensionCommandEq, id, width, height, "%(*)s"){
+ return ((LayerSetDimensionCommand*)arg)->m_id == id
+ && ((LayerSetDimensionCommand*)arg)->m_width == width
+ && ((LayerSetDimensionCommand*)arg)->m_height == height;
+}
- }
TEST_F(DBUSCommunicatorTest, SetlayerDimension) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDimensionCommandEq(8554u,TypeLayer,400u,444u))).Times(1);
- system((DBUSCOMMAND + std::string("SetLayerDimension uint32:8554 uint32:400 uint32:444")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetDimensionCommandEq(8554u,400u,444u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetLayerDimension uint32:8554 uint32:400 uint32:444")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDimensionCommandEq(34589u,TypeLayer,400u,444u))).Times(1);
- system((DBUSCOMMAND + std::string("SetLayerDimension uint32:34589 uint32:400 uint32:444")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetDimensionCommandEq(34589u,400u,444u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetLayerDimension uint32:34589 uint32:400 uint32:444")).c_str());
+}
+
+MATCHER_P3(SurfaceSetDimensionCommandEq, id, width, height, "%(*)s"){
+ return ((SurfaceSetDimensionCommand*)arg)->m_id == id
+ && ((SurfaceSetDimensionCommand*)arg)->m_width == width
+ && ((SurfaceSetDimensionCommand*)arg)->m_height == height;
}
TEST_F(DBUSCommunicatorTest, SetSurfaceDimension) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDimensionCommandEq(36u,TypeSurface,3u,4u))).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceDimension uint32:36 uint32:3 uint32:4")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetDimensionCommandEq(36u,3u,4u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceDimension uint32:36 uint32:3 uint32:4")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetDimensionCommandEq(44u,TypeSurface,35u,45u))).Times(1);
- system((DBUSCOMMAND + std::string("SetSurfaceDimension uint32:44 uint32:35 uint32:45 ")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetDimensionCommandEq(44u,35u,45u))).Times(1);
+ system((DBUSCOMMAND + std::string("SetSurfaceDimension uint32:44 uint32:35 uint32:45 ")).c_str());
+}
+MATCHER_P2(LayerSetOpacityCommandEq, id, Opacity, "%(*)s"){
+ return ((LayerSetOpacityCommand*)arg)->m_id == id
+ && ((LayerSetOpacityCommand*)arg)->m_opacity == Opacity;
}
TEST_F(DBUSCommunicatorTest, SetlayerOpacity) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOpacityCommandEq(36u,TypeLayer,0.88))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetOpacityCommandEq(36u,0.88))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerOpacity uint32:36 double:0.88")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOpacityCommandEq(44u,TypeLayer,0.001))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetOpacityCommandEq(44u,0.001))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerOpacity uint32:44 double:0.001")).c_str());
}
-MATCHER_P2(GetOpacityCommandEq, id,type, "%(*)s") {
- return ((GetOpacityCommand*)arg)->m_id == id
- && ((GetOpacityCommand*)arg)->m_type == type;
+MATCHER_P(LayerGetOpacityCommandEq, id, "%(*)s"){
+ return ((LayerGetOpacityCommand*)arg)->m_id == id;
+}
- }
TEST_F(DBUSCommunicatorTest, GetlayerOpacity) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetOpacityCommandEq(36u,TypeLayer))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerGetOpacityCommandEq(36u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerOpacity uint32:36")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetOpacityCommandEq(44u,TypeLayer))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerGetOpacityCommandEq(44u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerOpacity uint32:44 ")).c_str());
}
+MATCHER_P2(SurfacegroupSetOpacityCommandEq, id, Opacity, "%(*)s") {
+ return ((SurfacegroupSetOpacityCommand*)arg)->m_id == id
+ && ((SurfacegroupSetOpacityCommand*)arg)->m_opacity == Opacity;
+}
+
TEST_F(DBUSCommunicatorTest, SetSurfacegroupOpacity) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOpacityCommandEq(36u,TypeSurfaceGroup,0.88))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetOpacityCommandEq(36u,0.88))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacegroupOpacity uint32:36 double:0.88")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOpacityCommandEq(44u,TypeSurfaceGroup,0.001))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetOpacityCommandEq(44u,0.001))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacegroupOpacity uint32:44 double:0.001")).c_str());
}
+MATCHER_P2(LayergroupSetOpacityCommandEq, id, Opacity, "%(*)s"){
+ return ((LayergroupSetOpacityCommand*)arg)->m_id == id
+ && ((LayergroupSetOpacityCommand*)arg)->m_opacity == Opacity;
+}
+
TEST_F(DBUSCommunicatorTest, SetlayergroupOpacity) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOpacityCommandEq(36u,TypeLayerGroup,0.88))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetOpacityCommandEq(36u,0.88))).Times(1);
system((DBUSCOMMAND + std::string("SetLayergroupOpacity uint32:36 double:0.88")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOpacityCommandEq(44u,TypeLayerGroup,0.001))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetOpacityCommandEq(44u,0.001))).Times(1);
system((DBUSCOMMAND + std::string("SetLayergroupOpacity uint32:44 double:0.001")).c_str());
}
-MATCHER_P3(SetOrientationCommandEq, id,type,Orientation, "%(*)s") {
- return ((SetOrientationCommand*)arg)->m_id == id
- && ((SetOrientationCommand*)arg)->m_type == type
- && ((SetOrientationCommand*)arg)->m_orientation == Orientation;
-
- }
+MATCHER_P2(SurfaceSetOrientationCommandEq, id, Orientation, "%(*)s") {
+ return ((SurfaceSetOrientationCommand*)arg)->m_id == id
+ && ((SurfaceSetOrientationCommand*)arg)->m_orientation == Orientation;
+}
TEST_F(DBUSCommunicatorTest, SetSurfaceOrientation) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOrientationCommandEq(36u,TypeSurface,0))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetOrientationCommandEq(36u,0))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceOrientation uint32:36 uint32:0")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOrientationCommandEq(44u,TypeSurface,1))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetOrientationCommandEq(44u,1))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceOrientation uint32:44 uint32:1")).c_str());
}
+MATCHER_P2(LayerSetOrientationCommandEq, id, Orientation, "%(*)s") {
+ return ((LayerSetOrientationCommand*)arg)->m_id == id
+ && ((LayerSetOrientationCommand*)arg)->m_orientation == Orientation;
+}
+
TEST_F(DBUSCommunicatorTest, SetlayerOrientation) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOrientationCommandEq(36u,TypeLayer,0))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetOrientationCommandEq(36u,0))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerOrientation uint32:36 uint32:0")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetOrientationCommandEq(44u,TypeLayer,1))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetOrientationCommandEq(44u,1))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerOrientation uint32:44 uint32:1")).c_str());
}
+MATCHER_P2(SurfaceSetVisibilityCommandEq, id, visibility, "%(*)s"){
+ return ((SurfaceSetVisibilityCommand*)arg)->m_idtoSet == id
+ && ((SurfaceSetVisibilityCommand*)arg)->m_visibility == visibility;
+}
-MATCHER_P3(SetVisibilityCommandEq, id,otype,visibility, "%(*)s") {
- return ((SetVisibilityCommand*)arg)->m_idtoSet == id
- && ((SetVisibilityCommand*)arg)->m_otype == otype
- && ((SetVisibilityCommand*)arg)->m_visibility == visibility;
-
- }
TEST_F(DBUSCommunicatorTest, SetSurfaceVisibility) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeSurface,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeSurface,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceVisibility uint32:44 boolean:true")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeSurface,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeSurface,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfaceVisibility uint32:44 boolean:true")).c_str());
+}
+MATCHER_P2(LayerSetVisibilityCommandEq, id, visibility, "%(*)s"){
+ return ((LayerSetVisibilityCommand*)arg)->m_idtoSet == id
+ && ((LayerSetVisibilityCommand*)arg)->m_visibility == visibility;
}
TEST_F(DBUSCommunicatorTest, SetlayerVisibility) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeLayer,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeLayer,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerVisibility uint32:44 boolean:true")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeLayer,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeLayer,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetLayerVisibility uint32:44 boolean:true")).c_str());
}
+MATCHER_P2(SurfacegroupSetVisibilityCommandEq, id, visibility, "%(*)s"){
+ return ((SurfacegroupSetVisibilityCommand*)arg)->m_idtoSet == id
+ && ((SurfacegroupSetVisibilityCommand*)arg)->m_visibility == visibility;
+}
+
TEST_F(DBUSCommunicatorTest, SetSurfacegroupVisibility) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeSurfaceGroup,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeSurfaceGroup,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:44 boolean:true")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeSurfaceGroup,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeSurfaceGroup,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetSurfacegroupVisibility uint32:44 boolean:true")).c_str());
}
+MATCHER_P2(LayergroupSetVisibilityCommandEq, id, visibility, "%(*)s"){
+ return ((LayergroupSetVisibilityCommand*)arg)->m_idtoSet == id
+ && ((LayergroupSetVisibilityCommand*)arg)->m_visibility == visibility;
+}
+
TEST_F(DBUSCommunicatorTest, SetlayergroupVisibility) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeLayerGroup,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeLayerGroup,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:44 boolean:true")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(36u,TypeLayerGroup,false))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(36u,false))).Times(1);
system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:36 boolean:false")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetVisibilityCommandEq(44u,TypeLayerGroup,true))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupSetVisibilityCommandEq(44u,true))).Times(1);
system((DBUSCOMMAND + std::string("SetLayergroupVisibility uint32:44 boolean:true")).c_str());
}
-MATCHER_P2(SurfacegroupAddSurfaceCommandEq, surfaceid, surfacegroupid, "%(*)s") {
+MATCHER_P2(SurfacegroupAddSurfaceCommandEq, surfaceid, surfacegroupid, "%(*)s"){
return ((SurfacegroupAddSurfaceCommand*)arg)->m_surfacegroupid == surfacegroupid
&& ((SurfacegroupAddSurfaceCommand*)arg)->m_surfaceid == surfaceid;
- }
+}
TEST_F(DBUSCommunicatorTest, AddSurfaceToSurfaceGroup) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SurfacegroupAddSurfaceCommandEq(36u,77u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute( SurfacegroupAddSurfaceCommandEq(36u,77u))).Times(1);
system((DBUSCOMMAND + std::string("AddSurfaceToSurfaceGroup uint32:36 uint32:77")).c_str());
}
-MATCHER_P2(SurfacegroupRemoveSurfaceCommandEq, surfacegroupid, surfaceid, "%(*)s") {
+MATCHER_P2(SurfacegroupRemoveSurfaceCommandEq, surfacegroupid, surfaceid, "%(*)s"){
return ((SurfacegroupRemoveSurfaceCommand*)arg)->m_surfacegroupid == surfacegroupid
&& ((SurfacegroupRemoveSurfaceCommand*)arg)->m_surfaceid == surfaceid;
- }
+}
+
TEST_F(DBUSCommunicatorTest, RemoveSurfaceFromSurfaceGroup) {
EXPECT_CALL(this->mockCommandExecutor, execute( SurfacegroupAddSurfaceCommandEq(36u,77u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveSurfaceFromSurfaceGroup uint32:36 uint32:77")).c_str());
-
}
-MATCHER_P2(LayergroupAddLayerCommandEq, layerid,layergroupid, "%(*)s") {
+MATCHER_P2(LayergroupAddLayerCommandEq, layerid, layergroupid, "%(*)s"){
return ((LayergroupAddLayerCommand*)arg)->m_layergroupid == layergroupid
&& ((LayergroupAddLayerCommand*)arg)->m_layerid == layerid;
+}
- }
TEST_F(DBUSCommunicatorTest, AddlayerTolayerGroup) {
- EXPECT_CALL(this->mockCommandExecutor, execute( LayergroupAddLayerCommandEq(36u,77u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute( LayergroupAddLayerCommandEq(36u,77u))).Times(1);
system((DBUSCOMMAND + std::string("AddLayerToLayerGroup uint32:36 uint32:77")).c_str());
-
}
-MATCHER_P2(LayergroupRemoveLayerCommandEq, layerid,layergroupid, "%(*)s") {
+MATCHER_P2(LayergroupRemoveLayerCommandEq, layerid,layergroupid, "%(*)s"){
return ((LayergroupRemoveLayerCommand*)arg)->m_layergroupid == layergroupid
&& ((LayergroupRemoveLayerCommand*)arg)->m_layerid == layerid;
+}
- }
TEST_F(DBUSCommunicatorTest, RemovelayerFromlayerGroup) {
EXPECT_CALL(this->mockCommandExecutor, execute( LayergroupRemoveLayerCommandEq(36u,77u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveLayerFromLayerGroup uint32:36 uint32:77")).c_str());
}
-MATCHER_P2(LayerAddSurfaceCommandEq, surfaceid,layerid, "%(*)s") {
+MATCHER_P2(LayerAddSurfaceCommandEq, surfaceid, layerid, "%(*)s"){
return ((LayerAddSurfaceCommand*)arg)->m_layerid == layerid
&& ((LayerAddSurfaceCommand*)arg)->m_surfaceid == surfaceid;
+}
- }
TEST_F(DBUSCommunicatorTest, AddSurfaceTolayer) {
EXPECT_CALL(this->mockCommandExecutor, execute( LayerAddSurfaceCommandEq(36u,77u))).Times(1);
system((DBUSCOMMAND + std::string("AddSurfaceToLayer uint32:36 uint32:77")).c_str());
}
-MATCHER_P2(LayerRemoveSurfaceCommandEq, surfaceid,layerid, "%(*)s") {
+MATCHER_P2(LayerRemoveSurfaceCommandEq, surfaceid, layerid, "%(*)s"){
return ((LayerRemoveSurfaceCommand*)arg)->m_layerid == layerid
&& ((LayerRemoveSurfaceCommand*)arg)->m_surfaceid == surfaceid;
+}
- }
TEST_F(DBUSCommunicatorTest, RemoveSurfaceFromlayer) {
+
EXPECT_CALL(this->mockCommandExecutor, execute( LayerRemoveSurfaceCommandEq(36u,77u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveSurfaceFromLayer uint32:36 uint32:77")).c_str());
}
+/*
TEST_F(DBUSCommunicatorTest, CreateSurfaceGroup) {
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeSurfaceGroup,PIXELFORMAT_R8))).Times(1);
+
+ EXPECT_CALL(this->mockCommandExecutor, execute()).Times(1);
system((DBUSCOMMAND + std::string("CreateSurfaceGroup")).c_str());
EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeSurfaceGroup,PIXELFORMAT_R8))).Times(1);
system((DBUSCOMMAND + std::string("CreateSurfaceGroup")).c_str());
}
+*/
+
+MATCHER_P(SurfacegroupRemoveCommandEq, idToRemove, "%(*)s") {
+ return ((SurfacegroupRemoveCommand*)arg)->m_idToRemove == idToRemove;
+}
TEST_F(DBUSCommunicatorTest, RemoveSurfaceGroup) {
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(8554u,TypeSurfaceGroup))).Times(1);
+
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupRemoveCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveSurfaceGroup uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(34589u,TypeSurfaceGroup))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfacegroupRemoveCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveSurfaceGroup uint32:34589")).c_str());
}
+/*
TEST_F(DBUSCommunicatorTest, CreatelayerGroup) {
+
EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeLayerGroup,PIXELFORMAT_R8))).Times(1);
system((DBUSCOMMAND + std::string("CreateLayerGroup")).c_str());
EXPECT_CALL(this->mockCommandExecutor, execute( CreateCommandEq(0u,0u,0u,TypeLayerGroup,PIXELFORMAT_R8))).Times(1);
system((DBUSCOMMAND + std::string("CreateLayerGroup")).c_str());
}
+*/
+
+MATCHER_P(LayergroupRemoveCommandEq, idToRemove, "%(*)s") {
+ return ((LayergroupRemoveCommand*)arg)->m_idToRemove == idToRemove;
+}
TEST_F(DBUSCommunicatorTest, RemovelayerGroup) {
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(8554u,TypeLayerGroup))).Times(1);
+
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupRemoveCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveLayerGroup uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( RemoveCommandEq(34589u,TypeLayerGroup))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayergroupRemoveCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("RemoveLayerGroup uint32:34589")).c_str());
}
-MATCHER_P2(GetDimensionCommandEq, id, type, "%(*)s") {
- return ((GetDimensionCommand*)arg)->m_id == id
- && ((GetDimensionCommand*)arg)->m_type == type;
- }
+MATCHER_P(LayerGetDimensionCommandEq, id, "%(*)s") {
+ return ((LayerGetDimensionCommand*)arg)->m_id == id;
+}
+
TEST_F(DBUSCommunicatorTest, GetlayerDimension) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetDimensionCommandEq(8554u,TypeLayer))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerGetDimensionCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerDimension uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetDimensionCommandEq(34589u,TypeLayer))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerGetDimensionCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerDimension uint32:34589")).c_str());
-
}
+MATCHER_P(SurfaceGetDimensionCommandEq, id, "%(*)s") {
+ return ((SurfaceGetDimensionCommand*)arg)->m_id == id;
+}
TEST_F(DBUSCommunicatorTest, GetSurfaceDimension) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetDimensionCommandEq(8554u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetDimensionCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfaceDimension uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetDimensionCommandEq(34589u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetDimensionCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfaceDimension uint32:34589")).c_str());
}
-MATCHER_P2(GetPixelformatCommandEq, id, type, "%(*)s") {
- return ((GetPixelformatCommand*)arg)->m_id == id
- && ((GetPixelformatCommand*)arg)->m_type == type;
- }
+MATCHER_P(SurfaceGetPixelformatCommandEq, id, "%(*)s"){
+ return ((SurfaceGetPixelformatCommand*)arg)->m_id == id;
+}
+
TEST_F(DBUSCommunicatorTest, GetSurfacePixelformat) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetPixelformatCommandEq(8554u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetPixelformatCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfacePixelformat uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetPixelformatCommandEq(34589u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetPixelformatCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfacePixelformat uint32:34589")).c_str());
}
+MATCHER_P(SurfaceGetOpacityCommandEq, id, "%(*)s"){
+ return ((SurfaceGetOpacityCommand*)arg)->m_id == id;
+}
+
TEST_F(DBUSCommunicatorTest, GetSurfaceOpacity) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetOpacityCommandEq(8554u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetOpacityCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfaceOpacity uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetOpacityCommandEq(34589u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetOpacityCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfaceOpacity uint32:34589")).c_str());
}
+MATCHER_P(SurfaceGetVisibilityCommandEq, id, "%(*)s") {
+ return ((SurfaceGetVisibilityCommand*)arg)->m_id == id;
+}
+
TEST_F(DBUSCommunicatorTest, GetSurfaceVisibility) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetOpacityCommandEq(8554u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetVisibilityCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfaceVisibility uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetOpacityCommandEq(34589u,TypeSurface))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceGetVisibilityCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("GetSurfaceVisibility uint32:34589")).c_str());
}
-MATCHER_P2(GetVisibilityCommandEq, id,type, "%(*)s") {
- return ((GetVisibilityCommand*)arg)->m_id == id
- && ((GetVisibilityCommand*)arg)->m_type == type;
+MATCHER_P(LayerGetVisibilityCommandEq, id, "%(*)s"){
+ return ((LayerGetVisibilityCommand*)arg)->m_id == id;
+}
- }
TEST_F(DBUSCommunicatorTest, GetlayerVisibility) {
- EXPECT_CALL(this->mockCommandExecutor, execute( GetVisibilityCommandEq(8554u,TypeLayer))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerGetVisibilityCommandEq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerVisibility uint32:8554")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( GetVisibilityCommandEq(34589u,TypeLayer))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(LayerGetVisibilityCommandEq(34589u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerVisibility uint32:34589")).c_str());
}
-//MATCHER_P2(RenderOrderTester,commandtype,list, "") {
-// LOG_ERROR("in tester",0);
-// commandtype_type command = (commandtype_type)arg;
-// testing::internal::ElementsAreArrayMatcher<int> matcher = ElementsAreArray(command->array,3);
-// std::vector<uint> l;
-// testing::Matcher<std::vector<uint, std::allocator<uint> > > matcher2 = matcher.operator Matcher<std::vector<uint> >();
-// bool result = matcher2.Matches(list);
-// return result;
-//
-//}
-//
-//TEST_F(DBUSCommunicatorTest, SetRenderOrderOflayers) {
-//
-//// DBUSClient* client = dbus_helper();
-//// if (NULL== client)
-//// LOG_ERROR("TEST", "client is null");
-////
-//// std::vector<uint> expected;
-//// expected.push_back(4);
-//// expected.push_back(47);
-//// expected.push_back(49);
-//// SetLayerOrderCommand * p;
-//// EXPECT_CALL(this->mockCommandExecutor,execute(RenderOrderTester(p,expected))).Times(1);
-//// uint display = 0;
-//// client->SetRenderOrderOfLayers(expected,display);
-//
-//}
-//
-//TEST_F(DBUSCommunicatorTest, SetRenderOrderWithinlayer) {
-//// DBUSClient* client = dbus_helper();
-////
-//// std::vector<uint> expected;
-//// expected.push_back(4);
-//// expected.push_back(47);
-//// expected.push_back(49);
-//// SetOrderWithinLayerCommand * p;
-//// EXPECT_CALL(this->mockCommandExecutor,execute(AllOf(
-//// RenderOrderTester(p,expected),
-//// FieldCast(&SetOrderWithinLayerCommand::layerid,55))
-//// )).Times(1);
-//// client->SetSurfaceRenderOrderWithinLayer(55,expected);
+/*
+MATCHER_P2(RenderOrderTester,commandtype,list, "") {
+ LOG_ERROR("in tester",0);
+ commandtype_type command = (commandtype_type)arg;
+ testing::internal::ElementsAreArrayMatcher<int> matcher = ElementsAreArray(command->array,3);
+ std::vector<uint> l;
+ testing::Matcher<std::vector<uint, std::allocator<uint> > > matcher2 = matcher.operator Matcher<std::vector<uint> >();
+ bool result = matcher2.Matches(list);
+ return result;
+}
+
+TEST_F(DBUSCommunicatorTest, SetRenderOrderOflayers) {
+
+// DBUSClient* client = dbus_helper();
+// if (NULL== client)
+// LOG_ERROR("TEST", "client is null");
//
+// std::vector<uint> expected;
+// expected.push_back(4);
+// expected.push_back(47);
+// expected.push_back(49);
+// SetLayerOrderCommand * p;
+// EXPECT_CALL(this->mockCommandExecutor,execute(RenderOrderTester(p,expected))).Times(1);
+// uint display = 0;
+// client->SetRenderOrderOfLayers(expected,display);
+
+}
+
+TEST_F(DBUSCommunicatorTest, SetRenderOrderWithinlayer) {
+// DBUSClient* client = dbus_helper();
//
-//}
+// std::vector<uint> expected;
+// expected.push_back(4);
+// expected.push_back(47);
+// expected.push_back(49);
+// SetOrderWithinLayerCommand * p;
+// EXPECT_CALL(this->mockCommandExecutor,execute(AllOf(
+// RenderOrderTester(p,expected),
+// FieldCast(&SetOrderWithinLayerCommand::layerid,55))
+// )).Times(1);
+// client->SetSurfaceRenderOrderWithinLayer(55,expected);
+}
+*/
TEST_F(DBUSCommunicatorTest, GetlayerType) {
- DefaultValue<Scene*>::Set((Scene*)&layerlist);
+ DefaultValue<Scene*>::Set((Scene*) &layerlist);
EXPECT_CALL(this->layerlist, getLayer(Eq(8554u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerType uint32:8554")).c_str());
}
TEST_F(DBUSCommunicatorTest, GetlayertypeCapabilities) {
- EXPECT_CALL(this->mockCommandExecutor, getLayerTypeCapabilities(Eq(367))).Times(1);
- system((DBUSCOMMAND + std::string("GetLayertypeCapabilities uint32:367")).c_str());
+ EXPECT_CALL(this->mockCommandExecutor, getLayerTypeCapabilities(Eq(367))).Times(1);
+ system((DBUSCOMMAND + std::string("GetLayertypeCapabilities uint32:367")).c_str());
}
TEST_F(DBUSCommunicatorTest, GetlayerCapabilities) {
Scene scene;
- DefaultValue<Scene*>::Set((Scene*)&layerlist);
+ DefaultValue<Scene*>::Set((Scene*) &layerlist);
EXPECT_CALL(this->layerlist, getLayer(Eq(367u))).Times(1);
system((DBUSCOMMAND + std::string("GetLayerCapabilities uint32:367")).c_str());
}
-MATCHER_P2(CreateShaderCommandEq, _vertName,_fragName, "%(*)s") {
- return ((CreateShaderCommand*)arg)->getVertName() == _vertName
- && ((CreateShaderCommand*)arg)->getFragName() == _fragName;
-
- }
+MATCHER_P2(ShaderCreateCommandEq, _vertName,_fragName, "%(*)s") {
+ return ((ShaderCreateCommand*)arg)->getVertName() == _vertName
+ && ((ShaderCreateCommand*)arg)->getFragName() == _fragName;
+}
TEST_F(DBUSCommunicatorTest, CreateShader) {
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateShaderCommandEq(std::string("test123.glslv"),std::string("differentshader.glslv")))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(ShaderCreateCommandEq(std::string("test123.glslv"),std::string("differentshader.glslv")))).Times(1);
system((DBUSCOMMAND + std::string("CreateShader string:test123.glslv string:differentshader.glslv")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( CreateShaderCommandEq(std::string("/usr/lib/shadertest.glslv"),std::string("foobar")))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(ShaderCreateCommandEq(std::string("/usr/lib/shadertest.glslv"),std::string("foobar")))).Times(1);
system((DBUSCOMMAND + std::string("CreateShader string:/usr/lib/shadertest.glslv string:foobar")).c_str());
}
-MATCHER_P(DestroyShaderCommandEq, id, "%(*)s") {
- return ((DestroyShaderCommand*)arg)->getShaderID() == id;
+MATCHER_P(ShaderDestroyCommandEq, id, "%(*)s") {
+ return ((ShaderDestroyCommand*)arg)->getShaderID() == id;
+}
- }
TEST_F(DBUSCommunicatorTest, DestroyShaderCommand) {
- EXPECT_CALL(this->mockCommandExecutor, execute( DestroyShaderCommandEq(567u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(ShaderDestroyCommandEq(567u))).Times(1);
system((DBUSCOMMAND + std::string("DestroyShader uint32:567")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( DestroyShaderCommandEq(185u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(ShaderDestroyCommandEq(185u))).Times(1);
system((DBUSCOMMAND + std::string("DestroyShader uint32:185")).c_str());
}
-MATCHER_P2(SetShaderCommandEq, id,shaderid, "%(*)s") {
- return ((SetShaderCommand*)arg)->getID() == id
- && ((SetShaderCommand*)arg)->getShaderID() == shaderid;
+MATCHER_P2(SurfaceSetShaderCommandEq, id, shaderid, "%(*)s") {
+ return ((SurfaceSetShaderCommand*)arg)->getID() == id
+ && ((SurfaceSetShaderCommand*)arg)->getShaderID() == shaderid;
+}
- }
TEST_F(DBUSCommunicatorTest, SetShaderCommand) {
- EXPECT_CALL(this->mockCommandExecutor, execute( SetShaderCommandEq(987u, 567u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetShaderCommandEq(987u, 567u))).Times(1);
system((DBUSCOMMAND + std::string("SetShader uint32:987 uint32:567")).c_str());
- EXPECT_CALL(this->mockCommandExecutor, execute( SetShaderCommandEq(1u, 998877u))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(SurfaceSetShaderCommandEq(1u, 998877u))).Times(1);
system((DBUSCOMMAND + std::string("SetShader uint32:1 uint32:998877")).c_str());
}
-MATCHER_P(UniformsMatcher,expectedlist,"") {
- SetUniformsCommand* command = (SetUniformsCommand*)arg;
+MATCHER_P(ShaderUniformsMatcher,expectedlist,"") {
+ ShaderSetUniformsCommand* command = (ShaderSetUniformsCommand*)arg;
std::vector<std::string> uniforms = command->getUniforms();
EXPECT_THAT(uniforms,ElementsAreArray(*expectedlist));
return true;
}
-MATCHER_P(SetUniformsCommandEq, _shaderid, "%(*)s") {
- return ((SetUniformsCommand*)arg)->getShaderId() == _shaderid;
-
- }
+MATCHER_P(ShaderSetUniformsCommandEq, _shaderid, "%(*)s"){
+ return ((ShaderSetUniformsCommand*)arg)->getShaderId() == _shaderid;
+}
-TEST_F(DBUSCommunicatorTest, SetUniformsCommand) {
+TEST_F(DBUSCommunicatorTest, ShaderSetUniformsCommand) {
- std::string expected1[] = { "uRotAngle 1f 1 0","uRotVector 3f 1 1 0 0" };
- EXPECT_CALL(this->mockCommandExecutor, execute( AllOf( SetUniformsCommandEq(1u),
- UniformsMatcher(&expected1)
- ))).Times(1);
+ std::string expected1[] = { "uRotAngle 1f 1 0", "uRotVector 3f 1 1 0 0" };
+ EXPECT_CALL(this->mockCommandExecutor, execute( AllOf(ShaderSetUniformsCommandEq(1u), ShaderUniformsMatcher(&expected1)))).Times(1);
system((DBUSCOMMAND + std::string("SetUniforms uint32:1 array:string:\"uRotAngle 1f 1 0\",\"uRotVector 3f 1 1 0 0\"")).c_str());
std::string expected2[] = { "teststring foobar" };
- EXPECT_CALL(this->mockCommandExecutor, execute( AllOf( SetUniformsCommandEq(17346u),
- UniformsMatcher(&expected2)
- ))).Times(1);
+ EXPECT_CALL(this->mockCommandExecutor, execute(AllOf(ShaderSetUniformsCommandEq(17346u), ShaderUniformsMatcher(&expected2)))).Times(1);
system((DBUSCOMMAND + std::string("SetUniforms uint32:17346 array:string:\"teststring foobar\"")).c_str());
}