/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// this image if not exist, for negative test
static const char* gGifNonExist = "non-exist.gif";
+// this image exists but it is not a gif file.
+static const char* gGifInvalid = TEST_RESOURCE_DIR "/invalid.gif";
+
} // namespace
void utc_dali_animated_image_loader_startup(void)
END_TEST;
}
+
+int UtcDaliAnimatedImageLoadingInvalidGif(void)
+{
+ Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGifInvalid, true);
+ Dali::Devel::PixelBuffer pixelBuffer = animatedImageLoading.LoadFrame(0);
+
+ // The pixel buffer should be empty.
+ DALI_TEST_CHECK(!pixelBuffer);
+
+ END_TEST;
+}
}
}
}
+ else
+ {
+ success = false;
+ DALI_LOG_ERROR("LOAD_ERROR_UNKNOWN_FORMAT\n");
+ }
}
return success;
}
mLoadSucceeded(false),
mMutex()
{
- loaderInfo.gifAccessor = nullptr;
+ loaderInfo.gifAccessor = nullptr;
loaderInfo.fileData.fileName = mUrl.c_str();
loaderInfo.fileData.isLocalResource = isLocalResource;
}
}
mLoadSucceeded = ReadHeader(loaderInfo, imageProperties);
+ if(!mLoadSucceeded)
+ {
+ DALI_LOG_ERROR("ReadHeader is failed [%s]\n", mUrl.c_str());
+ }
return mLoadSucceeded;
}