added unit test templates for LayerManagerService
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Wed, 7 Dec 2011 09:05:11 +0000 (10:05 +0100)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Wed, 7 Dec 2011 09:05:11 +0000 (10:05 +0100)
LayerManagerService/CMakeLists.txt
LayerManagerService/include/Surface.h
LayerManagerService/tests/GraphicalObjectTest.cpp [new file with mode: 0644]
LayerManagerService/tests/GraphicalSurfaceTest.cpp [new file with mode: 0644]
LayerManagerService/tests/LayermanagerTest.cpp [new file with mode: 0644]
LayerManagerService/tests/SceneTest.cpp
LayerManagerService/tests/ShaderTest.cpp [new file with mode: 0644]
LayerManagerService/tests/SurfaceTest.cpp [new file with mode: 0644]

index ab4f714..2063959 100644 (file)
@@ -62,6 +62,12 @@ enable_testing()
 
 add_executable(LayerManagerService_Test
     tests/SceneTest.cpp
+#    tests/LayermanagerTest.cpp
+#    tests/GraphicalObjectTest.cpp
+#    tests/GraphicalSurfaceTest.cpp
+#    tests/SurfaceTest.cpp
+#    tests/ShaderTest.cpp
+    
     src/GraphicalObject.cpp
     src/GraphicalSurface.cpp
     src/Layermanager.cpp
index b2c635c..92631b1 100644 (file)
@@ -85,7 +85,6 @@ public:
 
     int frameCounter;
 
-private:
     Surface()
     : GraphicalSurface(TypeSurface)
     , platform(NULL)
@@ -104,8 +103,8 @@ private:
     {
     }
 
-    friend class Scene;
 
+private:
     long m_nativeHandle;
     PixelFormat m_pixformat;
     unsigned int m_layerId;
diff --git a/LayerManagerService/tests/GraphicalObjectTest.cpp b/LayerManagerService/tests/GraphicalObjectTest.cpp
new file mode 100644 (file)
index 0000000..66e1136
--- /dev/null
@@ -0,0 +1,85 @@
+/***************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <gtest/gtest.h>
+
+#include "GraphicalObject.h"
+
+class GraphicalObjectTest : public ::testing::Test
+{
+public:
+    void SetUp()
+    {
+        m_pGraphicalObject = new GraphicalObject(TypeSurface, 1.0, true);
+        ASSERT_TRUE(m_pGraphicalObject);
+    }
+
+    void TearDown()
+    {
+        if (m_pGraphicalObject)
+        {
+            delete m_pGraphicalObject;
+            m_pGraphicalObject = 0;
+        }
+    }
+
+    GraphicalObject* m_pGraphicalObject;
+};
+
+TEST_F(GraphicalObjectTest, construction)
+{
+    //GraphicalObject(ObjectType type, double opacity, bool visibility);
+    //GraphicalObject(int externalId,ObjectType type, double opacity, bool visibility);
+    //virtual ~GraphicalObject() {}
+}
+
+TEST_F(GraphicalObjectTest, setOpacity)
+{
+
+}
+
+TEST_F(GraphicalObjectTest, getOpacity)
+{
+
+}
+
+TEST_F(GraphicalObjectTest, setVisibility)
+{
+
+}
+
+TEST_F(GraphicalObjectTest, getVisibility)
+{
+
+}
+
+TEST_F(GraphicalObjectTest, getID)
+{
+
+}
+
+TEST_F(GraphicalObjectTest, setShader)
+{
+
+}
+
+TEST_F(GraphicalObjectTest, getShader)
+{
+
+}
diff --git a/LayerManagerService/tests/GraphicalSurfaceTest.cpp b/LayerManagerService/tests/GraphicalSurfaceTest.cpp
new file mode 100644 (file)
index 0000000..b0b250f
--- /dev/null
@@ -0,0 +1,110 @@
+/***************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <gtest/gtest.h>
+
+#include "GraphicalSurface.h"
+
+class GraphicalSurfaceTest : public ::testing::Test
+{
+public:
+    void SetUp()
+    {
+        m_pGraphicalSurface = new GraphicalSurface(TypeSurface);
+        ASSERT_TRUE(m_pGraphicalSurface);
+    }
+
+    void TearDown()
+    {
+        if (m_pGraphicalSurface)
+        {
+            delete m_pGraphicalSurface;
+            m_pGraphicalSurface = 0;
+        }
+    }
+
+    GraphicalSurface* m_pGraphicalSurface;
+};
+
+TEST_F(GraphicalSurfaceTest, construction)
+{
+    //GraphicalSurface(ObjectType type);
+    //GraphicalSurface(int externalId,ObjectType type);
+    //virtual ~GraphicalSurface() {}
+}
+
+TEST_F(GraphicalSurfaceTest, setOrientation)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, getOrientation)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, setSourceRegion)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, getSourceRegion)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, setDestinationRegion)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, setPosition)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, getPosition)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, setDimension)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, getDestinationRegion)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, getDimension)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, isInside)
+{
+
+}
+
+TEST_F(GraphicalSurfaceTest, DestToSourceCoordinates)
+{
+
+}
diff --git a/LayerManagerService/tests/LayermanagerTest.cpp b/LayerManagerService/tests/LayermanagerTest.cpp
new file mode 100644 (file)
index 0000000..8fe52de
--- /dev/null
@@ -0,0 +1,128 @@
+/***************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <gtest/gtest.h>
+
+#include "Layermanager.h"
+
+class LayermanagerTest : public ::testing::Test
+{
+public:
+    void SetUp()
+    {
+        m_pLayermanager = new Layermanager();
+        ASSERT_TRUE(m_pLayermanager);
+    }
+
+    void TearDown()
+    {
+        if (m_pLayermanager)
+        {
+            delete m_pLayermanager;
+            m_pLayermanager = 0;
+        }
+    }
+
+    ICommandExecutor* m_pLayermanager;
+};
+
+TEST_F(LayermanagerTest, execute)
+{
+
+}
+
+TEST_F(LayermanagerTest, startManagement)
+{
+
+}
+
+TEST_F(LayermanagerTest, stopManagement)
+{
+
+}
+
+TEST_F(LayermanagerTest, getScene)
+{
+
+}
+
+TEST_F(LayermanagerTest, getRendererList)
+{
+
+}
+
+TEST_F(LayermanagerTest, addRenderer)
+{
+
+}
+
+TEST_F(LayermanagerTest, removeRenderer)
+{
+
+}
+
+TEST_F(LayermanagerTest, getCommunicatorList)
+{
+
+}
+
+TEST_F(LayermanagerTest, addCommunicator)
+{
+
+}
+
+TEST_F(LayermanagerTest, removeCommunicator)
+{
+
+}
+
+TEST_F(LayermanagerTest, getSceneProviderList)
+{
+
+}
+
+TEST_F(LayermanagerTest, addSceneProvider)
+{
+
+}
+
+TEST_F(LayermanagerTest, removeSceneProvider)
+{
+
+}
+
+TEST_F(LayermanagerTest, getLayerTypeCapabilities)
+{
+
+}
+
+TEST_F(LayermanagerTest, getNumberOfHardwareLayers)
+{
+
+}
+
+TEST_F(LayermanagerTest, getScreenResolution)
+{
+
+}
+
+TEST_F(LayermanagerTest, getScreenIDs)
+{
+
+}
index 2a2f9f5..7bcd8c5 100644 (file)
@@ -28,6 +28,7 @@ public:
     void SetUp()
     {
         m_pScene = new Scene();
+        ASSERT_TRUE(m_pScene);
     }
 
     void TearDown()
@@ -114,9 +115,6 @@ TEST_F(SceneTest, createSurfaceGroup)
 {
 }
 
-
-
-
 TEST_F(SceneTest, removeLayer)
 {
 }
diff --git a/LayerManagerService/tests/ShaderTest.cpp b/LayerManagerService/tests/ShaderTest.cpp
new file mode 100644 (file)
index 0000000..6d6f3fd
--- /dev/null
@@ -0,0 +1,77 @@
+/***************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <gtest/gtest.h>
+#include "Shader.h"
+#include <string>
+using std::string;
+
+class ShaderTest : public ::testing::Test
+{
+public:
+    void SetUp()
+    {
+        string vertShaderPath("");
+        string fragShaderPath("");
+        m_pShader = Shader::createShader(vertShaderPath, fragShaderPath);
+        ASSERT_TRUE(m_pShader);
+    }
+
+    void TearDown()
+    {
+        if (m_pShader)
+        {
+            delete m_pShader;
+            m_pShader = 0;
+        }
+    }
+
+    Shader* m_pShader;
+};
+
+TEST_F(ShaderTest, construction)
+{
+    //static Shader* createShader(const string& vertFileName, const string& fragFileName);
+    //~Shader();
+}
+
+TEST_F(ShaderTest, getId)
+{
+
+}
+
+TEST_F(ShaderTest, use)
+{
+
+}
+
+TEST_F(ShaderTest, setUniform)
+{
+
+}
+
+TEST_F(ShaderTest, loadUniforms)
+{
+
+}
+
+TEST_F(ShaderTest, loadCommonUniforms)
+{
+
+}
diff --git a/LayerManagerService/tests/SurfaceTest.cpp b/LayerManagerService/tests/SurfaceTest.cpp
new file mode 100644 (file)
index 0000000..c500f2d
--- /dev/null
@@ -0,0 +1,83 @@
+/***************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <gtest/gtest.h>
+
+#include "Surface.h"
+
+class SurfaceTest : public ::testing::Test
+{
+public:
+    void SetUp()
+    {
+        m_pSurface = new Surface();
+        ASSERT_TRUE(m_pSurface);
+    }
+
+    void TearDown()
+    {
+        if (m_pSurface)
+        {
+            delete m_pSurface;
+            m_pSurface = 0;
+        }
+    }
+
+    Surface* m_pSurface;
+};
+
+TEST_F(SurfaceTest, getPixelFormat)
+{
+
+}
+
+TEST_F(SurfaceTest, setPixelFormat)
+{
+
+}
+
+TEST_F(SurfaceTest, getContainingLayerId)
+{
+
+}
+
+TEST_F(SurfaceTest, setContainingLayerId)
+{
+
+}
+
+TEST_F(SurfaceTest, hasNativeContent)
+{
+
+}
+
+TEST_F(SurfaceTest, removeNativeContent)
+{
+
+}
+
+TEST_F(SurfaceTest, setNativeContent)
+{
+
+}
+
+TEST_F(SurfaceTest, getNativeContent)
+{
+
+}