From a1b594c0c79c48e47d56dfd5e9e98cb7b30909fa Mon Sep 17 00:00:00 2001 From: Timo Lotterbach Date: Thu, 1 Dec 2011 09:54:36 +0100 Subject: [PATCH] updated DBUSCommunicator unit tests to reflect Command refactoring. --- LayerManagerCommands/include/LayerCreateCommand.h | 2 +- .../include/LayerGetDimensionCommand.h | 2 +- .../include/LayerGetOpacityCommand.h | 2 +- .../include/LayerGetVisibilityCommand.h | 2 +- LayerManagerCommands/include/LayerRemoveCommand.h | 2 +- .../include/LayerSetDestinationRectangleCommand.h | 2 +- .../include/LayerSetDimensionCommand.h | 4 +- .../include/LayerSetOpacityCommand.h | 2 +- .../include/LayerSetOrientationCommand.h | 2 +- .../include/LayerSetPositionCommand.h | 2 +- .../include/LayerSetSourceRectangleCommand.h | 2 +- .../include/LayerSetVisibilityCommand.h | 2 +- .../include/LayergroupCreateCommand.h | 3 - .../include/LayergroupGetOpacityCommand.h | 2 +- .../include/LayergroupGetVisibilityCommand.h | 2 +- .../include/LayergroupRemoveCommand.h | 2 +- .../include/LayergroupSetOpacityCommand.h | 2 +- .../include/LayergroupSetVisibilityCommand.h | 2 +- .../include/SurfaceCreateCommand.h | 2 +- .../include/SurfaceGetDimensionCommand.h | 2 +- .../include/SurfaceGetOpacityCommand.h | 2 +- .../include/SurfaceGetPixelformatCommand.h | 2 +- .../include/SurfaceGetVisibilityCommand.h | 2 +- .../include/SurfaceRemoveCommand.h | 2 +- .../SurfaceSetDestinationRectangleCommand.h | 2 +- .../include/SurfaceSetDimensionCommand.h | 2 +- .../include/SurfaceSetOpacityCommand.h | 2 +- .../include/SurfaceSetOrientationCommand.h | 2 +- .../include/SurfaceSetPositionCommand.h | 2 +- .../include/SurfaceSetSourceRectangleCommand.h | 2 +- .../include/SurfaceSetVisibilityCommand.h | 3 +- .../include/SurfacegroupCreateCommand.h | 3 - .../include/SurfacegroupGetOpacityCommand.h | 2 +- .../include/SurfacegroupGetVisibilityCommand.h | 2 +- .../include/SurfacegroupRemoveCommand.h | 2 +- .../include/SurfacegroupSetOpacityCommand.h | 2 +- .../include/SurfacegroupSetVisibilityCommand.h | 2 +- .../Communicators/DBUSCommunicator/CMakeLists.txt | 8 +- .../DBUSCommunicator/test/CMakeLists.txt | 2 +- .../DBUSCommunicator/test/DBUSCommunicatorTest.cpp | 765 +++++++++++---------- LayerManagerService/CMakeLists.txt | 3 +- LayerManagerService/include/GraphicalObject.h | 2 + LayerManagerService/include/GraphicalSurface.h | 2 + LayerManagerService/include/Layer.h | 2 + LayerManagerService/include/Scene.h | 2 +- 45 files changed, 458 insertions(+), 407 deletions(-) diff --git a/LayerManagerCommands/include/LayerCreateCommand.h b/LayerManagerCommands/include/LayerCreateCommand.h index c056fde..92bf9ee 100644 --- a/LayerManagerCommands/include/LayerCreateCommand.h +++ b/LayerManagerCommands/include/LayerCreateCommand.h @@ -36,7 +36,7 @@ private: uint* m_idReturn; // for unit testing - //template friend class CreateCommandEqMatcherP5; + template friend class LayerCreateCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/LayerGetDimensionCommand.h b/LayerManagerCommands/include/LayerGetDimensionCommand.h index c2268d2..133659e 100644 --- a/LayerManagerCommands/include/LayerGetDimensionCommand.h +++ b/LayerManagerCommands/include/LayerGetDimensionCommand.h @@ -36,7 +36,7 @@ private: unsigned int* m_pHeight; // for unit testing - //template friend class GetDimensionCommandEqMatcherP2; + template friend class LayerGetDimensionCommandEqMatcherP; }; #endif /* _LAYERGETDIMENSIONCOMMAND_H_ */ diff --git a/LayerManagerCommands/include/LayerGetOpacityCommand.h b/LayerManagerCommands/include/LayerGetOpacityCommand.h index f560793..db6366c 100644 --- a/LayerManagerCommands/include/LayerGetOpacityCommand.h +++ b/LayerManagerCommands/include/LayerGetOpacityCommand.h @@ -36,7 +36,7 @@ private: double* m_pReturnOpacity; // for unit testing - //template friend class GetOpacityCommandEqMatcherP2; + template friend class LayerGetOpacityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/LayerGetVisibilityCommand.h b/LayerManagerCommands/include/LayerGetVisibilityCommand.h index a523644..1d5d1db 100644 --- a/LayerManagerCommands/include/LayerGetVisibilityCommand.h +++ b/LayerManagerCommands/include/LayerGetVisibilityCommand.h @@ -35,7 +35,7 @@ private: bool* m_pVisibility; // for unit testing - //template friend class GetVisibilityCommandEqMatcherP2; + template friend class LayerGetVisibilityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/LayerRemoveCommand.h b/LayerManagerCommands/include/LayerRemoveCommand.h index e94638a..7bd0b04 100644 --- a/LayerManagerCommands/include/LayerRemoveCommand.h +++ b/LayerManagerCommands/include/LayerRemoveCommand.h @@ -34,7 +34,7 @@ private: const unsigned int m_idToRemove; // for unit testing - //template friend class RemoveCommandEqMatcherP2; + template friend class LayerRemoveCommandEqMatcherP; }; #endif /* _LAYERREMOVECOMMAND_H_ */ diff --git a/LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h b/LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h index 83df6f4..c4e00ec 100644 --- a/LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h +++ b/LayerManagerCommands/include/LayerSetDestinationRectangleCommand.h @@ -38,7 +38,7 @@ private: const unsigned int m_height; // for unit testing - //template friend class SetDestinationRectangleCommandEqMatcherP6; + template friend class LayerSetDestinationRectangleCommandEqMatcherP5; }; diff --git a/LayerManagerCommands/include/LayerSetDimensionCommand.h b/LayerManagerCommands/include/LayerSetDimensionCommand.h index 29db225..1a17ebe 100644 --- a/LayerManagerCommands/include/LayerSetDimensionCommand.h +++ b/LayerManagerCommands/include/LayerSetDimensionCommand.h @@ -25,7 +25,7 @@ class LayerSetDimensionCommand : public BaseCommandAsynchronous { public: - LayerSetDimensionCommand(int id, unsigned int width,unsigned int height); + LayerSetDimensionCommand(int id, unsigned int width, unsigned int height); virtual ExecutionResult execute(ICommandExecutor* executor); virtual const std::string getString(); @@ -36,7 +36,7 @@ private: const unsigned int m_height; // for unit testing - //template friend class SetDimensionCommandEqMatcherP4; + template friend class LayerSetDimensionCommandEqMatcherP3; }; diff --git a/LayerManagerCommands/include/LayerSetOpacityCommand.h b/LayerManagerCommands/include/LayerSetOpacityCommand.h index bc1fc3a..ba24af0 100644 --- a/LayerManagerCommands/include/LayerSetOpacityCommand.h +++ b/LayerManagerCommands/include/LayerSetOpacityCommand.h @@ -35,7 +35,7 @@ private: const double m_opacity; // for unit testing - //template friend class SetOpacityCommandEqMatcherP3; + template friend class LayerSetOpacityCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/LayerSetOrientationCommand.h b/LayerManagerCommands/include/LayerSetOrientationCommand.h index a53febe..f9cfb15 100644 --- a/LayerManagerCommands/include/LayerSetOrientationCommand.h +++ b/LayerManagerCommands/include/LayerSetOrientationCommand.h @@ -36,7 +36,7 @@ private: const OrientationType m_orientation; // for unit testing - //template friend class SetOrientationCommandEqMatcherP3; + template friend class LayerSetOrientationCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/LayerSetPositionCommand.h b/LayerManagerCommands/include/LayerSetPositionCommand.h index cfdfee5..8b4a690 100644 --- a/LayerManagerCommands/include/LayerSetPositionCommand.h +++ b/LayerManagerCommands/include/LayerSetPositionCommand.h @@ -36,7 +36,7 @@ private: const unsigned int m_y; // for unit testing - //template friend class SetPositionCommandEqMatcherP4; + template friend class LayerSetPositionCommandEqMatcherP3; }; diff --git a/LayerManagerCommands/include/LayerSetSourceRectangleCommand.h b/LayerManagerCommands/include/LayerSetSourceRectangleCommand.h index bcdf84a..85b9209 100644 --- a/LayerManagerCommands/include/LayerSetSourceRectangleCommand.h +++ b/LayerManagerCommands/include/LayerSetSourceRectangleCommand.h @@ -38,7 +38,7 @@ private: const unsigned int m_height; // for unit testing - //template friend class SetSourceRectangleCommandEqMatcherP6; + template friend class LayerSetSourceRectangleCommandEqMatcherP5; }; diff --git a/LayerManagerCommands/include/LayerSetVisibilityCommand.h b/LayerManagerCommands/include/LayerSetVisibilityCommand.h index 2ccc3db..a3d890e 100644 --- a/LayerManagerCommands/include/LayerSetVisibilityCommand.h +++ b/LayerManagerCommands/include/LayerSetVisibilityCommand.h @@ -35,7 +35,7 @@ private: const bool m_visibility; // for unit testing - //template friend class SetVisibilityCommandEqMatcherP3; + template friend class LayerSetVisibilityCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/LayergroupCreateCommand.h b/LayerManagerCommands/include/LayergroupCreateCommand.h index aeb0eb2..cecd9a9 100644 --- a/LayerManagerCommands/include/LayergroupCreateCommand.h +++ b/LayerManagerCommands/include/LayergroupCreateCommand.h @@ -32,9 +32,6 @@ public: private: uint* m_idReturn; - - // for unit testing - //template friend class CreateCommandEqMatcherP5; }; diff --git a/LayerManagerCommands/include/LayergroupGetOpacityCommand.h b/LayerManagerCommands/include/LayergroupGetOpacityCommand.h index 766a9ce..2c72f25 100644 --- a/LayerManagerCommands/include/LayergroupGetOpacityCommand.h +++ b/LayerManagerCommands/include/LayergroupGetOpacityCommand.h @@ -36,7 +36,7 @@ private: double* m_pReturnOpacity; // for unit testing - //template friend class GetOpacityCommandEqMatcherP2; + template friend class LayergroupGetOpacityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h b/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h index b7cad69..1fc25cb 100644 --- a/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h +++ b/LayerManagerCommands/include/LayergroupGetVisibilityCommand.h @@ -35,7 +35,7 @@ private: bool* m_pVisibility; // for unit testing - //template friend class GetVisibilityCommandEqMatcherP2; + template friend class LayergroupGetVisibilityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/LayergroupRemoveCommand.h b/LayerManagerCommands/include/LayergroupRemoveCommand.h index 1695896..ad3a8c4 100644 --- a/LayerManagerCommands/include/LayergroupRemoveCommand.h +++ b/LayerManagerCommands/include/LayergroupRemoveCommand.h @@ -34,7 +34,7 @@ private: const unsigned int m_idToRemove; // for unit testing - //template friend class RemoveCommandEqMatcherP2; + template friend class LayergroupRemoveCommandEqMatcherP; }; #endif /* _LAYERGROUPREMOVECOMMAND_H_ */ diff --git a/LayerManagerCommands/include/LayergroupSetOpacityCommand.h b/LayerManagerCommands/include/LayergroupSetOpacityCommand.h index 6ff0f76..e6914d4 100644 --- a/LayerManagerCommands/include/LayergroupSetOpacityCommand.h +++ b/LayerManagerCommands/include/LayergroupSetOpacityCommand.h @@ -35,7 +35,7 @@ private: const double m_opacity; // for unit testing - //template friend class SetOpacityCommandEqMatcherP3; + template friend class LayergroupSetOpacityCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h b/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h index 0fee0f5..95dd5e9 100644 --- a/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h +++ b/LayerManagerCommands/include/LayergroupSetVisibilityCommand.h @@ -35,7 +35,7 @@ private: const bool m_visibility; // for unit testing - //template friend class SetVisibilityCommandEqMatcherP3; + template friend class LayergroupSetVisibilityCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/SurfaceCreateCommand.h b/LayerManagerCommands/include/SurfaceCreateCommand.h index 05e5912..c92c140 100644 --- a/LayerManagerCommands/include/SurfaceCreateCommand.h +++ b/LayerManagerCommands/include/SurfaceCreateCommand.h @@ -39,7 +39,7 @@ private: uint* m_idReturn; // for unit testing - //template friend class CreateCommandEqMatcherP5; + template friend class SurfaceCreateCommandEqMatcherP4; }; diff --git a/LayerManagerCommands/include/SurfaceGetDimensionCommand.h b/LayerManagerCommands/include/SurfaceGetDimensionCommand.h index 99b8e04..c66ea06 100644 --- a/LayerManagerCommands/include/SurfaceGetDimensionCommand.h +++ b/LayerManagerCommands/include/SurfaceGetDimensionCommand.h @@ -36,7 +36,7 @@ private: unsigned int* m_pHeight; // for unit testing - //template friend class GetDimensionCommandEqMatcherP2; + template friend class SurfaceGetDimensionCommandEqMatcherP; }; #endif /* _SURFACEGETDIMENSIONCOMMAND_H_ */ diff --git a/LayerManagerCommands/include/SurfaceGetOpacityCommand.h b/LayerManagerCommands/include/SurfaceGetOpacityCommand.h index 9691609..4f23dfc 100644 --- a/LayerManagerCommands/include/SurfaceGetOpacityCommand.h +++ b/LayerManagerCommands/include/SurfaceGetOpacityCommand.h @@ -36,7 +36,7 @@ private: double* m_pReturnOpacity; // for unit testing - //template friend class GetOpacityCommandEqMatcherP2; + template friend class SurfaceGetOpacityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/SurfaceGetPixelformatCommand.h b/LayerManagerCommands/include/SurfaceGetPixelformatCommand.h index ca99536..4b616a8 100644 --- a/LayerManagerCommands/include/SurfaceGetPixelformatCommand.h +++ b/LayerManagerCommands/include/SurfaceGetPixelformatCommand.h @@ -36,7 +36,7 @@ private: PixelFormat* m_pFormatreturn; // for unit testing - //template friend class GetPixelformatCommandEqMatcherP2; + template friend class SurfaceGetPixelformatCommandEqMatcherP; }; #endif /* _SURFACEGETPIXELFORMATCOMMAND_H_ */ diff --git a/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h b/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h index 030bdf8..9c398d5 100644 --- a/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h +++ b/LayerManagerCommands/include/SurfaceGetVisibilityCommand.h @@ -35,7 +35,7 @@ private: bool* m_pVisibility; // for unit testing - //template friend class GetVisibilityCommandEqMatcherP2; + template friend class SurfaceGetVisibilityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/SurfaceRemoveCommand.h b/LayerManagerCommands/include/SurfaceRemoveCommand.h index 8a727d1..4a9afea 100644 --- a/LayerManagerCommands/include/SurfaceRemoveCommand.h +++ b/LayerManagerCommands/include/SurfaceRemoveCommand.h @@ -34,7 +34,7 @@ private: const unsigned int m_idToRemove; // for unit testing - //template friend class RemoveCommandEqMatcherP2; + template friend class SurfaceRemoveCommandEqMatcherP; }; #endif /* _SURFACEREMOVECOMMAND_H_ */ diff --git a/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h b/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h index eb6859e..557c913 100644 --- a/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h +++ b/LayerManagerCommands/include/SurfaceSetDestinationRectangleCommand.h @@ -38,7 +38,7 @@ private: const unsigned int m_height; // for unit testing - //template friend class SetDestinationRectangleCommandEqMatcherP6; + template friend class SurfaceSetDestinationRectangleCommandEqMatcherP5; }; diff --git a/LayerManagerCommands/include/SurfaceSetDimensionCommand.h b/LayerManagerCommands/include/SurfaceSetDimensionCommand.h index 7949fb3..c32d84f 100644 --- a/LayerManagerCommands/include/SurfaceSetDimensionCommand.h +++ b/LayerManagerCommands/include/SurfaceSetDimensionCommand.h @@ -36,7 +36,7 @@ private: const unsigned int m_height; // for unit testing - //template friend class SetDimensionCommandEqMatcherP4; + template friend class SurfaceSetDimensionCommandEqMatcherP3; }; diff --git a/LayerManagerCommands/include/SurfaceSetOpacityCommand.h b/LayerManagerCommands/include/SurfaceSetOpacityCommand.h index f6cd8ea..27ed7cc 100644 --- a/LayerManagerCommands/include/SurfaceSetOpacityCommand.h +++ b/LayerManagerCommands/include/SurfaceSetOpacityCommand.h @@ -35,7 +35,7 @@ private: const double m_opacity; // for unit testing - //template friend class SetOpacityCommandEqMatcherP3; + template friend class SurfaceSetOpacityCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/SurfaceSetOrientationCommand.h b/LayerManagerCommands/include/SurfaceSetOrientationCommand.h index 9e0a17b..f22a5f7 100644 --- a/LayerManagerCommands/include/SurfaceSetOrientationCommand.h +++ b/LayerManagerCommands/include/SurfaceSetOrientationCommand.h @@ -36,7 +36,7 @@ private: const OrientationType m_orientation; // for unit testing - //template friend class SetOrientationCommandEqMatcherP3; + template friend class SurfaceSetOrientationCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/SurfaceSetPositionCommand.h b/LayerManagerCommands/include/SurfaceSetPositionCommand.h index 30e7d76..71233a1 100644 --- a/LayerManagerCommands/include/SurfaceSetPositionCommand.h +++ b/LayerManagerCommands/include/SurfaceSetPositionCommand.h @@ -36,7 +36,7 @@ private: const unsigned int m_y; // for unit testing - //template friend class SetPositionCommandEqMatcherP4; + template friend class SurfaceSetPositionCommandEqMatcherP3; }; diff --git a/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h b/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h index b659eb6..353bdd7 100644 --- a/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h +++ b/LayerManagerCommands/include/SurfaceSetSourceRectangleCommand.h @@ -38,7 +38,7 @@ private: const unsigned int m_height; // for unit testing - //template friend class SetSourceRectangleCommandEqMatcherP6; + template friend class SurfaceSetSourceRectangleCommandEqMatcherP5; }; diff --git a/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h b/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h index 144d7c4..67dc69d 100644 --- a/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h +++ b/LayerManagerCommands/include/SurfaceSetVisibilityCommand.h @@ -35,8 +35,7 @@ private: const bool m_visibility; // for unit testing - //template friend class SetVisibilityCommandEqMatcherP3; + template friend class SurfaceSetVisibilityCommandEqMatcherP2; }; - #endif /* _SURFACESETVISIBILITYCOMMAND_H_ */ diff --git a/LayerManagerCommands/include/SurfacegroupCreateCommand.h b/LayerManagerCommands/include/SurfacegroupCreateCommand.h index b4dcda6..3bdc828 100644 --- a/LayerManagerCommands/include/SurfacegroupCreateCommand.h +++ b/LayerManagerCommands/include/SurfacegroupCreateCommand.h @@ -32,9 +32,6 @@ public: private: uint* m_idReturn; - - // for unit testing - //template friend class CreateCommandEqMatcherP5; }; diff --git a/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h b/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h index 300a85f..c02b2b9 100644 --- a/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h +++ b/LayerManagerCommands/include/SurfacegroupGetOpacityCommand.h @@ -36,7 +36,7 @@ private: double* m_pReturnOpacity; // for unit testing - //template friend class GetOpacityCommandEqMatcherP2; + template friend class SurfacegroupGetOpacityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h b/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h index 50d3f34..1763a2d 100644 --- a/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h +++ b/LayerManagerCommands/include/SurfacegroupGetVisibilityCommand.h @@ -35,7 +35,7 @@ private: bool* m_pVisibility; // for unit testing - //template friend class GetVisibilityCommandEqMatcherP2; + template friend class SurfacegroupGetVisibilityCommandEqMatcherP; }; diff --git a/LayerManagerCommands/include/SurfacegroupRemoveCommand.h b/LayerManagerCommands/include/SurfacegroupRemoveCommand.h index 16934fe..6889b07 100644 --- a/LayerManagerCommands/include/SurfacegroupRemoveCommand.h +++ b/LayerManagerCommands/include/SurfacegroupRemoveCommand.h @@ -34,7 +34,7 @@ private: const unsigned int m_idToRemove; // for unit testing - //template friend class RemoveCommandEqMatcherP2; + template friend class SurfacegroupRemoveCommandEqMatcherP; }; #endif /* _SURFACEGROUPREMOVECOMMAND_H_ */ diff --git a/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h b/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h index cc39ed7..e6d4324 100644 --- a/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h +++ b/LayerManagerCommands/include/SurfacegroupSetOpacityCommand.h @@ -35,7 +35,7 @@ private: const double m_opacity; // for unit testing - //template friend class SetOpacityCommandEqMatcherP3; + template friend class SurfacegroupSetOpacityCommandEqMatcherP2; }; diff --git a/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h b/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h index f3d2608..de06c2c 100644 --- a/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h +++ b/LayerManagerCommands/include/SurfacegroupSetVisibilityCommand.h @@ -35,7 +35,7 @@ private: const bool m_visibility; // for unit testing - //template friend class SetVisibilityCommandEqMatcherP3; + template friend class SurfacegroupSetVisibilityCommandEqMatcherP2; }; diff --git a/LayerManagerPlugins/Communicators/DBUSCommunicator/CMakeLists.txt b/LayerManagerPlugins/Communicators/DBUSCommunicator/CMakeLists.txt index 23f5550..74a40f2 100644 --- a/LayerManagerPlugins/Communicators/DBUSCommunicator/CMakeLists.txt +++ b/LayerManagerPlugins/Communicators/DBUSCommunicator/CMakeLists.txt @@ -49,8 +49,8 @@ install (FILES include/LayerManagerService.conf DESTINATION /etc/dbus-1/system.d install (FILES include/LayerManagerService.conf DESTINATION /etc/dbus-1/session.d) -#if (WITH_TESTS) -#enable_testing() -#add_subdirectory (test) -#endif(WITH_TESTS) +if (WITH_TESTS) +enable_testing() +add_subdirectory (test) +endif(WITH_TESTS) diff --git a/LayerManagerPlugins/Communicators/DBUSCommunicator/test/CMakeLists.txt b/LayerManagerPlugins/Communicators/DBUSCommunicator/test/CMakeLists.txt index 65c77e2..bc40185 100644 --- a/LayerManagerPlugins/Communicators/DBUSCommunicator/test/CMakeLists.txt +++ b/LayerManagerPlugins/Communicators/DBUSCommunicator/test/CMakeLists.txt @@ -35,7 +35,7 @@ set(LIBS ${LIBS} ${DBUS_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} LayerManagerUtils) file(GLOB LM_SOURCES "${PROJECT_SOURCE_DIR}/LayerManagerService/src/Scene.cpp" "${PROJECT_SOURCE_DIR}/LayerManagerService/src/Layermanager.cpp" - "${PROJECT_SOURCE_DIR}/LayerManagerService/src/LogicalGraphicsObject.cpp" + "${PROJECT_SOURCE_DIR}/LayerManagerService/src/GraphicalObject.cpp" "${PROJECT_SOURCE_DIR}/LayerManagerService/src/GraphicalSurface.cpp" "${PROJECT_SOURCE_DIR}/LayerManagerService/src/shader/*.cpp" "${PROJECT_SOURCE_DIR}/LayerManagerService/src/commands/*.cpp") diff --git a/LayerManagerPlugins/Communicators/DBUSCommunicator/test/DBUSCommunicatorTest.cpp b/LayerManagerPlugins/Communicators/DBUSCommunicator/test/DBUSCommunicatorTest.cpp index 90faa19..a3876be 100644 --- a/LayerManagerPlugins/Communicators/DBUSCommunicator/test/DBUSCommunicatorTest.cpp +++ b/LayerManagerPlugins/Communicators/DBUSCommunicator/test/DBUSCommunicatorTest.cpp @@ -1,21 +1,21 @@ /*************************************************************************** -* -* 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_ @@ -44,38 +44,36 @@ using ::testing::ElementsAreArray; 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; @@ -83,68 +81,64 @@ public: 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::Set((Scene*)&this->layerlist); - EXPECT_CALL(this->layerlist, getLayerIDs(NotNull(),NotNull() )).Times(1) ; - system((DBUSCOMMAND + std::string("ListAllLayerIDS")).c_str()); + DefaultValue::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 defaultlist; // Sets the default return value for type Bar. - DefaultValue::Set((Scene*)&this->layerlist); - DefaultValue< std::list >::Set(defaultlist); - EXPECT_CALL(this->layerlist, getLayerGroupIDs(NotNull(),NotNull()) ).Times(1) ; + DefaultValue::Set((Scene*) &this->layerlist); + DefaultValue >::Set(defaultlist); + EXPECT_CALL(this->layerlist, getLayerGroupIDs(NotNull(),NotNull()) ).Times(1); system((DBUSCOMMAND + std::string("ListAllLayerGroupIDS")).c_str()); } TEST_F(DBUSCommunicatorTest, listAllSurfaceGroupIDS) { std::list defaultlist; // Sets the default return value for type Bar. - DefaultValue::Set((Scene*)&this->layerlist); - DefaultValue< std::list >::Set(defaultlist); - EXPECT_CALL(this->layerlist, getSurfaceGroupIDs(NotNull(),NotNull() )).Times(1) ; + DefaultValue::Set((Scene*) &this->layerlist); + DefaultValue >::Set(defaultlist); + EXPECT_CALL(this->layerlist, getSurfaceGroupIDs(NotNull(),NotNull() )).Times(1); system((DBUSCOMMAND + std::string("ListAllSurfaceGroupIDS")).c_str()); } TEST_F(DBUSCommunicatorTest, listSurfacesOfSurfacegroup) { std::list defaultlist; - DefaultValue::Set((Scene*)&this->layerlist); + DefaultValue::Set((Scene*) &this->layerlist); // Sets the default return value for type Bar. - DefaultValue< std::list >::Set(defaultlist); - DefaultValue< SurfaceGroup* >::Set(new SurfaceGroup()); - EXPECT_CALL(this->layerlist, getSurfaceGroup(Eq(84567u) )).Times(1) ; + DefaultValue >::Set(defaultlist); + DefaultValue::Set(new SurfaceGroup()); + EXPECT_CALL(this->layerlist, getSurfaceGroup(Eq(84567u) )).Times(1); system((DBUSCOMMAND + std::string("ListSurfacesOfSurfacegroup uint32:84567")).c_str()); } @@ -153,11 +147,11 @@ TEST_F(DBUSCommunicatorTest, listlayersOflayergroup) { std::list defaultlist; // Sets the default return value for type Bar. - DefaultValue::Set((Scene*)&this->layerlist); - DefaultValue< std::list >::Set(defaultlist); - DefaultValue< LayerGroup* >::Set(new LayerGroup()); + DefaultValue::Set((Scene*) &this->layerlist); + DefaultValue >::Set(defaultlist); + DefaultValue::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()); } @@ -165,632 +159,694 @@ TEST_F(DBUSCommunicatorTest, listlayersOflayergroup) { TEST_F(DBUSCommunicatorTest, listSurfaceoflayer) { Scene scene; - DefaultValue< Layer* >::Set(scene.createLayer(234)); - DefaultValue::Set((Scene*)&layerlist); - EXPECT_CALL(this->layerlist, getLayer(Eq(234u) )).Times(1) ; + DefaultValue::Set(scene.createLayer(234)); + DefaultValue::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::Set((Scene*)&layerlist); - DefaultValue< Surface* >::Set(scene.createSurface(newID)); - EXPECT_CALL(this->layerlist, getSurface(Eq(876u) )).Times(1) ; + unsigned int newID = 0; + DefaultValue::Set((Scene*) &layerlist); + DefaultValue::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::Set((Scene*)&layerlist); - EXPECT_CALL(this->layerlist, getLayer(Eq(876u) )).Times(1) ; + DefaultValue::Set(scene.createLayer(0)); + DefaultValue::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::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 matcher = ElementsAreArray(command->array,3); -// std::vector l; -// testing::Matcher > > matcher2 = matcher.operator Matcher >(); -// 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 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 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 matcher = ElementsAreArray(command->array,3); + std::vector l; + testing::Matcher > > matcher2 = matcher.operator Matcher >(); + 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 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 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::Set((Scene*)&layerlist); + DefaultValue::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::Set((Scene*)&layerlist); + DefaultValue::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 uniforms = command->getUniforms(); EXPECT_THAT(uniforms,ElementsAreArray(*expectedlist)); @@ -798,23 +854,18 @@ MATCHER_P(UniformsMatcher,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()); } diff --git a/LayerManagerService/CMakeLists.txt b/LayerManagerService/CMakeLists.txt index 828e3c9..d0bf872 100644 --- a/LayerManagerService/CMakeLists.txt +++ b/LayerManagerService/CMakeLists.txt @@ -29,7 +29,8 @@ link_directories ("${PROJECT_SOURCE_DIR}/LayerManagerUtils/bin") link_directories ("${PROJECT_SOURCE_DIR}/LayerManagerCommands") # generate version header file, used in main.cpp -message("-- Generating Version.h header file") +message(STATUS "Generating Version.h header file:") +message(STATUS "-- version = ${ILM_VERSION}") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h diff --git a/LayerManagerService/include/GraphicalObject.h b/LayerManagerService/include/GraphicalObject.h index 1569b1a..2c722f1 100644 --- a/LayerManagerService/include/GraphicalObject.h +++ b/LayerManagerService/include/GraphicalObject.h @@ -35,6 +35,8 @@ public: GraphicalObject(int externalId,ObjectType type, double opacity, bool visibility); + virtual ~GraphicalObject() {} + /** * @brief Set alpha value * @param alpha The new Alpha Value between 0.0 (full transparency) and 1.0 (fully visible) diff --git a/LayerManagerService/include/GraphicalSurface.h b/LayerManagerService/include/GraphicalSurface.h index 879086f..3866593 100644 --- a/LayerManagerService/include/GraphicalSurface.h +++ b/LayerManagerService/include/GraphicalSurface.h @@ -35,6 +35,8 @@ public: GraphicalSurface(int externalId,ObjectType type); + virtual ~GraphicalSurface() {} + /** * Set Orientation value * @param orientation the new value. Multiples of 90 degrees. (0->0°, 1->90°, 2->180°,3->279°) diff --git a/LayerManagerService/include/Layer.h b/LayerManagerService/include/Layer.h index a19ac4c..6c2f5bd 100644 --- a/LayerManagerService/include/Layer.h +++ b/LayerManagerService/include/Layer.h @@ -38,6 +38,8 @@ public: Layer(); Layer(int id); + virtual ~Layer() {} + LayerType getLayerType() const; void setLayerType(LayerType lt); void setLayerCapabilities(unsigned int newCapabilities); diff --git a/LayerManagerService/include/Scene.h b/LayerManagerService/include/Scene.h index 39fdaac..f70bdc1 100644 --- a/LayerManagerService/include/Scene.h +++ b/LayerManagerService/include/Scene.h @@ -51,7 +51,7 @@ class Scene: public IScene public: Scene(); - ~Scene(); + virtual ~Scene(); virtual Layer* createLayer(const uint id); virtual Surface *createSurface(const uint id); -- 2.7.4