forked from enlightenment/efl
edje_test: Make test_layout_get() configurable
This will help when we want to test different edj files Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
This commit is contained in:
parent
3e5ff22ab9
commit
a23ff7b5ab
|
@ -39,19 +39,23 @@ START_TEST(edje_test_edje_load)
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
test_layout_get(void)
|
test_layout_get(const char *name)
|
||||||
{
|
{
|
||||||
|
const char filename[PATH_MAX];
|
||||||
|
|
||||||
|
snprintf(filename, PATH_MAX, TESTS_BUILD_DIR"/data/%s", name);
|
||||||
|
|
||||||
static int is_local = -1;
|
static int is_local = -1;
|
||||||
if (is_local == -1)
|
if (is_local == -1)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
is_local = (stat(TESTS_BUILD_DIR"/data/test_layout.edj", &st) == 0);
|
is_local = (stat(filename, &st) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_local)
|
if (!is_local)
|
||||||
return TESTS_BUILD_DIR"/data/test_layout.edj";
|
snprintf(filename, PATH_MAX, PACKAGE_DATA_DIR"/data/%s", name);
|
||||||
else
|
|
||||||
return PACKAGE_DATA_DIR"/data/test_layout.edj";
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(edje_test_load_simple_layout)
|
START_TEST(edje_test_load_simple_layout)
|
||||||
|
@ -60,7 +64,7 @@ START_TEST(edje_test_load_simple_layout)
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
|
|
||||||
obj = edje_object_add(evas);
|
obj = edje_object_add(evas);
|
||||||
fail_unless(edje_object_file_set(obj, test_layout_get(), "test_group"));
|
fail_unless(edje_object_file_set(obj, test_layout_get("test_layout.edj"), "test_group"));
|
||||||
|
|
||||||
fail_if(edje_object_part_exists(obj, "unexistant_part"));
|
fail_if(edje_object_part_exists(obj, "unexistant_part"));
|
||||||
fail_unless(edje_object_part_exists(obj, "background"));
|
fail_unless(edje_object_part_exists(obj, "background"));
|
||||||
|
|
Loading…
Reference in New Issue