static Evas_Object *main_win;
static Evas_Object *image;
+static void *map = NULL;
+static Eina_File* file = NULL;
+static size_t filesize = 0;
+
+
/**
*
* @addtogroup elm_image
UTC_ELM_INIT();
main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
evas_object_show(main_win);
+
+ file = eina_file_open("image/image_home.png", EINA_FALSE);
+ if (!file)
+ {
+ ck_abort_msg("[TET_MSG]:: %s[%d] : Eina_File is not opened..", __FILE__, __LINE__);
+ return;
+ }
+ filesize = eina_file_size_get(file);
+ map = eina_file_map_all(file, EINA_FILE_SEQUENTIAL);
+
+ if (!map)
+ {
+ ck_abort_msg("[TET_MSG]:: %s[%d] : Image is not loaded from file..", __FILE__, __LINE__);
+ file = NULL;
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ return;
+ }
}
static void
teardown(void)
{
+ eina_file_map_free(file, map);
+ eina_file_close(file);
+
if (NULL != main_win)
{
evas_object_del(main_win);
START_TEST(utc_UIFW_elm_image_memfile_set_p_1)
{
image = elm_image_add(main_win);
- int mydata[] = {
- 0x00000000, 0x88888888, 0x00000000, 0x88888888, 0x00000000, 0x88888888, 0x00000000, 0x88888888,
- 0xffff0000, 0xffffffff, 0xffff0000, 0xffffffff, 0xffff0000, 0xffffffff, 0xffff0000, 0xffffffff
- };
-
- if (EINA_TRUE != elm_image_memfile_set(image, mydata, 16 * sizeof(int), "png", NULL))
+ if (EINA_TRUE != elm_image_memfile_set(image, map, filesize, NULL, NULL))
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
}
{
image = elm_image_add(main_win);
elm_image_file_set(image, "image/image_home.png", "icon");
- int mydata[] = {
- 0x00000000, 0x88888888, 0x00000000, 0x88888888, 0x00000000, 0x88888888, 0x00000000, 0x88888888,
- 0xffff0000, 0xffffffff, 0xffff0000, 0xffffffff, 0xffff0000, 0xffffffff, 0xffff0000, 0xffffffff
- };
if ((EINA_FALSE == elm_image_memfile_set(NULL, NULL, 0, NULL, NULL)) &&
(EINA_FALSE == elm_image_memfile_set(image, NULL, 0, NULL, NULL)) &&
- (EINA_FALSE == elm_image_memfile_set(NULL, mydata, 0, NULL, NULL))) {
+ (EINA_FALSE == elm_image_memfile_set(NULL, map, filesize, NULL, NULL))) {
printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__,__LINE__);
}
else