/* synchronously in idle with main-loop running */
static gboolean
test_sync_in_idle (gpointer user_data)
{
	ECalClient *cal_client = user_data;
	icalcomponent *icalcomp;

	g_return_val_if_fail (cal_client != NULL, FALSE);
	g_return_val_if_fail (E_IS_CAL_CLIENT (cal_client), FALSE);

	if (!test_sync (cal_client)) {
		stop_main_loop (1);
		return FALSE;
	}

	icalcomp = create_object ();
	if (!icalcomp) {
		stop_main_loop (1);
		return FALSE;
	}

	e_cal_client_send_objects (cal_client, icalcomp, NULL, async_send_result_ready, NULL);

	icalcomponent_free (icalcomp);

	return FALSE;
}
static void
test_send_objects_async (ETestServerFixture *fixture,
                        gconstpointer user_data)
{
	ECalClient *cal_client;
	icalcomponent *icalcomp;

	cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);

	icalcomp = create_object ();
	g_assert (icalcomp);

	e_cal_client_send_objects (cal_client, icalcomp, NULL, async_send_result_ready, fixture->loop);
	icalcomponent_free (icalcomp);

	g_main_loop_run (fixture->loop);
}