From a9056a9b3126051fcca961542ec9c376958ed92d Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Mon, 27 Feb 2017 20:11:02 +0900 Subject: [PATCH] Add error log for validation failure [Version] 0.2.100 [Profile] Common [Issue Type] Update [Dependency module] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20170227.2] Change-Id: Ia7912d9bdc3739e7fa3fe0605501010cbaa7f7b0 Signed-off-by: Jeongmo Yang --- mm_attrs.c | 3 +++ mm_attrs_private.c | 10 ++++++++-- packaging/libmm-common.spec | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mm_attrs.c b/mm_attrs.c index fefd2d9..a0353cd 100644 --- a/mm_attrs.c +++ b/mm_attrs.c @@ -118,6 +118,9 @@ int mm_attrs_get_index(MMHandleType h, const char *attrname, int *index) return MM_ERROR_NONE; } } + + debug_error("failed to get index for [%s]", attrname); + return MM_ERROR_COMMON_OUT_OF_ARRAY; } diff --git a/mm_attrs_private.c b/mm_attrs_private.c index f239b05..e79907e 100644 --- a/mm_attrs_private.c +++ b/mm_attrs_private.c @@ -347,7 +347,9 @@ bool mmf_attribute_validate_int(mmf_attribute_t *item, int val) if (val < item->value_spec.spec.int_spec.range.min || val > item->value_spec.spec.int_spec.range.max) { valid = false; - //mmf_debug(MMF_DEBUG_LOG, "[mmf_attribute:%s] out of range\n", item->name); + debug_error("[mmf_attribute:%s] out of range[min %d, max %d, set %d]", + item->name, item->value_spec.spec.int_spec.range.min, + item->value_spec.spec.int_spec.range.max, val); } break; case MMF_VALUE_SPEC_INT_ARRAY: @@ -359,7 +361,11 @@ bool mmf_attribute_validate_int(mmf_attribute_t *item, int val) } } if (!valid) { - //mmf_debug(MMF_DEBUG_LOG, "[mmf_attribute:%s] out of array\n", item->name); + debug_error("[mmf_attribute:%s] out of array, set %d", item->name, val); + for (i = 0; i < item->value_spec.spec.int_spec.array.count; i++) { + debug_error("array[index %d] value [%d]", + i, item->value_spec.spec.int_spec.array.array[i]); + } } break; default: diff --git a/packaging/libmm-common.spec b/packaging/libmm-common.spec index 7bb459b..2d96969 100644 --- a/packaging/libmm-common.spec +++ b/packaging/libmm-common.spec @@ -1,6 +1,6 @@ Name: libmm-common Summary: Multimedia Framework Common Lib -Version: 0.2.99 +Version: 0.2.100 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 -- 2.7.4