/* * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved * * 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 #include #include static void startup(void); static void cleanup(void); void (*tet_startup)(void) = startup; void (*tet_cleanup)(void) = cleanup; static void startup(void) { // TODO : How to copy sample image???? } static void cleanup(void) { /* end of TC */ } static void utc_uix_face_image_create_negative_01(void) { static const char szFunc[] = "face_image_create"; unsigned char *dummy = (unsigned char *)calloc(1, 176 * 144); if ( dummy == NULL ) { tet_printf("Cannot allocated memory"); tet_result(TET_UNRESOLVED); return; } int err; face_image_h face_image; err = face_image_create((face_image_colorspace_e)99, dummy, 176, 144, 176 * 144, &face_image); dts_check_ne(szFunc, err, FACE_ERROR_NONE); face_image_destroy(face_image); free(dummy); } static void utc_uix_face_image_create_negative_02(void) { static const char szFunc[] = "face_image_create"; unsigned char *dummy = (unsigned char *)calloc(1, 176 * 144); if ( dummy == NULL ) { tet_printf("Cannot allocated memory"); tet_result(TET_UNRESOLVED); return; } int err; face_image_h face_image; err = face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, NULL, 176, 144, 176 * 144, &face_image); dts_check_ne(szFunc, err, FACE_ERROR_NONE); face_image_destroy(face_image); free(dummy); } static void utc_uix_face_image_create_negative_03(void) { static const char szFunc[] = "face_image_create"; unsigned char *dummy = (unsigned char *)calloc(1, 176 * 144); if ( dummy == NULL ) { tet_printf("Cannot allocated memory"); tet_result(TET_UNRESOLVED); return; } int err; face_image_h face_image; err = face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, dummy, -1, 144, 176 * 144, &face_image); dts_check_ne(szFunc, err, FACE_ERROR_NONE); face_image_destroy(face_image); free(dummy); } static void utc_uix_face_image_create_negative_04(void) { static const char szFunc[] = "face_image_create"; unsigned char *dummy = (unsigned char *)calloc(1, 176 * 144); if ( dummy == NULL ) { tet_printf("Cannot allocated memory"); tet_result(TET_UNRESOLVED); return; } int err; face_image_h face_image; err = face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, dummy, 176, -1, 176 * 144, &face_image); dts_check_ne(szFunc, err, FACE_ERROR_NONE); face_image_destroy(face_image); free(dummy); } static void utc_uix_face_image_create_negative_05(void) { static const char szFunc[] = "face_image_create"; unsigned char *dummy = (unsigned char *)calloc(1, 176 * 144); if ( dummy == NULL ) { tet_printf("Cannot allocated memory"); tet_result(TET_UNRESOLVED); return; } int err; face_image_h face_image; err = face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, dummy, 176, 144, 176 * 144, NULL); dts_check_ne(szFunc, err, FACE_ERROR_NONE); face_image_destroy(face_image); free(dummy); } static void utc_uix_face_image_destroy_negative_01(void) { static const char szFunc[] = "face_image_destroy"; int err; err = face_image_destroy(NULL); dts_check_ne(szFunc, err, FACE_ERROR_NONE); } struct tet_testlist tet_testlist[] = { { utc_uix_face_image_create_negative_01, 1}, { utc_uix_face_image_create_negative_02, 1}, { utc_uix_face_image_create_negative_03, 1}, { utc_uix_face_image_create_negative_04, 1}, { utc_uix_face_image_create_negative_05, 1}, { utc_uix_face_image_destroy_negative_01, 2}, { NULL, 0}, };