%description -n native-filesystem-permission-ctc
Native API Compatibility TC for filesystem-permission
-%package -n native-image-util-ctc
-Summary: Native API Compatibility TC for image-util
-
-%description -n native-image-util-ctc
-Native API Compatibility TC for image-util
-
%package -n native-libstorage-ctc
Summary: Native API Compatibility TC for libstorage
mkdir -p %{buildroot}/opt/usr/apps/native-filesystem-permission-ctc/bin
#cp templates/external_wrapper.sh %{buildroot}/opt/usr/apps/native-filesystem-permission-ctc/bin
-#native-image-util-ctc
-cp LICENSE %{buildroot}/opt/usr/share/license/native-image-util-ctc
-cp packaging/ctc/native-image-util-ctc.xml %{buildroot}/opt/share/packages/
-mkdir -p %{buildroot}/opt/usr/apps/native-image-util-ctc/bin
-#cp templates/external_wrapper.sh %{buildroot}/opt/usr/apps/native-image-util-ctc/bin
-mkdir -p %{buildroot}/opt/usr/apps/native-image-util-ctc/data/
-cp src/ctc/image-util/ImageUtil_sample.jpg %{buildroot}/opt/usr/apps/native-image-util-ctc/data/ImageUtil_sample.jpg
-
#native-libstorage-ctc
cp LICENSE %{buildroot}/opt/usr/share/license/native-libstorage-ctc
cp packaging/ctc/native-libstorage-ctc.xml %{buildroot}/opt/share/packages/
chown -R 5000:5000 /opt/usr/apps/native-wifi-itc/data
chsmack -a native-wifi-itc /opt/usr/apps/native-wifi-itc/data
-chown -R 5000:5000 /opt/usr/apps/native-image-util-ctc/data
-chsmack -a %{name} /opt/usr/apps/native-image-util-ctc/data
-
chown -R 5000:5000 /opt/usr/apps/native-platform-permission-ctc/data
chsmack -a %{name} /opt/usr/apps/native-platform-permission-ctc/data
%ifarch armv7l
/opt/share/packages/native-filesystem-permission-ctc.xml
/opt/usr/share/license/native-filesystem-permission-ctc
-%files -n native-image-util-ctc
-/opt/usr/apps/native-image-util-ctc/*
-/opt/share/packages/native-image-util-ctc.xml
-/opt/usr/share/license/native-image-util-ctc
-
%files -n native-libstorage-ctc
/opt/usr/apps/native-libstorage-ctc/*
/opt/share/packages/native-libstorage-ctc.xml
+++ /dev/null
-%define MODULE_NAME image-util
-%define MODULE_LIBNAME capi-media-image-util
-Name: native-%{MODULE_NAME}-ctc
-Summary: Native API Compatibility Test (%{name})
-Version: 0.1
-Release: 0
-Group: Development/Tools
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
-BuildRequires: pkgconfig(%{MODULE_LIBNAME})
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: cmake
-BuildRequires: pkgconfig(bundle)
-BuildRequires: pkgconfig(capi-system-info)
-
-%description
-Core API Compatibility Test (%{name})
-
-%prep
-%setup -q
-
-%build
-
-%define PREFIX "%{_libdir}/%{name}"
-
-export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-
-%if %{?ASAN_BUILD:1}0
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%else
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%endif
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-%make_install
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE %{buildroot}/usr/share/license/%{name}
-mkdir -p %{buildroot}/tmp/
-
-mkdir -p %{buildroot}/usr/share/packages/
-cp packaging/ctc/native-%{MODULE_NAME}-ctc.xml %{buildroot}/usr/share/packages/
-
-mkdir -p %{buildroot}%{APP_PATH}%{name}/bin
-#cp templates/external_wrapper.sh %{buildroot}%{APP_PATH}%{name}/bin
-
-mkdir -p %{buildroot}%{APP_PATH}%{name}/data/
-cp %{_builddir}/%{name}-%{version}/src/ctc/image-util/ImageUtil_sample.jpg %{buildroot}%{APP_PATH}%{name}/data/ImageUtil_sample.jpg
-
-%post
-chmod -R 777 %{APP_PATH}%{name}/data
-chown -R 5000:5000 %{APP_PATH}%{name}/data
-chsmack -a %{name} %{APP_PATH}%{name}/data
-%postun
-
-
-%files
-%{APP_PATH}%{name}/*
-/usr/share/packages/native-%{MODULE_NAME}-ctc.xml
-/usr/share/license/%{name}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="native-image-util-ctc" version="0.1.0" api-version="6.0">
- <label>NativeImageUtilTest</label>
- <author email="mymail@tizentest.com" href="www.tizentest.com">test</author>
- <description>Native API test Application</description>
- <ui-application appid="native.image-util-ctc" exec="/usr/apps/native-image-util-ctc/bin/tct-image-util-ctc" nodisplay="false" multiple="false" type="capp" taskmanage="true">
- <background-category value="background-network"/>
- <background-category value="download"/>
- <background-category value="iot-communication"/>
- <background-category value="location"/>
- <background-category value="media"/>
- <background-category value="sensor"/>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/externalstorage</privilege>
- <privilege>http://tizen.org/privilege/mediastorage</privilege>
- </privileges>
-</manifest>
chsmack -a "User::App::Shared" $APP_DATA_DIR/*
chsmack -e "User::App::Shared" $APP_DATA_DIR/*
;;
- "org.tizen.image-util-native-ctc")
- echo "Installing pre-requisites for the package $1"
- mkdir -p $APP_DATA_DIR
- chsmack -a "User::App::Shared" $APP_DATA_DIR
- chsmack -e "User::App::Shared" $APP_DATA_DIR
- cp ImageUtil_sample.jpg $APP_DATA_DIR/ImageUtil_sample.jpg
- chown -R 5000:5000 $APP_DATA_DIR
- chmod -R 777 $APP_DATA_DIR
- chsmack -a "User::App::Shared" $APP_DATA_DIR/*
- chsmack -e "User::App::Shared" $APP_DATA_DIR/*
- ;;
"org.tizen.player-native-ctc")
echo "Installing pre-requisites for the package $1"
mkdir -p $APP_DATA_DIR
ADD_SUBDIRECTORY(ctc/device)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/ctc/filesystem-permission")
ADD_SUBDIRECTORY(ctc/filesystem-permission)
- MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/ctc/image-util")
- ADD_SUBDIRECTORY(ctc/image-util)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/ctc/libstorage")
ADD_SUBDIRECTORY(ctc/libstorage)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/ctc/location-manager")
+++ /dev/null
-SET(PKG_NAME "image-util")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-ctc")
-SET(RPM_NAME "native-${PKG_NAME}-ctc")
-
-SET(CAPI_LIB "capi-media-image-util")
-SET(TC_SOURCES
- CTs-image-util-common.c
- CTs-image-util.c
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- ${CAPI_LIB}
- capi-appfw-application
- bundle
- glib-2.0
- capi-system-info
- dlog
-)
-
-INCLUDE_DIRECTORIES(
- ${${CAPI_LIB}_INCLUDE_DIRS}
-)
-
-ADD_EXECUTABLE(${EXEC_NAME} tct-${PKG_NAME}-native.c ${TC_SOURCES} ${COMMON_FILE})
-TARGET_LINK_LIBRARIES(${EXEC_NAME}
- ${${CAPI_LIB}_LIBRARIES}
- bundle
-)
-
-INSTALL(PROGRAMS ${EXEC_NAME}
- DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
-)
-
-IF( DEFINED ASAN )
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
-ELSE()
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
-ENDIF()
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#include "CTs-image-util-common.h"
-
-/** @addtogroup ctc-image-util
-* @ingroup ctc
-* @{
-*/
-
-//Add helper function definitions here
-
-/**
-* @function ImageUtilGetError
-* @description Display the details error information
-* @parameter [IN] nResult, api return value code
-* [IN] pszApi, api name
-* [IN] nLineNumber line number
-* @return NA
-*/
-char* ImageUtilGetError(int nResult)
-{
- char* pszErrInfo = NULL;
- switch ( nResult )
- {
- case IMAGE_UTIL_ERROR_INVALID_PARAMETER : pszErrInfo = "IMAGE_UTIL_ERROR_INVALID_PARAMETER"; break;
- case IMAGE_UTIL_ERROR_OUT_OF_MEMORY : pszErrInfo = "IMAGE_UTIL_ERROR_OUT_OF_MEMORY"; break;
- case IMAGE_UTIL_ERROR_NO_SUCH_FILE: pszErrInfo = "IMAGE_UTIL_ERROR_NO_SUCH_FILE"; break;
- case IMAGE_UTIL_ERROR_INVALID_OPERATION : pszErrInfo = "IMAGE_UTIL_ERROR_INVALID_OPERATION"; break;
- case IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT : pszErrInfo = "IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT"; break;
- case IMAGE_UTIL_ERROR_PERMISSION_DENIED: pszErrInfo = "IMAGE_UTIL_ERROR_PERMISSION_DENIED"; break;
- default: pszErrInfo = "Unknown Error";
- }
-
- return pszErrInfo;
-}
-
-/**
-* @function ImageUtilDecode
-* @description Dncode the image.
-* @parameter [IN] pPath, image path
-* [IN] eColorSpace, image colorspace
-* [OUT] nWidth, image width
-* [OUT] nHeight, image height
-* [OUT] upszDecodeBuffer, decode result
-* @return true if all api return success otherwise false
-*/
-bool ImageUtilDecode(const char *pszImgPath, image_util_colorspace_e eColorSpace, unsigned long *nWidth, unsigned long *nHeight, unsigned char **upszDecodeBuffer, unsigned long long *unDecodeSize)
-{
- image_util_decode_h decHandle = NULL;
-
- int nRet = image_util_decode_create(&decHandle);
- if (nRet != IMAGE_UTIL_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] image_util_decode_create\\n", __LINE__, API_NAMESPACE);
- return false;
- }
-
- nRet = image_util_decode_set_input_path(decHandle, pszImgPath);
- if (nRet != IMAGE_UTIL_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] image_util_decode_set_input_path\\n", __LINE__, API_NAMESPACE);
- image_util_decode_destroy(decHandle);
- return false;
- }
- nRet = image_util_decode_set_colorspace(decHandle, IMAGE_UTIL_COLORSPACE_RGB888);
- if (nRet != IMAGE_UTIL_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] image_util_decode_set_input_path\\n", __LINE__, API_NAMESPACE);
- image_util_decode_destroy(decHandle);
- return false;
- }
-
- nRet = image_util_decode_set_output_buffer(decHandle, upszDecodeBuffer);
- if (nRet != IMAGE_UTIL_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] image_util_decode_set_input_path\\n", __LINE__, API_NAMESPACE);
- image_util_decode_destroy(decHandle);
- return false;
- }
-
- nRet = image_util_decode_run(decHandle, nWidth, nHeight, unDecodeSize);
- if (nRet != IMAGE_UTIL_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] image_util_decode_set_input_path\\n", __LINE__, API_NAMESPACE);
- image_util_decode_destroy(decHandle);
- return false;
- }
-
- image_util_decode_destroy(decHandle);
- return true;
-}
-
-/**
-* @function ImageUtilEncode
-* @description Calculate image buffer and encode the image.
-* @parameter [IN] nWidth, image width
-* [IN] nHeight, image height
-* [IN] eColorSpace, image colorspace
-* @return true if all api return success otherwise false
-*/
-bool ImageUtilEncode(unsigned long nWidth, unsigned long nHeight, image_util_colorspace_e eColorSpace)
-{
- int nRet= IMAGE_UTIL_ERROR_NONE;
- unsigned int unSize = 0;
- unsigned long long unEncodeSize = 0;
-
- nRet = image_util_calculate_buffer_size (nWidth, nHeight, eColorSpace , &unSize);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_calculate_buffer_size failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- return false;
- }
- if (unSize == 0)
- {
- FPRINTF("[Line : %d][%s] Calculated Image Buffer Size is returned zero\\n", __LINE__, API_NAMESPACE);
- return false;
- }
-
- g_upszImgDestBuffer = malloc(unSize);
-
- image_util_encode_h encHandle = NULL;
-
- nRet = image_util_encode_create(IMAGE_UTIL_JPEG, &encHandle);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_create failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
- nRet = image_util_encode_set_resolution(encHandle, nWidth, nHeight );
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_set_resolution failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
- nRet = image_util_encode_set_input_buffer(encHandle, g_upszImgDestBuffer);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_set_input_buffer failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
- nRet = image_util_encode_set_colorspace(encHandle, eColorSpace);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_set_colorspace failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
- nRet = image_util_encode_set_quality(encHandle, QUALITY);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_set_quality failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
- nRet = image_util_encode_set_output_path(encHandle, OUTPUT_FILE_PATH);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_set_output_path failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
-
- nRet = image_util_encode_run(encHandle, &unEncodeSize);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_encode_run failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
- return false;
- }
-
- image_util_encode_destroy(encHandle);
- FREE_MEMORY(g_upszImgDestBuffer);
-
- return true;
-}
-
-/**
-* @function ImageUtilCheckFunction
-* @description Calculate image buffer and encode the image.
-* @parameter [IN] upszImageBuffer, image buffer
-* [IN] nWidth, image width
-* [IN] nHeight, image Height
-* [IN] unDecodeSize, buffer size
-* @return true if all api return success otherwise false.
-*
-*/
-bool ImageUtilCheckFunction(unsigned char *upszImageBuffer, unsigned long nWidth, unsigned long nHeight, unsigned long long unDecodeSize)
-{
- if ( upszImageBuffer == NULL )
- {
- FPRINTF("[Line : %d][%s] Decoded Image Buffer is NULL\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- if ( unDecodeSize == 0 )
- {
- FPRINTF("[Line : %d][%s] Decoded Image Buffer Size is zero\\n", __LINE__, API_NAMESPACE);
- return false;
- }
-
- return true;
-}
-
-/**
-* @function ImageUtilGetDataPath
-* @description Get the path to application data directory
-* @parameter[IN] char* pszFileName [file name]
-* @return NA
-*/
-char* ImageUtilGetDataPath(char *pszFileName)
-{
- char *pszAppData = app_get_data_path(),*pszImgPath = NULL;
- if(pszAppData == NULL || strlen(pszAppData) == 0)
- {
- FPRINTF("[Line : %d][%s] app_get_data_path is failed, error returned = invalid path\\n", __LINE__, API_NAMESPACE);
- return pszImgPath;
- }
-
- pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName)+1);
- snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName)+2, "%s%s",pszAppData, pszFileName);
- return pszImgPath;
-}
-
-/** @} */ //end of ctc-image-util
\ No newline at end of file
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef _CTS_IMAGE_UTIL_COMMON_H_
-#define _CTS_IMAGE_UTIL_COMMON_H_
-
-//Add test package related includes here
-#include "tct_common.h"
-#include <image_util.h>
-#include <app.h>
-
-/** @addtogroup ctc-image-util
-* @ingroup ctc
-* @{
-*/
-
-#define API_NAMESPACE "IMAGE_UTIL_CTC"
-#define SAMPLE_FILE "ImageUtil_sample.jpg"
-#define OUTPUT_FILE_PATH (ImageUtilGetDataPath("output.jpg"))
-#define MEMLOG 20
-#define MAX_BLOCK_SIZE 25
-#define QUALITY 100
-
-#define START_TEST {\
- FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
-}
-
-unsigned char * g_upszImgDestBuffer;
-
-//Add helper function declarations here
-
-/**Get Image Util API Error Message*/
-char* ImageUtilGetError(int nResult);
-
-/**Decode Image*/
-bool ImageUtilDecode(const char *pszImgPath, image_util_colorspace_e eColorSpace, unsigned long *nWidth, unsigned long *nHeight, unsigned char **upszDecodeBuffer, unsigned long long *unDecodeSize);
-
-/**Calculate Buffer Size and Encode Image*/
-bool ImageUtilEncode(unsigned long nWidth, unsigned long nHeight, image_util_colorspace_e eColorSpace);
-
-/**Check Function*/
-bool ImageUtilCheckFunction(unsigned char *upszImageBuffer, unsigned long nWidth, unsigned long nHeight, unsigned long long unDecodeSize);
-char* ImageUtilGetDataPath(char *pszFileName);
-
-/** @} */ //end of ctc-image-util
-
-#endif //_CTS_IMAGE_UTIL_COMMON_H_
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#include "CTs-image-util-common.h"
-
-
-/** @addtogroup ctc-image-util
-* @ingroup ctc
-* @{
-*/
-
-//& set: ImageUtil
-
-/**
-* @function CTs_image_util_startup
-* @description Called before each test
-* @parameter NA
-* @return NA
-*/
-void CTs_image_util_startup(void)
-{
- struct stat stBuff;
- if ( stat(ERR_LOG, &stBuff) == 0 )
- {
- if (remove(ERR_LOG))
- {
- FPRINTF("[Line : %d][%s] TEST SUIT start-up FAIL because the ERR_LOG file is not removed\\n", __LINE__, API_NAMESPACE);
- }
- }
-
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT start-up: CTs_Image_Util_p\\n", __LINE__, API_NAMESPACE);
-#endif
-}
-
-/**
-* @function CTs_image_util_cleanup
-* @description Called after each test
-* @parameter NA
-* @return NA
-*/
-void CTs_image_util_cleanup(void)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT clean-up: CTs_Image_Util_p\\n", __LINE__, API_NAMESPACE);
-#endif
- return;
-}
-
-
-/** @addtogroup ctc-image-util-testcases
-* @brief Integration testcases for module image-util
-* @ingroup ctc-image-util
-* @{
-*/
-
-//& purpose: Encode jpeg image to jpg format.
-//& type: auto
-/**
-* @testcase CTc_ImageUtil_ImageEncoder_JPEG_p
-* @since_tizen 2.3
-* @author SRID(sk.roy)
-* @reviewer SRID(gupta.sanjay)
-* @type auto
-* @scenario Decodes jpeg image to the buffer\n
-* Calculates the size of image buffer for the specified resolution and colorspace\n
-* Encodes image to the jpeg image
-* @apicovered image_util_decode_jpeg,image_util_calculate_buffer_size,image_util_encode_jpeg
-* @passcase If image encoding to jpeg image is done successfully and all api returns success message.
-* @failcase If an api returns error message.
-* @precondition NA
-* @postcondition NA
-*/
-int CTc_ImageUtil_ImageEncoder_JPEG_p(void)
-{
- START_TEST;
-
- unsigned long nWidth = 0, nHeight = 0;
- unsigned long long unDecodeSize = 0;
- unsigned char * upszImgSourceBuffer = NULL;
- char * pszImgPath = ImageUtilGetDataPath(SAMPLE_FILE);
- if(pszImgPath == NULL)
- {
- FPRINTF("[Line : %d][%s] ImageUtilGetDataPath failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- if ( ImageUtilDecode(pszImgPath, IMAGE_UTIL_COLORSPACE_RGB888, &nWidth, &nHeight, &upszImgSourceBuffer, &unDecodeSize) == false )
- {
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- if ( ImageUtilCheckFunction(upszImgSourceBuffer, nWidth, nHeight, unDecodeSize) == false )
- {
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
-
- if ( ImageUtilEncode(nWidth, nHeight, IMAGE_UTIL_COLORSPACE_RGB888) == false )
- {
- return 1;
- }
-
- return 0;
-}
-
-//& purpose: Decode jpg image
-//& type: auto
-/**
-* @testcase CTc_ImageUtil_ImageDecoder_JPG_p
-* @since_tizen 2.3
-* @author SRID(sk.roy)
-* @reviewer SRID(gupta.sanjay)
-* @type auto
-* @scenario Decodes jpeg image to the buffer\n
-* Calculates the size of image buffer for the specified resolution and colorspace\n
-* Encodes image to the jpeg image\n
-* Decodes the encoded jpeg image to the buffer
-* @apicovered image_util_decode_jpeg,image_util_calculate_buffer_size,image_util_encode_jpeg
-* @passcase All api returns success message.
-* @failcase An api returns error message.
-* @precondition NA
-* @postcondition NA
-*/
-int CTc_ImageUtil_ImageDecoder_JPG_p(void)
-{
- START_TEST;
-
- image_util_decode_h dstHandle = NULL;
- unsigned long nWidth = 0, nHeight = 0;
- unsigned long long unDecodeSize = 0;
- unsigned char * upszImgSourceBuffer = NULL;
- char * pszImgPath = ImageUtilGetDataPath(SAMPLE_FILE);
- if(pszImgPath == NULL)
- {
- FPRINTF("[Line : %d][%s] ImageUtilGetDataPath failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- if ( ImageUtilDecode(pszImgPath, IMAGE_UTIL_COLORSPACE_RGB888, &nWidth, &nHeight, &upszImgSourceBuffer, &unDecodeSize) == false )
- {
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- if ( ImageUtilCheckFunction(upszImgSourceBuffer, nWidth, nHeight, unDecodeSize) == false )
- {
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- if ( ImageUtilEncode(nWidth, nHeight, IMAGE_UTIL_COLORSPACE_RGB888) == false )
- {
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- int nRet = image_util_decode_create(&dstHandle);
- PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
- CHECK_HANDLE(dstHandle,"image_util_decode_create");
-
- nRet = image_util_decode_set_input_path(dstHandle, OUTPUT_FILE_PATH);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
- nRet = image_util_decode_set_colorspace(dstHandle, IMAGE_UTIL_COLORSPACE_RGB888);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_colorspace", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
- nRet = image_util_decode_set_output_buffer(dstHandle, &upszImgSourceBuffer);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
- nRet = image_util_decode_run(dstHandle, &nWidth, &nHeight, &unDecodeSize);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
- nRet = image_util_decode_destroy(dstHandle);
- if ( nRet != IMAGE_UTIL_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] image_util_decode_jpeg failed, error returned = %s\\n", __LINE__, API_NAMESPACE, ImageUtilGetError(nRet));
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- if ( ImageUtilCheckFunction(upszImgSourceBuffer, nWidth, nHeight, unDecodeSize) == false )
- {
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 1;
- }
-
- FREE_MEMORY(upszImgSourceBuffer);
- FREE_MEMORY(pszImgPath);
- return 0;
-}
-
-/** @} */ //end of ctc-image-util
-/** @} */ //end of ctc-image-util-testcases
\ No newline at end of file
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#include <stdio.h>
-#include <string.h>
-#include "tct_common.h"
-
-#ifdef MOBILE //Starts MOBILE
-#include "tct-image-util-native_mobile.h"
-#endif //MOBILE //End MOBILE
-
-#ifdef WEARABLE //Starts WEARABLE
-#include "tct-image-util-native_wearable.h"
-#endif //WEARABLE //End WEARABLE
-
-#ifdef TV //Starts TV
-#include "tct-image-util-native_tv.h"
-#endif //TV //End TV
-
-#ifdef TIZENIOT //Starts TIZENIOT
-#include "tct-image-util-native_tizeniot.h"
-#endif //TIZENIOT //End TIZENIOT
-
-#include <malloc.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <glib.h>
-#include <stdbool.h>
-#include <app.h>
-#include <dlog.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <errno.h>
-
-static bool app_create(void *data)
-{
- return true;
-}
-
-static void app_control(app_control_h app_control, void *data)
-{
- char* pszGetTCName = NULL;
- int i=0, result=0, nRet=0;
- nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName);
- if(nRet != APP_CONTROL_ERROR_NONE)
- {
- dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet);
- PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__);
- PRINT_TC_RESULT("%d",1);
- FREE_MEMORY_TC(pszGetTCName);
- return;
- }
-
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);
- for ( i = 0; tc_array[i].name; i++ )
- {
- if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )
- {
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName);
- if ( tc_array[i].startup )
- {
- tc_array[i].startup();
- }
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName);
-
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName);
- result = tc_array[i].function();
- dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result);
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName);
-
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName);
- if ( tc_array[i].cleanup )
- {
- tc_array[i].cleanup();
- }
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName);
- PRINT_TC_RESULT("%d",result);
- FREE_MEMORY_TC(pszGetTCName);
- return;
- }
- }
-
- dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName);
- PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName);
- PRINT_TC_RESULT("%d",1);
- FREE_MEMORY_TC(pszGetTCName);
- return;
-}
-
-static void app_terminate(void *data)
-{
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__);
-}
-
-int main(int argc, char *argv[])
-{
- int ret = 0;
-
- ui_app_lifecycle_callback_s event_callback = {0,};
- event_callback.create = app_create;
- event_callback.terminate = app_terminate;
- event_callback.app_control = app_control;
-
- //setting gcda file location for coverage
- setenv("GCOV_PREFIX","/tmp",1);
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__);
-
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__);
- ret = ui_app_main(argc, argv, &event_callback, NULL);
- if (ret != APP_ERROR_NONE)
- {
- dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret);
- PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret);
- PRINT_TC_RESULT("%d",1);
- return ret;
- }
-
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__);
- return ret;
-}
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_IMAGE-UTIL-NATIVE_H__
-#define __TCT_IMAGE-UTIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void CTs_image_util_startup(void);
-extern void CTs_image_util_cleanup(void);
-
-extern int CTc_ImageUtil_ImageEncoder_JPEG_p(void);
-extern int CTc_ImageUtil_ImageDecoder_JPG_p(void);
-
-testcase tc_array[] = {
- {"CTc_ImageUtil_ImageEncoder_JPEG_p",CTc_ImageUtil_ImageEncoder_JPEG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {"CTc_ImageUtil_ImageDecoder_JPG_p",CTc_ImageUtil_ImageDecoder_JPG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_IMAGE-UTIL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_IMAGE-UTIL-NATIVE_H__
-#define __TCT_IMAGE-UTIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void CTs_image_util_startup(void);
-extern void CTs_image_util_cleanup(void);
-
-extern int CTc_ImageUtil_ImageEncoder_JPEG_p(void);
-extern int CTc_ImageUtil_ImageDecoder_JPG_p(void);
-
-testcase tc_array[] = {
- {"CTc_ImageUtil_ImageEncoder_JPEG_p",CTc_ImageUtil_ImageEncoder_JPEG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {"CTc_ImageUtil_ImageDecoder_JPG_p",CTc_ImageUtil_ImageDecoder_JPG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_IMAGE-UTIL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_IMAGE-UTIL-NATIVE_H__
-#define __TCT_IMAGE-UTIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void CTs_image_util_startup(void);
-extern void CTs_image_util_cleanup(void);
-
-extern int CTc_ImageUtil_ImageEncoder_JPEG_p(void);
-extern int CTc_ImageUtil_ImageDecoder_JPG_p(void);
-
-testcase tc_array[] = {
- {"CTc_ImageUtil_ImageEncoder_JPEG_p",CTc_ImageUtil_ImageEncoder_JPEG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {"CTc_ImageUtil_ImageDecoder_JPG_p",CTc_ImageUtil_ImageDecoder_JPG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_IMAGE-UTIL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_IMAGE-UTIL-NATIVE_H__
-#define __TCT_IMAGE-UTIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void CTs_image_util_startup(void);
-extern void CTs_image_util_cleanup(void);
-
-extern int CTc_ImageUtil_ImageEncoder_JPEG_p(void);
-extern int CTc_ImageUtil_ImageDecoder_JPG_p(void);
-
-testcase tc_array[] = {
- {"CTc_ImageUtil_ImageEncoder_JPEG_p",CTc_ImageUtil_ImageEncoder_JPEG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {"CTc_ImageUtil_ImageDecoder_JPG_p",CTc_ImageUtil_ImageDecoder_JPG_p,CTs_image_util_startup,CTs_image_util_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_IMAGE-UTIL-NATIVE_H__