//& set: MetadataEditor
metadata_editor_attr_e g_attribute[] = {
- METADATA_EDITOR_ATTR_ARTIST,
- METADATA_EDITOR_ATTR_TITLE,
- METADATA_EDITOR_ATTR_ALBUM,
- METADATA_EDITOR_ATTR_GENRE,
- METADATA_EDITOR_ATTR_AUTHOR,
- METADATA_EDITOR_ATTR_COPYRIGHT,
- METADATA_EDITOR_ATTR_DATE,
- METADATA_EDITOR_ATTR_DESCRIPTION,
- METADATA_EDITOR_ATTR_COMMENT,
- METADATA_EDITOR_ATTR_TRACK_NUM,
- METADATA_EDITOR_ATTR_CONDUCTOR,
+ METADATA_EDITOR_ATTR_ARTIST,
+ METADATA_EDITOR_ATTR_TITLE,
+ METADATA_EDITOR_ATTR_ALBUM,
+ METADATA_EDITOR_ATTR_GENRE,
+ METADATA_EDITOR_ATTR_AUTHOR,
+ METADATA_EDITOR_ATTR_COPYRIGHT,
+ METADATA_EDITOR_ATTR_DATE,
+ METADATA_EDITOR_ATTR_DESCRIPTION,
+ METADATA_EDITOR_ATTR_COMMENT,
+ METADATA_EDITOR_ATTR_TRACK_NUM,
+ METADATA_EDITOR_ATTR_CONDUCTOR,
METADATA_EDITOR_ATTR_UNSYNCLYRICS
};
* @description Called before each test
* @parameter NA
* @return NA
- */
+ */
void ITs_metadata_editor_startup(void)
{
- struct stat stBuff;
+ struct stat stBuff;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
remove(ERR_LOG);
char szAudioFilePath[PATH_LEN] = {0,};
int nRet = metadata_editor_create(&g_hMetadataEditorHandle );
-
+
if ( nRet != METADATA_EDITOR_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] metadata_editor_create failed\\n", __LINE__, API_NAMESPACE);
Metadata_EditorGetError(nRet);
return;
- }
+ }
if ( false == MetadataEditorAppendToAppDataPath(MEDIA_AUDIO_PATH, szAudioFilePath) )
{
FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
metadata_editor_destroy(g_hMetadataEditorHandle);
return;
- }
+ }
nRet = metadata_editor_set_path(g_hMetadataEditorHandle, szAudioFilePath);
-
+
if ( nRet != METADATA_EDITOR_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] metadata_editor_set_path failed\\n", __LINE__, API_NAMESPACE);
metadata_editor_destroy(g_hMetadataEditorHandle);
Metadata_EditorGetError(nRet);
return;
- }
+ }
return;
}
* @description Called after each test
* @parameter NA
* @return NA
- */
+ */
void ITs_metadata_editor_cleanup(void)
{
int nRet = metadata_editor_destroy(g_hMetadataEditorHandle);
-
+
if ( nRet != METADATA_EDITOR_ERROR_NONE )
{
FPRINTF("[Line : %d][%s] metadata_editor_destroy failed\\n", __LINE__, API_NAMESPACE);
Metadata_EditorGetError(nRet);
return;
- }
+ }
return;
}
{
START_TEST;
metadata_editor_h hMetadata;
+
int nRet = metadata_editor_create(&hMetadata);
- PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_create", Metadata_EditorGetError(nRet));
+ PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_create", Metadata_EditorGetError(nRet));
char szAudioFilePath[PATH_LEN] = {0,};
if ( false == MetadataEditorAppendToAppDataPath(MEDIA_AUDIO_PATH, szAudioFilePath) )
FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
metadata_editor_destroy(hMetadata);
return 1;
- }
+ }
nRet = metadata_editor_set_path(hMetadata, szAudioFilePath);
- PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+
+ char szWavFilePath[PATH_LEN] = {0,};
+ if ( false == MetadataEditorAppendToAppDataPath(MEDIA_WAV_PATH, szWavFilePath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ metadata_editor_destroy(g_hMetadataEditorHandle);
+ return 1;
+ }
+
+ nRet = metadata_editor_set_path(hMetadata, szWavFilePath);
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+
+ char szFlacFilePath[PATH_LEN] = {0,};
+ if ( false == MetadataEditorAppendToAppDataPath(MEDIA_FLAC_PATH, szFlacFilePath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ metadata_editor_destroy(g_hMetadataEditorHandle);
+ return 1;
+ }
+
+ nRet = metadata_editor_set_path(hMetadata, szFlacFilePath);
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+
+ char szOggFilePath[PATH_LEN] = {0,};
+ if ( false == MetadataEditorAppendToAppDataPath(MEDIA_OGG_PATH, szOggFilePath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ metadata_editor_destroy(g_hMetadataEditorHandle);
+ return 1;
+ }
+
+ nRet = metadata_editor_set_path(hMetadata, szOggFilePath);
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
nRet = metadata_editor_destroy(hMetadata);
- PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_destroy", Metadata_EditorGetError(nRet));
+ PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_destroy", Metadata_EditorGetError(nRet));
+
return 0;
}
* @author SRID(a.ankush)
* @reviewer SRID(gupta.sanjay)
* @type auto
- * @description Sets a file path for meta-data extraction.
+ * @description Sets a file path for meta-data extraction.
* @scenario Before getting artwork of file need to set file path.
* @apicovered metadata_editor_set_path
* @passcase When metadata_editor_set_path is successful
int ITc_metadata_editor_set_path_p(void)
{
START_TEST;
- char szAudioFilePath[PATH_LEN] = {0,};
-
+ char szAudioFilePath[PATH_LEN] = {0,};
if ( false == MetadataEditorAppendToAppDataPath(MEDIA_AUDIO_PATH, szAudioFilePath) )
{
FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
return 1;
- }
+ }
int nRet = metadata_editor_set_path(g_hMetadataEditorHandle,szAudioFilePath );
PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet));
-
+ char szWavFilePath[PATH_LEN] = {0,};
+ if ( false == MetadataEditorAppendToAppDataPath(MEDIA_WAV_PATH, szWavFilePath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ metadata_editor_destroy(g_hMetadataEditorHandle);
+ return 1;
+ }
+
+ nRet = metadata_editor_set_path(g_hMetadataEditorHandle,szWavFilePath );
+ PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet));
+
+ char szFlacFilePath[PATH_LEN] = {0,};
+ if ( false == MetadataEditorAppendToAppDataPath(MEDIA_FLAC_PATH, szFlacFilePath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ metadata_editor_destroy(g_hMetadataEditorHandle);
+ return 1;
+ }
+
+ nRet = metadata_editor_set_path(g_hMetadataEditorHandle, szFlacFilePath);
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadataEditorHandle));
+
+ char szOggFilePath[PATH_LEN] = {0,};
+ if ( false == MetadataEditorAppendToAppDataPath(MEDIA_OGG_PATH, szOggFilePath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ metadata_editor_destroy(g_hMetadataEditorHandle);
+ return 1;
+ }
+
+ nRet = metadata_editor_set_path(g_hMetadataEditorHandle, szOggFilePath);
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadataEditorHandle));
+
return 0;
}
-//& purpose: Gets meta-data and sets meta-data of multimedia file.
+//& purpose: Gets meta-data and sets meta-data of multimedia file.
//& type: auto
/**
* @testcase ITc_metadata_editor_set_get_metadata_p
* @author SRID(a.ankush)
* @reviewer SRID(gupta.sanjay)
* @type auto
- * @description Gets meta-data and sets meta-data of multimedia file.
- * @scenario Before getting artwork of file need to set file path.
+ * @description Gets meta-data and sets meta-data of multimedia file.
+ * @scenario Before getting artwork of file need to set file path.
* @apicovered metadata_editor_get_metadata ,metadata_editor_set_metadata.
* @passcase When metadata_editor_set_metadata & metadata_editor_get_metadata is successful
* @failcase If metadata_editor_set_metadata or metadata_editor_get_metadata fails
int i = 0;
for( i = 0; i < (sizeof(g_attribute)/sizeof(int)); ++i)
{
- nRet = metadata_editor_set_metadata(g_hMetadataEditorHandle, g_attribute[i], input_data );
+ nRet = metadata_editor_set_metadata(g_hMetadataEditorHandle, g_attribute[i], input_data );
PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_metadata", Metadata_EditorGetError(nRet));
nRet = metadata_editor_get_metadata(g_hMetadataEditorHandle, g_attribute[i], &pMetadataInfo );
-
+
//check for value mis-match
if ( 0 != strcmp(input_data, pMetadataInfo) )
{
FREE_MEMORY(pMetadataInfo);
return 1;
}
-
+
FREE_MEMORY(pMetadataInfo);
PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_get_metadata", Metadata_EditorGetError(nRet));
}
return 0;
}
-//& purpose: Updates meta-data of multimedia file.
+//& purpose: Updates meta-data of multimedia file.
//& type: auto
/**
* @testcase ITc_metadata_editor_update_metadata_p
* @author SRID(a.ankush)
* @reviewer SRID(gupta.sanjay)
* @type auto
- * @description Updates meta-data of multimedia file.
+ * @description Updates meta-data of multimedia file.
* @scenario Before getting artwork of file need to set file path\n
- * Set or change meta-data attribute of multimedia file.
+ * Set or change meta-data attribute of multimedia file.
* @apicovered metadata_editor_set_metadata,metadata_editor_update_metadata.
* @passcase When metadata_editor_set_metadata and metadata_editor_update_metadata is successful.
* @failcase If metadata_editor_set_metadata and metadata_editor_update_metadata fails.
return 0;
}
-//& purpose: Append the picture to the media file.
+//& purpose: Append the picture to the media file.
//& type: auto
/**
* @testcase ITc_metadata_editor_get_picture_p
* @author SRID(a.ankush)
* @reviewer SRID(gupta.sanjay)
* @type auto
- * @description Append the picture to the media file.
- * @scenario Before getting artwork of file need to set file path.
+ * @description Append the picture to the media file.
+ * @scenario Before getting artwork of file need to set file path.
* @apicovered metadata_editor_append_picture.
* @passcase When metadata_editor_append_picture is successful.
* @failcase If metadata_editor_append_picture fails.
return 0;
}
-//& purpose: Get the picture in the multimedia file.
+//& purpose: Get the picture in the multimedia file.
//& type: auto
/**
* @testcase ITc_metadata_editor_get_picture_p
* @author SRID(a.ankush)
* @reviewer SRID(gupta.sanjay)
* @type auto
- * @description Get the picture in the multimedia file.
+ * @description Get the picture in the multimedia file.
* @scenario Before getting artwork of file need to set file path\n
* Get the picture index attribute from the multimedia file.
* @apicovered metadata_editor_get_metadata,metadata_editor_get_picture.
}
void *picture_val = NULL;
nRet = metadata_editor_set_path(g_hMetadata_local, szAudioFilePath);
- PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadata_local));
+ PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadata_local));
nRet = metadata_editor_get_metadata(g_hMetadata_local, attribute, &picture_index);
PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_get_metadata", Metadata_EditorGetError(nRet),metadata_editor_destroy(g_hMetadata_local));
return 0;
}
-//& purpose: Remove artwork image from media file.
+//& purpose: Remove artwork image from media file.
//& type: auto
/**
- * @testcase ITc_metadata_editor_get_picture_p
+ * @testcase ITc_metadata_editor_remove_picture_p
* @since_tizen 2.3
* @author SRID(a.ankush)
* @reviewer SRID(gupta.sanjay)
* @type auto
- * @description Remove artwork image from media file.
- * @scenario Before getting artwork of file need to set file path.
+ * @description Remove artwork image from media file.
+ * @scenario Before getting artwork of file need to set file path.
* @apicovered metadata_editor_remove_picture.
* @passcase When metadata_editor_remove_picture is successful.
* @failcase If metadata_editor_remove_picture fails.
}
/** @} */ //end of itc-metadata-editor
-/** @} */ //end of itc-metadata-editor-testcases
\ No newline at end of file
+/** @} */ //end of itc-metadata-editor-testcases