tests: Fix test suite
Introduce a new GcalStubCalendar class that essentially removes the ECalClient initialization from GcalCalendar, and use it as part of a new private library consumed by the tests.
This commit is contained in:
+5
-4
@@ -18,8 +18,9 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "utils/gcal-utils.h"
|
||||
#include "gcal-event.h"
|
||||
#include "gcal-stub-calendar.h"
|
||||
#include "gcal-utils.h"
|
||||
|
||||
#define STUB_EVENT "BEGIN:VEVENT\n" \
|
||||
"SUMMARY:Stub event\n" \
|
||||
@@ -55,12 +56,12 @@ create_event_for_string (const gchar *string,
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr (ECalComponent) component = NULL;
|
||||
g_autoptr (ESource) source = NULL;
|
||||
g_autoptr (GcalCalendar) calendar = NULL;
|
||||
|
||||
source = e_source_new_with_uid ("stub", NULL, error);
|
||||
component = e_cal_component_new_from_string (string);
|
||||
calendar = gcal_stub_calendar_new (NULL, error);
|
||||
|
||||
return component ? gcal_event_new (source, component, error) : NULL;
|
||||
return component ? gcal_event_new (calendar, component, error) : NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user