Redundant assignments. 42/102842/4
authorFrancisco Santos <f1.santos@samsung.com>
Tue, 6 Dec 2016 14:37:32 +0000 (14:37 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Fri, 16 Dec 2016 16:51:18 +0000 (16:51 +0000)
Change-Id: I822c304423985c56150047576dfb2e442a68b10d

automated-tests/src/dali-internal/utc-Dali-Internal-ImageFactory.cpp
automated-tests/src/dali/utc-Dali-Any.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-SignalTemplatesFunctors.cpp

index b1a9f21..4a70737 100644 (file)
@@ -542,6 +542,7 @@ int UtcDaliImageFactoryReload05(void)
   application.GetPlatform().ResetTrace();
 
   ticket = imageFactory.Reload( *req.Get() );
+  DALI_TEST_CHECK( ticket );
 
   application.SendNotification();
   application.Render();
@@ -555,6 +556,7 @@ int UtcDaliImageFactoryReload05(void)
   EmulateImageLoaded( application, 80, 80 );
 
   ticket = imageFactory.Reload( *req.Get() );
+  DALI_TEST_CHECK( ticket );
 
   application.SendNotification();
   application.Render();
index 97155c9..843bc8a 100644 (file)
@@ -117,11 +117,9 @@ int UtcDaliAnyAssignmentOperators(void)
 
   DALI_TEST_EQUALS( fValue, 4.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
-  Any value2 = 0.f;
+  value1 = 9.f; // Test operator=( const Type& ).
 
-  value2 = 9.f; // Test operator=( const Type& ).
-
-  value2.Get( fValue );
+  value1.Get( fValue );
 
   DALI_TEST_EQUALS( fValue, 9.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
index d02ed07..c8dbb97 100644 (file)
@@ -1091,12 +1091,11 @@ int UtcDaliCustomActorImplGetHeightForWidthBase(void)
   Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
 
   float width = 300.0f;
-  float v = 0.0f;
 
   application.SendNotification();
   application.Render();
 
-  v = custom.TestGetHeightForWidthBase( width );
+  float v = custom.TestGetHeightForWidthBase( width );
 
   DALI_TEST_CHECK( v == width );
 
@@ -1109,12 +1108,11 @@ int UtcDaliCustomActorImplGetWidthForHeightBase(void)
   Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
 
   float height = 300.0f;
-  float v = 0.0f;
 
   application.SendNotification();
   application.Render();
 
-  v = custom.TestGetWidthForHeightBase( height );
+  float v = custom.TestGetWidthForHeightBase( height );
 
   DALI_TEST_CHECK( v == height );
 
@@ -1133,8 +1131,7 @@ int UtcDaliCustomActorImplCalculateChildSizeBase(void)
   application.SendNotification();
   application.Render();
 
-  float v = 9.99f;
-  v = custom.TestCalculateChildSizeBase( child, Dali::Dimension::ALL_DIMENSIONS );
+  float v = custom.TestCalculateChildSizeBase( child, Dali::Dimension::ALL_DIMENSIONS );
   DALI_TEST_CHECK( v == 0.0f );
 
   END_TEST;
@@ -1146,19 +1143,19 @@ int UtcDaliCustomActorImplRelayoutDependentOnChildrenBase(void)
   Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
   custom.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::ALL_DIMENSIONS);
 
-  bool v = false;
+  bool v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::ALL_DIMENSIONS );
+  DALI_TEST_CHECK( v == true );
 
-  v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::ALL_DIMENSIONS );
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_CHECK( v == true );
-
   custom.SetResizePolicy(Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS);
   v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::WIDTH );
+  DALI_TEST_CHECK( v == false );
+
+  // why is this here?
   application.SendNotification();
   application.Render();
-  DALI_TEST_CHECK( v == false );
 
   END_TEST;
 }
index d66aa29..168e9e3 100644 (file)
@@ -189,6 +189,7 @@ struct FloatFunctorFloat
   }
 
   FloatFunctorFloat( const FloatFunctorFloat& copyMe )
+  : mLastReceivedValue (copyMe.mLastReceivedValue )
   {
     ++mTotalInstanceCount;
     ++mCurrentInstanceCount;
@@ -374,7 +375,6 @@ int UtcDaliSignalFunctorsEmitReturn(void)
     DALI_TEST_EQUALS( returnValue, FloatFunctorVoid::DEFAULT_RETURN_VALUE, TEST_LOCATION );
 
     // Test double emission
-    returnValue = 0.0f;
     returnValue = signals.mFloatSignalVoid.Emit();
     DALI_TEST_EQUALS( FloatFunctorVoid::mCallbackCount, 2, TEST_LOCATION );
     DALI_TEST_EQUALS( returnValue, FloatFunctorVoid::DEFAULT_RETURN_VALUE, TEST_LOCATION );