[geary/geary-0.12] Update testcase to fix failure introduced by commit da15ebe.



commit 1f7d3b4dd33f13d5dbbc9682ef3ff630aae8e366
Author: Michael James Gratton <mike vee net>
Date:   Thu Nov 16 10:23:08 2017 +1100

    Update testcase to fix failure introduced by commit da15ebe.

 test/engine/api/geary-attachment-test.vala |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/test/engine/api/geary-attachment-test.vala b/test/engine/api/geary-attachment-test.vala
index 00f4d02..5269c02 100644
--- a/test/engine/api/geary-attachment-test.vala
+++ b/test/engine/api/geary-attachment-test.vala
@@ -5,13 +5,16 @@
  * (version 2.1 or later). See the COPYING file in this distribution.
  */
 
+// Defined by CMake build script.
+extern const string _SOURCE_ROOT_DIR;
+
 class Geary.AttachmentTest : Gee.TestCase {
 
     private const string ATTACHMENT_ID = "test-id";
     private const string CONTENT_TYPE = "image/png";
     private const string CONTENT_ID = "test-content-id";
     private const string CONTENT_DESC = "Mea navis volitans anguillis plena est";
-    private const string FILE_PATH = "../icons/hicolor/16x16/apps/geary.png";
+    private const string FILE_PATH = "icons/hicolor/16x16/apps/org.gnome.Geary.png";
 
     private Mime.ContentType? content_type;
     private Mime.ContentType? default_type;
@@ -60,10 +63,9 @@ class Geary.AttachmentTest : Gee.TestCase {
             this.content_type = Mime.ContentType.deserialize(CONTENT_TYPE);
             this.default_type = Mime.ContentType.deserialize(Mime.ContentType.DEFAULT_CONTENT_TYPE);
             this.content_disposition = new Mime.ContentDisposition("attachment", null);
-            // XXX this will break as soon as the test runner is not
-            // launched from the project root dir
-            this.file = File.new_for_path("../icons/hicolor/16x16/apps/geary.png");
 
+            File source = File.new_for_path(_SOURCE_ROOT_DIR);
+            this.file = source.get_child(FILE_PATH);
         } catch (Error err) {
             assert_not_reached();
         }
@@ -222,9 +224,7 @@ class Geary.AttachmentTest : Gee.TestCase {
             CONTENT_DESC,
             content_disposition,
             TEST_FILENAME,
-            // XXX this will break as soon as the test runner is not
-            // launched from the project root dir
-            File.new_for_path("../icons/hicolor/16x16/apps/geary.png"),
+            this.file,
             742
         );
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]