From: jiyong.min Date: Mon, 3 Aug 2020 23:07:17 +0000 (+0900) Subject: [UTC][capi-media-image-util][Non-ACR][Add invalid 'image_type' for negative test] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45c503f38a8c60e3fe028b20d8c255aadc297980;p=test%2Ftct%2Fnative%2Fapi.git [UTC][capi-media-image-util][Non-ACR][Add invalid 'image_type' for negative test] - When new 'image_type' is added, it is failed. So I add the invalid 'image_type' value to prevent TC failure. Change-Id: I275f586d154cc7cf8fbe2a18d1cb87219e1e235c --- diff --git a/src/utc/image-util/utc-image-util-decode-encode.c b/src/utc/image-util/utc-image-util-decode-encode.c index 0fe6330f4..a175abaa7 100755 --- a/src/utc/image-util/utc-image-util-decode-encode.c +++ b/src/utc/image-util/utc-image-util-decode-encode.c @@ -25,6 +25,8 @@ #define WRONG_PATH "" +#define INVALID_IMAGE_TYPE sizeof(image_util_type_e) + 1 /* +1 margin due to new type */ + static image_util_decode_h jpeg_decode_h = NULL; static image_util_encode_h jpeg_encode_h = NULL; static image_util_decode_h jpeg_decoded_h = NULL; @@ -475,8 +477,12 @@ int utc_image_util_foreach_supported_colorspace_n1(void) */ int utc_image_util_foreach_supported_colorspace_n2(void) { - int ret = image_util_foreach_supported_colorspace(sizeof(image_util_type_e), _image_util_supported_colorspace_cb, NULL); + int ret = image_util_foreach_supported_colorspace(-1, _image_util_supported_colorspace_cb, NULL); + assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER); + + ret = image_util_foreach_supported_colorspace(INVALID_IMAGE_TYPE, _image_util_supported_colorspace_cb, NULL); assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER); + return 0; } @@ -1792,9 +1798,13 @@ int utc_image_util_encode_create_n2(void) ret = image_util_encode_destroy(png_encode_h); assert_eq(ret, IMAGE_UTIL_ERROR_NONE); png_encode_h = NULL; + ret = image_util_encode_create(-1, &png_encode_h); assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER); + ret = image_util_encode_create(INVALID_IMAGE_TYPE, &png_encode_h); + assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER); + return 0; }