summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-29 10:07:53 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:58:57 -0400
commitfb1a055f13c4666b4bb785cf7633fa778c7a74c0 (patch)
tree9d81364d0b62be6f3c40a35725e9c31f9f0cab18
parent07d8223005de648c9d61deca7f0a37d15dfd56c0 (diff)
tests/evas: prune directory scan in mesh loader/saver test
this test should use a hardcoded list of files, but until it does we can at least attempt to reduce failure rates which may occur from random garbage in the tree ref T6857 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10552
-rw-r--r--src/tests/evas/evas_test_mesh.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c
index c413f731ca..3bf3c3032d 100644
--- a/src/tests/evas/evas_test_mesh.c
+++ b/src/tests/evas/evas_test_mesh.c
@@ -92,7 +92,7 @@ static int _compare_meshes(Evas_Canvas3D_Mesh *mesh1, Evas_Canvas3D_Mesh *mesh2)
92} 92}
93 93
94static void 94static void
95check_meshes_in_folder(Eina_Tmpstr *tmp, const char *folder, const char *ext) 95check_meshes_in_folder(Eina_Tmpstr *tmp, const char *folder, const char *loadext, const char *ext)
96{ 96{
97 char buffer[PATH_MAX]; 97 char buffer[PATH_MAX];
98 Evas *e = _setup_evas(); 98 Evas *e = _setup_evas();
@@ -108,6 +108,8 @@ check_meshes_in_folder(Eina_Tmpstr *tmp, const char *folder, const char *ext)
108 const Eina_File *f_get = NULL; 108 const Eina_File *f_get = NULL;
109 const char *filename = NULL; 109 const char *filename = NULL;
110 const char *key = NULL; 110 const char *key = NULL;
111 if (file->path[file->name_start] == '.') continue; //some hidden git file or whatever
112 if (!eina_str_has_extension(file->path + file->name_start, loadext)) continue; //some other file
111 mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); 113 mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, e);
112 mesh2 = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); 114 mesh2 = efl_add(EVAS_CANVAS3D_MESH_CLASS, e);
113 fail_if(mesh == NULL); 115 fail_if(mesh == NULL);
@@ -156,13 +158,14 @@ EFL_START_TEST(evas_object_mesh_loader_saver)
156 struct 158 struct
157 { 159 {
158 const char *dir; 160 const char *dir;
159 const char *fmt; 161 const char *loadfmt;
162 const char *savefmt;
160 } values[4] = 163 } values[4] =
161 { 164 {
162 { TESTS_OBJ_MESH_DIR, ".eet" }, 165 { TESTS_OBJ_MESH_DIR, ".obj", ".eet" },
163 { TESTS_MD2_MESH_DIR, ".eet" }, 166 { TESTS_MD2_MESH_DIR, ".md2", ".eet" },
164 { TESTS_PLY_MESH_DIR, ".eet" }, 167 { TESTS_PLY_MESH_DIR, ".ply", ".eet" },
165 { TESTS_PLY_MESH_DIR, ".ply" }, 168 { TESTS_PLY_MESH_DIR, ".ply", ".ply" },
166 }; 169 };
167 170
168 /* create tmp file name, assume tmp.eet and tmp.ply also work */ 171 /* create tmp file name, assume tmp.eet and tmp.ply also work */
@@ -170,7 +173,7 @@ EFL_START_TEST(evas_object_mesh_loader_saver)
170 fail_if(tmpfd == -1); 173 fail_if(tmpfd == -1);
171 fail_if(!!close(tmpfd)); 174 fail_if(!!close(tmpfd));
172 175
173 check_meshes_in_folder(tmp, values[_i].dir, values[_i].fmt); 176 check_meshes_in_folder(tmp, values[_i].dir, values[_i].loadfmt, values[_i].savefmt);
174 177
175 unlink(tmp); 178 unlink(tmp);
176 179