Blame SOURCES/evolution-data-server-3.28.5-test-cal-meta-backend-without-evolution.patch

6f8338
diff -up evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics
6f8338
--- evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution	2020-01-16 08:28:52.842204524 +0100
6f8338
+++ evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics	2020-01-16 08:30:30.726203170 +0100
6f8338
@@ -6,7 +6,7 @@ DTEND;TZID=/freeassociation.sourceforge.
6f8338
 SEQUENCE:1
6f8338
 SUMMARY:With attachment
6f8338
 TRANSP:OPAQUE
6f8338
-ATTACH:file:///usr/share/icons/hicolor/48x48/apps/evolution.png
6f8338
+ATTACH:$EVENT1URI$
6f8338
 CLASS:PUBLIC
6f8338
 CREATED:20170221T125054Z
6f8338
 LAST-MODIFIED:20170221T125054Z
6f8338
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c
6f8338
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution	2018-07-30 15:17:06.000000000 +0200
6f8338
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c	2020-01-16 08:28:52.842204524 +0100
6f8338
@@ -114,13 +114,10 @@ tcu_fixture_teardown (TCUFixture *fixtur
6f8338
 }
6f8338
 
6f8338
 gchar *
6f8338
-tcu_new_icalstring_from_test_case (const gchar *case_name)
6f8338
+tcu_get_test_case_filename (const gchar *case_name)
6f8338
 {
6f8338
 	gchar *filename;
6f8338
 	gchar *case_filename;
6f8338
-	GFile * file;
6f8338
-	GError *error = NULL;
6f8338
-	gchar *icalstring = NULL;
6f8338
 
6f8338
 	case_filename = g_strdup_printf ("%s.ics", case_name);
6f8338
 
6f8338
@@ -132,16 +129,48 @@ tcu_new_icalstring_from_test_case (const
6f8338
 	else
6f8338
 		filename = g_build_filename (SRCDIR, "..", "libedata-cal", "components", case_filename, NULL);
6f8338
 
6f8338
+	g_free (case_filename);
6f8338
+
6f8338
+	return filename;
6f8338
+}
6f8338
+
6f8338
+gchar *
6f8338
+tcu_new_icalstring_from_test_case (const gchar *case_name)
6f8338
+{
6f8338
+	gchar *filename;
6f8338
+	GFile * file;
6f8338
+	GError *error = NULL;
6f8338
+	gchar *icalstring = NULL, *uripart;
6f8338
+
6f8338
+	filename = tcu_get_test_case_filename (case_name);
6f8338
+
6f8338
 	file = g_file_new_for_path (filename);
6f8338
 	if (!g_file_load_contents (file, NULL, &icalstring, NULL, NULL, &error))
6f8338
 		g_error (
6f8338
 			"Failed to read test iCal string file '%s': %s",
6f8338
 			filename, error->message);
6f8338
 
6f8338
-	g_free (case_filename);
6f8338
 	g_free (filename);
6f8338
 	g_object_unref (file);
6f8338
 
6f8338
+	uripart = strstr (icalstring, "$EVENT1URI$");
6f8338
+	if (uripart) {
6f8338
+		gchar *uri;
6f8338
+		GString *str;
6f8338
+
6f8338
+		filename = tcu_get_test_case_filename ("event-1");
6f8338
+		uri = g_filename_to_uri (filename, NULL, NULL);
6f8338
+		g_free (filename);
6f8338
+
6f8338
+		str = g_string_new_len (icalstring, uripart - icalstring);
6f8338
+		g_string_append (str, uri);
6f8338
+		g_string_append (str, uripart + 11);
6f8338
+		g_free (icalstring);
6f8338
+		g_free (uri);
6f8338
+
6f8338
+		icalstring = g_string_free (str, FALSE);
6f8338
+	}
6f8338
+
6f8338
 	return icalstring;
6f8338
 }
6f8338
 
6f8338
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h
6f8338
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution	2018-07-30 15:17:06.000000000 +0200
6f8338
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h	2020-01-16 08:28:52.842204524 +0100
6f8338
@@ -46,6 +46,7 @@ ECalComponent *	tcu_new_component_from_t
6f8338
 void		tcu_add_component_from_test_case	(TCUFixture *fixture,
6f8338
 							 const gchar *case_name,
6f8338
 							 ECalComponent **out_component);
6f8338
+gchar *		tcu_get_test_case_filename		(const gchar *case_name);
6f8338
 
6f8338
 G_END_DECLS
6f8338
 
6f8338
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c
6f8338
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution	2018-07-30 15:17:06.000000000 +0200
6f8338
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c	2020-01-16 08:28:52.842204524 +0100
6f8338
@@ -1274,6 +1274,7 @@ static void
6f8338
 test_get_attachment_uris (ECalMetaBackend *meta_backend)
6f8338
 {
6f8338
 	ECalBackendSyncClass *backend_class;
6f8338
+	gchar *expected_uri, *filename;
6f8338
 	GSList *uris = NULL;
6f8338
 	GError *error = NULL;
6f8338
 
6f8338
@@ -1306,7 +1307,13 @@ test_get_attachment_uris (ECalMetaBacken
6f8338
 	g_assert_no_error (error);
6f8338
 	g_assert_nonnull (uris);
6f8338
 	g_assert_cmpint (g_slist_length (uris), ==, 1);
6f8338
-	g_assert_cmpstr (uris->data, ==, "file:///usr/share/icons/hicolor/48x48/apps/evolution.png");
6f8338
+
6f8338
+	filename = tcu_get_test_case_filename ("event-1");
6f8338
+	expected_uri = g_filename_to_uri (filename, NULL, NULL);
6f8338
+	g_free (filename);
6f8338
+
6f8338
+	g_assert_cmpstr (uris->data, ==, expected_uri);
6f8338
+	g_free (expected_uri);
6f8338
 
6f8338
 	g_slist_free_full (uris, g_free);
6f8338
 }