Merge "Update Animation's public header comments" into devel/master
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-NativeImage.cpp
index bf7b98b..3dc7568 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
 #include <test-native-image.h>
+#include <test-intrusive-ptr.h>
 
 using namespace Dali;
 
@@ -34,6 +35,20 @@ void utc_dali_native_image_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+IntrusivePtr<TestNativeImage> Creator()
+{
+  return TestNativeImage::New(10,10);
+}
+
+int UtcDaliIntrusivePtrTestNativeImage(void)
+{
+  UtcCoverageIntrusivePtr<TestNativeImage> pointer;
+
+  pointer.Check(Creator);
+
+  END_TEST;
+}
+
 int UtcDaliNativeImageNew(void)
 {
   TestApplication application;
@@ -53,6 +68,25 @@ int UtcDaliNativeImageNew(void)
   END_TEST;
 }
 
+int UtcDaliNativeImageCopyConstructor(void)
+{
+  TestApplication application;
+
+  tet_infoline("UtcDaliNativeImageCopyConstructor - NativeImage::NativeImage( const NativeImage& )");
+
+  NativeImage image1;
+  DALI_TEST_CHECK( !image1 );
+
+  TestNativeImagePointer nativeImage = TestNativeImage::New(16, 16);
+  image1 = NativeImage::New(*(nativeImage.Get()));
+  NativeImage image2( image1 );
+
+  DALI_TEST_CHECK( image2 );
+  DALI_TEST_EQUALS( image1, image2, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliNativeImageDownCast(void)
 {
   TestApplication application;
@@ -165,3 +199,38 @@ int UtcDaliNativeImageContextLoss(void)
 
   END_TEST;
 }
+
+int UtcDaliNativeImageExtensionP(void)
+{
+  TestApplication application;
+  tet_infoline( "Testing Dali::NativeImage::GenerateGlTexture()" );
+
+  TestNativeImagePointer testNativeImage = TestNativeImage::New( 16, 16 );
+  DALI_TEST_CHECK( testNativeImage );
+
+  DALI_TEST_CHECK( NULL != testNativeImage->GetExtension() );
+
+  END_TEST;
+}
+
+int UtcDaliNativeImageGetCustomFragmentPreFixP(void)
+{
+  TestApplication application;
+  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( 16, 16 );
+  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
+
+  const char* preFix = "#extension GL_OES_EGL_image_external:require\n";
+  DALI_TEST_EQUALS( nativeImage.GetCustomFragmentPreFix(), preFix, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliNativeImageGetCustomSamplerTypenameP(void)
+{
+  TestApplication application;
+  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( 16, 16 );
+  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
+
+  const char* samplerTypename = "samplerExternalOES";
+  DALI_TEST_EQUALS( nativeImage.GetCustomSamplerTypename(), samplerTypename, TEST_LOCATION );
+  END_TEST;
+}