[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ImageUrl.cpp
index 658d585..d137c5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -24,7 +24,7 @@
 using namespace Dali;
 using namespace Dali::Toolkit;
 
-int UtcImageUrlConstructor(void)
+int UtcImageUrlConstructor01(void)
 {
   ToolkitTestApplication application;
 
@@ -50,3 +50,30 @@ int UtcImageUrlConstructor(void)
   DALI_TEST_CHECK(downcastUrl);
   END_TEST;
 }
+
+int UtcImageUrlConstructor02(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline(" UtcImageUrlValid ");
+
+  // Test default constructor.
+  ImageUrl imageUrl;
+  DALI_TEST_CHECK(!imageUrl);
+
+  // Test object creation
+  Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u); // test texture
+  imageUrl      = ImageUrl::New(image, true);
+  DALI_TEST_CHECK(imageUrl);
+
+  // Test copy constructor
+  ImageUrl ImageUrlCopy(imageUrl);
+  DALI_TEST_CHECK(ImageUrlCopy);
+
+  // Test down cast
+  BaseHandle baseUrl;
+  baseUrl              = imageUrl;
+  ImageUrl downcastUrl = ImageUrl::DownCast(baseUrl);
+  DALI_TEST_CHECK(downcastUrl);
+  END_TEST;
+}