forked from enlightenment/efl
tests: use loop test to split jpeg tests from evas_object_image_all_loader_data
Summary: jpeg loader tests take 4+ seconds due to manual value comparisons, so ensure that they run separately ref T6856 Reviewers: stefan_schmidt Subscribers: cedric Maniphest Tasks: T6856 Differential Revision: https://phab.enlightenment.org/D5911
This commit is contained in:
parent
c943c4a2ff
commit
22cb35c9a4
|
@ -17,6 +17,7 @@ static const Efl_Test_Case etc[] = {
|
||||||
{ "Render Engines", evas_test_render_engines },
|
{ "Render Engines", evas_test_render_engines },
|
||||||
{ "Filters", evas_test_filters },
|
{ "Filters", evas_test_filters },
|
||||||
{ "Images", evas_test_image_object },
|
{ "Images", evas_test_image_object },
|
||||||
|
{ "Images", evas_test_image_object2 },
|
||||||
{ "Meshes", evas_test_mesh },
|
{ "Meshes", evas_test_mesh },
|
||||||
{ "Masking", evas_test_mask },
|
{ "Masking", evas_test_mask },
|
||||||
{ "Evas GL", evas_test_evasgl },
|
{ "Evas GL", evas_test_evasgl },
|
||||||
|
|
|
@ -11,6 +11,7 @@ void evas_test_callbacks(TCase *tc);
|
||||||
void evas_test_render_engines(TCase *tc);
|
void evas_test_render_engines(TCase *tc);
|
||||||
void evas_test_filters(TCase *tc);
|
void evas_test_filters(TCase *tc);
|
||||||
void evas_test_image_object(TCase *tc);
|
void evas_test_image_object(TCase *tc);
|
||||||
|
void evas_test_image_object2(TCase *tc);
|
||||||
void evas_test_mesh(TCase *tc);
|
void evas_test_mesh(TCase *tc);
|
||||||
void evas_test_mask(TCase *tc);
|
void evas_test_mask(TCase *tc);
|
||||||
void evas_test_evasgl(TCase *tc);
|
void evas_test_evasgl(TCase *tc);
|
||||||
|
|
|
@ -38,10 +38,6 @@ static const char *exts[] = {
|
||||||
#ifdef BUILD_LOADER_WEBP
|
#ifdef BUILD_LOADER_WEBP
|
||||||
,"webp"
|
,"webp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_LOADER_JPEG
|
|
||||||
,"jpeg"
|
|
||||||
,"jpg"
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_LOADER_TGV
|
#ifdef BUILD_LOADER_TGV
|
||||||
,"tgv"
|
,"tgv"
|
||||||
#endif
|
#endif
|
||||||
|
@ -49,6 +45,13 @@ static const char *exts[] = {
|
||||||
,"jp2"
|
,"jp2"
|
||||||
,"j2k"
|
,"j2k"
|
||||||
#endif
|
#endif
|
||||||
|
/* ADD NEW FORMATS HERE
|
||||||
|
* JPEG MUST BE LAST
|
||||||
|
*/
|
||||||
|
#ifdef BUILD_LOADER_JPEG
|
||||||
|
,"jpeg"
|
||||||
|
,"jpg"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
EFL_START_TEST(evas_object_image_loader)
|
EFL_START_TEST(evas_object_image_loader)
|
||||||
|
@ -396,24 +399,20 @@ EFL_START_TEST(evas_object_image_all_loader_data)
|
||||||
Evas *e = _setup_evas();
|
Evas *e = _setup_evas();
|
||||||
Evas_Object *obj, *ref;
|
Evas_Object *obj, *ref;
|
||||||
Eina_Strbuf *str;
|
Eina_Strbuf *str;
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
obj = evas_object_image_add(e);
|
|
||||||
ref = evas_object_image_add(e);
|
|
||||||
str = eina_strbuf_new();
|
|
||||||
|
|
||||||
for (i = 0; i < sizeof (exts) / sizeof (exts[0]); i++)
|
|
||||||
{
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int w, h, s, r_w, r_h, r_s;
|
int w, h, s, r_w, r_h, r_s;
|
||||||
const uint32_t *d, *r_d;
|
const uint32_t *d, *r_d;
|
||||||
Evas_Colorspace c, r_c;
|
Evas_Colorspace c, r_c;
|
||||||
|
|
||||||
|
obj = evas_object_image_add(e);
|
||||||
|
ref = evas_object_image_add(e);
|
||||||
|
str = eina_strbuf_new();
|
||||||
|
|
||||||
eina_strbuf_reset(str);
|
eina_strbuf_reset(str);
|
||||||
|
|
||||||
eina_strbuf_append_printf(str, "%s/Pic4-%s.png", TESTS_IMG_DIR, exts[i]);
|
eina_strbuf_append_printf(str, "%s/Pic4-%s.png", TESTS_IMG_DIR, exts[_i]);
|
||||||
|
|
||||||
if (stat(eina_strbuf_string_get(str), &st) != 0) continue;
|
if (stat(eina_strbuf_string_get(str), &st) != 0) goto end;
|
||||||
|
|
||||||
evas_object_image_file_set(obj, eina_strbuf_string_get(str), NULL);
|
evas_object_image_file_set(obj, eina_strbuf_string_get(str), NULL);
|
||||||
fail_if(evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE);
|
fail_if(evas_object_image_load_error_get(obj) != EVAS_LOAD_ERROR_NONE);
|
||||||
|
@ -424,7 +423,7 @@ EFL_START_TEST(evas_object_image_all_loader_data)
|
||||||
|
|
||||||
eina_strbuf_reset(str);
|
eina_strbuf_reset(str);
|
||||||
|
|
||||||
eina_strbuf_append_printf(str, "%s/Pic4.%s", TESTS_IMG_DIR, exts[i]);
|
eina_strbuf_append_printf(str, "%s/Pic4.%s", TESTS_IMG_DIR, exts[_i]);
|
||||||
evas_object_image_file_set(ref, eina_strbuf_string_get(str), NULL);
|
evas_object_image_file_set(ref, eina_strbuf_string_get(str), NULL);
|
||||||
fail_if(evas_object_image_load_error_get(ref) != EVAS_LOAD_ERROR_NONE);
|
fail_if(evas_object_image_load_error_get(ref) != EVAS_LOAD_ERROR_NONE);
|
||||||
evas_object_image_size_get(ref, &r_w, &r_h);
|
evas_object_image_size_get(ref, &r_w, &r_h);
|
||||||
|
@ -436,7 +435,7 @@ EFL_START_TEST(evas_object_image_all_loader_data)
|
||||||
fail_if(s != r_s);
|
fail_if(s != r_s);
|
||||||
fail_if(c != r_c);
|
fail_if(c != r_c);
|
||||||
fail_if(w*4 != s);
|
fail_if(w*4 != s);
|
||||||
if (strcmp(exts[i], "jpeg") == 0 || strcmp(exts[i], "jpg") == 0)
|
if (strcmp(exts[_i], "jpeg") == 0 || strcmp(exts[_i], "jpg") == 0)
|
||||||
{
|
{
|
||||||
//jpeg norm allows a variation of 1 bit per component
|
//jpeg norm allows a variation of 1 bit per component
|
||||||
for (int j = 0; j < s * h; j++)
|
for (int j = 0; j < s * h; j++)
|
||||||
|
@ -448,8 +447,7 @@ EFL_START_TEST(evas_object_image_all_loader_data)
|
||||||
{
|
{
|
||||||
fail_if(memcmp(d, r_d, w * h * 4));
|
fail_if(memcmp(d, r_d, w * h * 4));
|
||||||
}
|
}
|
||||||
}
|
end:
|
||||||
|
|
||||||
evas_object_del(obj);
|
evas_object_del(obj);
|
||||||
evas_object_del(ref);
|
evas_object_del(ref);
|
||||||
|
|
||||||
|
@ -883,9 +881,25 @@ void evas_test_image_object(TCase *tc)
|
||||||
# if BUILD_LOADER_JP2K
|
# if BUILD_LOADER_JP2K
|
||||||
tcase_add_test(tc, evas_object_image_jp2k_loader_data);
|
tcase_add_test(tc, evas_object_image_jp2k_loader_data);
|
||||||
# endif
|
# endif
|
||||||
tcase_add_test(tc, evas_object_image_all_loader_data);
|
#ifdef BUILD_LOADER_JPEG
|
||||||
|
/* jpeg takes forever from manual value comparisons */
|
||||||
|
tcase_add_loop_test(tc, evas_object_image_all_loader_data, 0, EINA_C_ARRAY_LENGTH(exts) - 2);
|
||||||
|
#else
|
||||||
|
tcase_add_loop_test(tc, evas_object_image_all_loader_data, 0, EINA_C_ARRAY_LENGTH(exts));
|
||||||
|
#endif
|
||||||
tcase_add_test(tc, evas_object_image_buggy);
|
tcase_add_test(tc, evas_object_image_buggy);
|
||||||
tcase_add_test(tc, evas_object_image_map_unmap);
|
tcase_add_test(tc, evas_object_image_map_unmap);
|
||||||
#endif
|
#endif
|
||||||
tcase_add_test(tc, evas_object_image_partially_load_orientation);
|
tcase_add_test(tc, evas_object_image_partially_load_orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void evas_test_image_object2(TCase *tc)
|
||||||
|
{
|
||||||
|
#if BUILD_LOADER_PNG
|
||||||
|
#ifdef BUILD_LOADER_JPEG
|
||||||
|
/* jpeg takes forever from manual value comparisons */
|
||||||
|
tcase_add_loop_test(tc, evas_object_image_all_loader_data, EINA_C_ARRAY_LENGTH(exts) - 2, EINA_C_ARRAY_LENGTH(exts));
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue