(GCC 6.2) Remove unused functions from automated tests
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-internal / utc-Dali-Internal-ImageFactory.cpp
index 4d28e20..65833e8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ static void EmulateImageLoaded( TestApplication& application, unsigned int width
 {
   // emulate load success
   Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::DISCARD );
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::OWNED_DISCARD );
   Integration::ResourcePointer resource( bitmap );
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height, width, height );
   if( request )
@@ -72,7 +72,7 @@ int UtcDaliImageFactoryUseCachedRequest01(void)
 
   application.SendNotification();
   application.Render();
-  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
   application.GetPlatform().ResetTrace();
 
   Image image2 = ResourceImage::New( gTestImageFilename );
@@ -80,15 +80,15 @@ int UtcDaliImageFactoryUseCachedRequest01(void)
   application.SendNotification();
   application.Render();
 
-  // check resource is not loaded twice
-  DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+  // Resource is loaded twice
+  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
   application.GetPlatform().ResetTrace();
 
   Image image3 = ResourceImage::New( gTestImageFilename );
 
   application.SendNotification();
   application.Render();
-  DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
   END_TEST;
 }
 
@@ -100,13 +100,13 @@ int UtcDaliImageFactoryUseCachedRequest02(void)
   // testing resource deletion when taken off stage
   tet_infoline( "UtcDaliImageFactoryCachedRequest02 - Discard previously requested resource" );
 
-  Image image = ResourceImage::New( gTestImageFilename, ResourceImage::IMMEDIATE, Image::UNUSED );
-  ImageActor actor = ImageActor::New( image );
+  Image image = ResourceImage::New( gTestImageFilename );
+  Actor actor = CreateRenderableActor( image );
 
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
   application.GetPlatform().ResetTrace();
 
   // Add actor to stage
@@ -130,7 +130,7 @@ int UtcDaliImageFactoryUseCachedRequest02(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+  DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
   application.GetPlatform().ResetTrace();
 
   // Resource is reloaded
@@ -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();