~ubuntu-branches/ubuntu/quantal/evolution-data-server/quantal

« back to all changes in this revision

Viewing changes to tests/libebook/client/test-client-examine.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2012-07-03 22:41:23 UTC
  • mfrom: (1.1.100)
  • Revision ID: package-import@ubuntu.com-20120703224123-90dydkyfyvff8s0s
Tags: 3.5.3.1-0ubuntu1
* New upstream release 3.5.3.1.
* debian/control:
  - Drop libgconf2-dev from Build-Depends.
  - Bump versions for glib, goa, and libsoup in Build-Depends.
  - Add a Build-Depends on libgcr-3-dev (>= 3.4)
  - Rename packages following upstream SONAME changes.
  - Add Depends on libgnome-keyring-dev to libedataserver1.2-dev.
* debian/rules:
  - Update mkshlibs arguments for libcamel-1.2-38 instead of -33; as it was
    renamed in control due to the soname change.
  - Strip out -Bsymbolic-functions from LDFLAGS.
* Renamed install files in debian/:
  - libcamel-1.2-33.install => libcamel-1.2-38.install
  - libebackend-1.2-2.install => libebackend-1.2-4.install
  - libebook-1.2-13.install => libebook-1.2-17.install
  - libecal-1.2-11.install => libecal-1.2-15.install
  - libedata-book-1.2-13.install => libedata-book-1.2-15.install
  - libedata-cal-1.2-15.install => libedata-cal-1.2-18.install
  - libedataserver-1.2-16.install => libedataserver-1.2-17.install
  - libedataserverui-3.0-1.install => libedataserverui-3.0-4.install
* debian/patches/google_tests_fpic.patch: build tests with -fPIC; otherwise
  build fails.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
#include <stdlib.h>
4
4
#include <string.h>
5
 
#include <libebook/e-book-client.h>
6
 
#include <libedataserver/e-source-group.h>
 
5
#include <libebook/libebook.h>
7
6
 
8
7
#include "client-test-utils.h"
9
8
 
118
117
static void
119
118
identify_source (ESource *source)
120
119
{
121
 
        const gchar *name, *uri;
122
 
        gchar *abs_uri = NULL;
 
120
        const gchar *name, *uid;
123
121
 
124
122
        g_return_if_fail (source != NULL);
125
123
 
126
 
        name = e_source_peek_name (source);
127
 
        if (!name)
128
 
                name = "Unknown name";
129
 
 
130
 
        uri = e_source_peek_absolute_uri (source);
131
 
        if (!uri) {
132
 
                abs_uri = e_source_build_absolute_uri (source);
133
 
                uri = abs_uri;
134
 
        }
135
 
        if (!uri)
136
 
                uri = e_source_peek_relative_uri (source);
137
 
        if (!uri)
138
 
                uri = "Unknown uri";
139
 
 
140
 
        g_print ("\n   Checking source '%s' (%s)\n", name, uri);
141
 
 
142
 
        g_free (abs_uri);
 
124
        uid = e_source_get_uid (source);
 
125
        name = e_source_get_display_name (source);
 
126
 
 
127
        g_print ("\n   Checking source '%s' (%s)\n", name, uid);
143
128
}
144
129
 
145
130
static void
331
316
}
332
317
 
333
318
static gboolean
334
 
foreach_async (void)
 
319
foreach_async (ESourceRegistry *registry)
335
320
{
336
321
        gpointer async_data;
337
322
        ESource *source = NULL;
338
323
        EBookClient *book_client;
339
324
        GError *error = NULL;
340
325
 
341
 
        async_data = foreach_configured_source_async_start (&source);
 
326
        async_data = foreach_configured_source_async_start (registry, &source);
342
327
        if (!async_data) {
343
328
                stop_main_loop (1);
344
329
                return FALSE;
366
351
}
367
352
 
368
353
static gboolean
369
 
in_main_thread_idle_cb (gpointer unused)
 
354
in_main_thread_idle_cb (ESourceRegistry *registry)
370
355
{
371
356
        g_print ("* run in main thread with mainloop running\n");
372
 
        foreach_configured_source (check_source_sync);
 
357
        foreach_configured_source (registry, check_source_sync);
373
358
        g_print ("---------------------------------------------------------\n\n");
374
359
 
375
360
        g_print ("* run in main thread async\n");
376
361
 
377
 
        if (!foreach_async ())
 
362
        if (!foreach_async (registry))
378
363
                return FALSE;
379
364
 
380
365
        return FALSE;
381
366
}
382
367
 
383
368
static gpointer
384
 
worker_thread (gpointer unused)
 
369
worker_thread (ESourceRegistry *registry)
385
370
{
386
371
        g_print ("* run in dedicated thread with mainloop running\n");
387
 
        foreach_configured_source (check_source_sync);
 
372
        foreach_configured_source (registry, check_source_sync);
388
373
        g_print ("---------------------------------------------------------\n\n");
389
374
 
390
 
        g_idle_add (in_main_thread_idle_cb, NULL);
 
375
        g_idle_add ((GSourceFunc) in_main_thread_idle_cb, registry);
391
376
 
392
377
        return NULL;
393
378
}
396
381
main (gint argc,
397
382
      gchar **argv)
398
383
{
 
384
        ESourceRegistry *registry;
 
385
        GError *error = NULL;
 
386
 
399
387
        main_initialize ();
400
388
 
 
389
        registry = e_source_registry_new_sync (NULL, &error);
 
390
        if (error != NULL)
 
391
                g_error ("%s", error->message);
 
392
 
401
393
        g_print ("* run in main thread without mainloop\n");
402
 
        foreach_configured_source (check_source_sync);
 
394
        foreach_configured_source (registry, check_source_sync);
403
395
        g_print ("---------------------------------------------------------\n\n");
404
396
 
405
 
        start_in_thread_with_main_loop (worker_thread, NULL);
 
397
        start_in_thread_with_main_loop ((GThreadFunc) worker_thread, registry);
406
398
 
407
399
        return get_main_loop_stop_result ();
408
400
}