From 3f31c8f72ef79e53332ab694c2e69f9d2b899f4f Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Wed, 3 Oct 2018 12:25:50 +0300 Subject: [PATCH] Suite: fix exu files comparison To compare two exu files during the test suite, we need to unpack the images in directories and make the comparison from there. The problem is that the "orig" exu file was unpacked in the current directory as well, leading to compare an image with itself. The fix consists in unpacking the right exu file. --- src/bin/exactness.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/exactness.c b/src/bin/exactness.c index b9b9062..2c3455c 100644 --- a/src/bin/exactness.c +++ b/src/bin/exactness.c @@ -170,12 +170,14 @@ _run_test_compare(const List_Entry *ent) sprintf(path, "%s/%s.exu", base_dir, ent->name); if (ecore_file_exists(path)) { - char *currentdir = alloca(strlen(_dest_dir) + 20); - sprintf(currentdir, "%s/%s", _dest_dir, CURRENT_SUBDIR); - _exu_imgs_unpack(path, currentdir, ent->name); + char *currentdir; sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR); mkdir(origdir, 0744); _exu_imgs_unpack(path, origdir, ent->name); + sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name); + currentdir = alloca(strlen(_dest_dir) + 20); + sprintf(currentdir, "%s/%s", _dest_dir, CURRENT_SUBDIR); + _exu_imgs_unpack(path, currentdir, ent->name); goto found; } else