diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-06-11 01:30:39 -0700 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-06-30 11:35:26 +0900 |
commit | fdac838b596336f28c5e98346917d8d6050623fa (patch) | |
tree | fc0c5ec467cdda46361c728a61e9c3c0e035c91f | |
parent | 974553ff1e779239055a97a646491fdf6245482b (diff) | |
download | wayland-ivi-extension-fdac838b596336f28c5e98346917d8d6050623fa.tar.gz |
test: add margin to compare values of ILM with return values from wayland.
This is because type of these valuables are different.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r-- | ivi-layermanagement-api/test/ilm_control_notification_test.cpp | 12 | ||||
-rw-r--r-- | ivi-layermanagement-api/test/ilm_control_test.cpp | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/ivi-layermanagement-api/test/ilm_control_notification_test.cpp b/ivi-layermanagement-api/test/ilm_control_notification_test.cpp index 8b21be6..8cd0c3b 100644 --- a/ivi-layermanagement-api/test/ilm_control_notification_test.cpp +++ b/ivi-layermanagement-api/test/ilm_control_notification_test.cpp @@ -273,7 +273,7 @@ TEST_F(NotificationTest, NotifyOnLayerSetOpacity) assertCallbackcalled(); EXPECT_EQ(layer,callbackLayerId); - EXPECT_FLOAT_EQ(0.789,LayerProperties.opacity); + EXPECT_NEAR(0.789, LayerProperties.opacity, 0.1); EXPECT_EQ(ILM_NOTIFICATION_OPACITY,mask); ASSERT_EQ(ILM_SUCCESS,ilm_layerRemoveNotification(layer)); @@ -372,7 +372,7 @@ TEST_F(NotificationTest, NotifyOnLayerMultipleValues2) EXPECT_EQ(layer,callbackLayerId); EXPECT_TRUE(LayerProperties.visibility); - EXPECT_FLOAT_EQ(0.789,LayerProperties.opacity); + EXPECT_NEAR(0.789, LayerProperties.opacity, 0.1); EXPECT_EQ(33u,LayerProperties.destX); EXPECT_EQ(567u,LayerProperties.destY); EXPECT_EQ(55u,LayerProperties.destWidth); @@ -405,7 +405,7 @@ TEST_F(NotificationTest, NotifyOnLayerAllValues) EXPECT_EQ(ILM_ONEHUNDREDEIGHTY,LayerProperties.orientation); EXPECT_TRUE(LayerProperties.visibility); - EXPECT_FLOAT_EQ(opacity,LayerProperties.opacity); + EXPECT_NEAR(opacity, LayerProperties.opacity, 0.1); EXPECT_EQ(133u,LayerProperties.destX); EXPECT_EQ(1567u,LayerProperties.destY); EXPECT_EQ(155u,LayerProperties.destWidth); @@ -565,7 +565,7 @@ TEST_F(NotificationTest, NotifyOnSurfaceSetOpacity) assertCallbackcalled(); EXPECT_EQ(surface,callbackSurfaceId); - EXPECT_FLOAT_EQ(0.789,SurfaceProperties.opacity); + EXPECT_NEAR(0.789, SurfaceProperties.opacity, 0.1); EXPECT_EQ(ILM_NOTIFICATION_OPACITY,mask); ASSERT_EQ(ILM_SUCCESS,ilm_surfaceRemoveNotification(surface)); @@ -664,7 +664,7 @@ TEST_F(NotificationTest, NotifyOnSurfaceMultipleValues2) EXPECT_EQ(surface,callbackSurfaceId); EXPECT_TRUE(SurfaceProperties.visibility); - EXPECT_FLOAT_EQ(0.789,SurfaceProperties.opacity); + EXPECT_NEAR(0.789, SurfaceProperties.opacity, 0.1); EXPECT_EQ(33u,SurfaceProperties.destX); EXPECT_EQ(567u,SurfaceProperties.destY); EXPECT_EQ(55u,SurfaceProperties.destWidth); @@ -697,7 +697,7 @@ TEST_F(NotificationTest, NotifyOnSurfaceAllValues) EXPECT_EQ(ILM_ONEHUNDREDEIGHTY,SurfaceProperties.orientation); EXPECT_TRUE(SurfaceProperties.visibility); - EXPECT_FLOAT_EQ(opacity,SurfaceProperties.opacity); + EXPECT_NEAR(opacity, SurfaceProperties.opacity, 0.1); EXPECT_EQ(133u,SurfaceProperties.destX); EXPECT_EQ(1567u,SurfaceProperties.destY); EXPECT_EQ(155u,SurfaceProperties.destWidth); diff --git a/ivi-layermanagement-api/test/ilm_control_test.cpp b/ivi-layermanagement-api/test/ilm_control_test.cpp index 066e5ce..9092139 100644 --- a/ivi-layermanagement-api/test/ilm_control_test.cpp +++ b/ivi-layermanagement-api/test/ilm_control_test.cpp @@ -800,7 +800,7 @@ TEST_F(IlmCommandTest, ilm_getPropertiesOfSurface_ilm_surfaceSetSourceRectangle_ ilmSurfaceProperties surfaceProperties; ASSERT_EQ(ILM_SUCCESS, ilm_getPropertiesOfSurface(surface, &surfaceProperties)); - ASSERT_EQ(0.8765, surfaceProperties.opacity); + ASSERT_NEAR(0.8765, surfaceProperties.opacity, 0.1); ASSERT_EQ(89u, surfaceProperties.sourceX); ASSERT_EQ(6538u, surfaceProperties.sourceY); ASSERT_EQ(638u, surfaceProperties.sourceWidth); @@ -826,7 +826,7 @@ TEST_F(IlmCommandTest, ilm_getPropertiesOfSurface_ilm_surfaceSetSourceRectangle_ ilmSurfaceProperties surfaceProperties2; ASSERT_EQ(ILM_SUCCESS, ilm_getPropertiesOfSurface(surface, &surfaceProperties2)); - ASSERT_EQ(0.436, surfaceProperties2.opacity); + ASSERT_NEAR(0.436, surfaceProperties2.opacity, 0.1); ASSERT_EQ(784u, surfaceProperties2.sourceX); ASSERT_EQ(546u, surfaceProperties2.sourceY); ASSERT_EQ(235u, surfaceProperties2.sourceWidth); @@ -859,7 +859,7 @@ TEST_F(IlmCommandTest, ilm_getPropertiesOfLayer_ilm_layerSetSourceRectangle_ilm_ ilmLayerProperties layerProperties1; ASSERT_EQ(ILM_SUCCESS, ilm_getPropertiesOfLayer(layer, &layerProperties1)); - ASSERT_EQ(0.8765, layerProperties1.opacity); + ASSERT_NEAR(0.8765, layerProperties1.opacity, 0.1); ASSERT_EQ(89u, layerProperties1.sourceX); ASSERT_EQ(6538u, layerProperties1.sourceY); ASSERT_EQ(638u, layerProperties1.sourceWidth); @@ -885,7 +885,7 @@ TEST_F(IlmCommandTest, ilm_getPropertiesOfLayer_ilm_layerSetSourceRectangle_ilm_ ilmLayerProperties layerProperties2; ASSERT_EQ(ILM_SUCCESS, ilm_getPropertiesOfLayer(layer, &layerProperties2)); - ASSERT_EQ(0.436, layerProperties2.opacity); + ASSERT_NEAR(0.436, layerProperties2.opacity, 0.1); ASSERT_EQ(784u, layerProperties2.sourceX); ASSERT_EQ(546u, layerProperties2.sourceY); ASSERT_EQ(235u, layerProperties2.sourceWidth); |