Fix crash issue when we decode some bmp
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor-internal / utc-Dali-BmpLoader.cpp
index 6599536..7babde8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 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.
@@ -15,9 +15,9 @@
  *
  */
 
-#include <iostream>
-#include <stdlib.h>
 #include <dali-test-suite-utils.h>
+#include <stdlib.h>
+#include <iostream>
 
 #include <dali/internal/imaging/common/loader-bmp.h>
 #include "image-loaders.h"
@@ -26,17 +26,23 @@ using namespace Dali;
 
 namespace
 {
-
-static const LoadFunctions BmpLoaders( TizenPlatform::LoadBmpHeader, TizenPlatform::LoadBitmapFromBmp );
+static const LoadFunctions BmpLoaders(TizenPlatform::LoadBmpHeader, TizenPlatform::LoadBitmapFromBmp);
 
 } // Unnamed namespace.
 
 int UtcDaliBmp24bpp(void)
 {
-  ImageDetails image( TEST_IMAGE_DIR "/flag-24bpp.bmp", 32u, 32u );
+  ImageDetails image(TEST_IMAGE_DIR "/flag-24bpp.bmp", 32u, 32u);
 
-  TestImageLoading( image, BmpLoaders );
+  TestImageLoading(image, BmpLoaders);
 
   END_TEST;
 }
+int UtcDaliBmpRGB8(void)
+{
+  ImageDetails image(TEST_IMAGE_DIR "/w3c_home_256.bmp", 72u, 48u);
 
+  TestImageLoading(image, BmpLoaders);
+
+  END_TEST;
+}
\ No newline at end of file