Merge lp:geis/2.x into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 92
Proposed branch: lp:geis/2.x
Merge into: lp:geis
Diff against target: 1288 lines (+956/-39)
22 files modified
ChangeLog (+49/-0)
doc/Doxyfile (+1/-1)
include/geis/geis.h (+61/-6)
libutouch-geis/Makefile.am (+9/-5)
libutouch-geis/geis.c (+79/-11)
libutouch-geis/geis_backend.c (+65/-0)
libutouch-geis/geis_backend.h (+56/-0)
libutouch-geis/geis_backend_multiplexor.c (+203/-0)
libutouch-geis/geis_backend_multiplexor.h (+129/-0)
libutouch-geis/geis_backend_protected.h (+61/-0)
libutouch-geis/geis_backend_test_fixture.c (+63/-0)
libutouch-geis/geis_backend_test_fixture.h (+35/-0)
libutouch-geis/geis_error.c (+4/-4)
libutouch-geis/geis_private.h (+4/-7)
testsuite/geis2/check_config.c (+2/-2)
testsuite/geis2/check_error_codes.c (+2/-0)
testsuite/geis2/check_geis_new.c (+1/-1)
testsuite/geis2/check_subscription.c (+1/-1)
testsuite/libutouch-geis/Makefile.am (+1/-0)
testsuite/libutouch-geis/check_backend_multiplexor.c (+127/-0)
testsuite/libutouch-geis/check_geis2_internals.c (+2/-0)
testsuite/libutouch-geis/check_subscription.c (+1/-1)
To merge this branch: bzr merge lp:geis/2.x
Reviewer Review Type Date Requested Status
Mohamed IKBEL Boulabiar (community) Approve
Henrik Rydberg (community) Approve
Review via email: mp+42536@code.launchpad.net

Description of the change

This change is some basic infrastructure required for configurable back ends (eg. DBus client, local grail, maverick-style XCB).

To post a comment you must log in.
Revision history for this message
Henrik Rydberg (rydberg) wrote :

Looks ok. Things are getting closer. :-)

Revision history for this message
Henrik Rydberg (rydberg) wrote :

> Looks ok. Things are getting closer. :-)

review: Approve
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Do we want to be able to specify a timeout value for geis_backend_multiplexor_pump?

Otherwise, looks good to me.

Revision history for this message
Mohamed IKBEL Boulabiar (boulabiar) wrote :

Looks Good !

("teh", "isn;t" in the comments detected :P)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2010-11-29 14:32:34 +0000
+++ ChangeLog 2010-12-02 19:24:57 +0000
@@ -1,3 +1,52 @@
12010-12-02 Stephen M. Webb <stephen.webb@canonical.com>
2
3 Added a back end base and test fixture.
4
5 * libutouch-geis/geis_backend.c: new file
6 * libutouch-geis/geis_backend.h: new file
7 * libutouch-geis/geis_backend_protected.h: new file
8 * libutouch-geis/geis_backend_test_fixture.c: new file
9 * libutouch-geis/geis_backend_test_fixture.h: new file
10 * include/geis/geis.h (GEIS_INIT_SERVICE_PROVIDER): changed constant value
11 (GEIS_INIT_UTOUCH_MOCK_ENGINE): added new constant
12 * libutouch-geis/Makefile.am: added new files
13 * libutouch-geis/geis.c (struct _Geis): replaced is_test_fixture with backend
14 (geis_set_valist): created new test fixture backend
15 (geis_delete): destroyed backend
16 * testsuite/geis2/check_config.c: used new name for test fixture back end
17 * testsuite/geis2/check_geis_new.c: same
18 * testsuite/geis2/check_subscription.c: idem
19 * testsuite/libutouch-geis/check_subscription.c: ditto
20
212010-12-02 Stephen M. Webb <stephen.webb@canonical.com>
22
23 Added a back end multiplexor.
24
25 * libutouch-geis/geis_backend_multiplexor.c: new file
26 * libutouch-geis/geis_backend_multiplexor.h: new file
27 * testsuite/libutouch-geis/check_backend_multiplexor.c: new testsuite
28 * include/geis/geis.h (GeisStatus): added new status codes
29 GEIS_STATUS_CONTINUE and GEIS_STATUS_EMPTY
30 (GEIS_CONFIG_UTOUCH_MAX_EVENTS): new configuration item
31 * libutouch-geis/Makefile.am: added new files
32 * libutouch-geis/geis.c (struct _Geis): added backend_multiplexor field
33 (geis_new_empty): initialized it
34 (geis_delete): destroyed it
35 (geis_get_configuration): retrieved its file descriptor and config value
36 (geis_set_configuration): set its configuration value
37 * testsuite/geis2/check_error_codes.c: checked new status codes
38 * testsuite/libutouch-geis/Makefile.am
39 * testsuite/libutouch-geis/check_geis2_internals.c
40
412010-11-29 Stephen M. Webb <stephen.webb@canonical.com>
42
43 Refactored geis_private.h to provide improved data encapsulation.
44
45 * libutouch-geis/geis_private.h (struct _Geis): moved to geis.c
46 (geis_error_stack): new function
47 * libutouch-geis/geis.c: implemented new function
48 * libutouch-geis/geis_error.c: used new function
49
12010-11-29 Stephen M. Webb <stephen.webb@canonical.com>502010-11-29 Stephen M. Webb <stephen.webb@canonical.com>
251
3 Fixed a typo in the Doxygen comments in geis.h.52 Fixed a typo in the Doxygen comments in geis.h.
453
=== modified file 'doc/Doxyfile'
--- doc/Doxyfile 2010-08-06 21:16:55 +0000
+++ doc/Doxyfile 2010-12-02 19:24:57 +0000
@@ -590,7 +590,7 @@
590# directories like "/usr/src/myproject". Separate the files or directories 590# directories like "/usr/src/myproject". Separate the files or directories
591# with spaces.591# with spaces.
592592
593INPUT = ../geis593INPUT = ../include/geis
594594
595# This tag can be used to specify the character encoding of the source files 595# This tag can be used to specify the character encoding of the source files
596# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 596# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
597597
=== modified file 'include/geis/geis.h'
--- include/geis/geis.h 2010-11-29 14:32:34 +0000
+++ include/geis/geis.h 2010-12-02 19:24:57 +0000
@@ -120,6 +120,10 @@
120typedef enum GeisStatus120typedef enum GeisStatus
121{121{
122 GEIS_STATUS_SUCCESS = 0, /**< normal successful completion */122 GEIS_STATUS_SUCCESS = 0, /**< normal successful completion */
123 GEIS_STATUS_CONTINUE = 20, /**< normal successful completion
124 with data still remaining */
125 GEIS_STATUS_EMPTY = 21, /**< normal successful completion
126 with no data retrieved */
123 GEIS_STATUS_NOT_SUPPORTED = 10, /**< a requested feature is not supported */127 GEIS_STATUS_NOT_SUPPORTED = 10, /**< a requested feature is not supported */
124 GEIS_BAD_ARGUMENT = 1000, /**< a bad argument value was passed */128 GEIS_BAD_ARGUMENT = 1000, /**< a bad argument value was passed */
125 GEIS_UNKNOWN_ERROR = 9999, /**< any other error condition */129 GEIS_UNKNOWN_ERROR = 9999, /**< any other error condition */
@@ -190,12 +194,40 @@
190/* @} */194/* @} */
191195
192/**196/**
193 * @defgroup geis_2_geis The Geis API Object197 * @defgroup geis_2_geis The Geis API Object (GEIS v2.0)
194 *198 *
195 * @{199 * @{
196 */200 */
197201
198#define GEIS_INIT_SERVICE_PROVIDER "geis-init-server"202/**
203 * @defgroup geis_2_geis_init_args Specified Initialization Arguments
204 *
205 * These initialization arguments are defined by the GEIS specification.
206 *
207 * @{
208 */
209
210/**
211 * Enables GEIS to provide a networked service.
212 *
213 * This initialization argument takes no parameters.
214 */
215#define GEIS_INIT_SERVICE_PROVIDER "org.libgeis.init.server"
216
217/* @} */
218
219/**
220 * @defgroup geis_2_geis_init_vendor Vendor-defined Initialization Arguments
221 *
222 * These initialization arguments are not a part of te GEIS specification and
223 * may change.
224 *
225 * @{
226 */
227
228#define GEIS_INIT_UTOUCH_MOCK_ENGINE "com.canonical.utouch.mock.engine"
229
230/* @} */
199231
200232
201typedef struct _Geis *Geis;233typedef struct _Geis *Geis;
@@ -332,8 +364,31 @@
332 * @{364 * @{
333 */365 */
334366
367/**
368 * @defgroup geis2_config_spec Required Configuration Items
369 *
370 * These configuration items are defined by the GEIS specification.
371 *
372 * @{
373 */
374
335#define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd"375#define GEIS_CONFIGURATION_FD "org.libgeis.configuration.fd"
336376
377/* @} */
378
379/**
380 * @defgroup geis2_config_vendor Vendor-defined Configuration Items
381 *
382 * These configuration items are not a part of the GEIS specification and may
383 * change.
384 *
385 * @{
386 */
387
388#define GEIS_CONFIG_UTOUCH_MAX_EVENTS "com.canonical.utouch.max_events"
389
390/* @} */
391
337/**392/**
338 * Gets a feature configuration value.393 * Gets a feature configuration value.
339 *394 *
340395
=== modified file 'libutouch-geis/Makefile.am'
--- libutouch-geis/Makefile.am 2010-11-29 02:16:02 +0000
+++ libutouch-geis/Makefile.am 2010-12-02 19:24:57 +0000
@@ -23,11 +23,15 @@
23lib_LTLIBRARIES = libutouch-geis.la23lib_LTLIBRARIES = libutouch-geis.la
2424
25libutouch_geis_la_SOURCES = \25libutouch_geis_la_SOURCES = \
26 geis_attr.h geis_attr.c \26 geis_attr.h geis_attr.c \
27 geis_error.h geis_error.c \27 geis_backend.h geis_backend.c \
28 geis_logging.h geis_logging.c \28 geis_backend_protected.h \
29 geis_subscription.h geis_subscription.c \29 geis_backend_test_fixture.h geis_backend_test_fixture.c \
30 geis_private.h geis.c30 geis_backend_multiplexor.h geis_backend_multiplexor.c \
31 geis_error.h geis_error.c \
32 geis_logging.h geis_logging.c \
33 geis_subscription.h geis_subscription.c \
34 geis_private.h geis.c
3135
32libutouch_geis_la_CPPFLAGS = \36libutouch_geis_la_CPPFLAGS = \
33 -Wall -Wextra \37 -Wall -Wextra \
3438
=== modified file 'libutouch-geis/geis.c'
--- libutouch-geis/geis.c 2010-11-29 02:16:02 +0000
+++ libutouch-geis/geis.c 2010-12-02 19:24:57 +0000
@@ -21,12 +21,23 @@
21#include "geis_config.h"21#include "geis_config.h"
22#include "geis_private.h"22#include "geis_private.h"
2323
24#include "geis_backend.h"
25#include "geis_backend_test_fixture.h"
26#include "geis_backend_multiplexor.h"
24#include "geis_error.h"27#include "geis_error.h"
25#include "geis_logging.h"28#include "geis_logging.h"
26#include <stdarg.h>29#include <stdarg.h>
27#include <string.h>30#include <string.h>
2831
2932
33struct _Geis
34{
35 GeisErrorStack error_stack;
36 GeisSubBag subscription_bag;
37 GeisBackendMultiplexor backend_multiplexor;
38 GeisBackend backend;
39};
40
3041
31/**42/**
32 * Creates a new empty Geis API instance.43 * Creates a new empty Geis API instance.
@@ -40,7 +51,7 @@
40 {51 {
41 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);52 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
42 geis_error("calloc failed");53 geis_error("calloc failed");
43 goto error_exit;54 goto final_exit;
44 }55 }
4556
46 geis->subscription_bag = geis_subscription_bag_new(1);57 geis->subscription_bag = geis_subscription_bag_new(1);
@@ -50,10 +61,26 @@
50 geis_error("creation of subscroption bag failed");61 geis_error("creation of subscroption bag failed");
51 free(geis);62 free(geis);
52 geis = NULL;63 geis = NULL;
53 goto error_exit;64 goto unwind_geis;
54 }65 }
5566
56error_exit:67 geis->backend_multiplexor = geis_backend_multiplexor_new();
68 if (!geis->backend_multiplexor)
69 {
70 geis_error_push(NULL, GEIS_STATUS_UNKNOWN_ERROR);
71 geis_error("creation of back end multiplexor failed");
72 goto unwind_subscription_bag;
73 }
74 goto final_exit;
75
76unwind_subscription_bag:
77 geis_subscription_bag_delete(geis->subscription_bag);
78
79unwind_geis:
80 free(geis);
81 geis = NULL;
82
83final_exit:
57 return geis;84 return geis;
58}85}
5986
@@ -70,14 +97,27 @@
70 {97 {
71 geis_debug("initializing GEIS server");98 geis_debug("initializing GEIS server");
72 }99 }
73 else if (0 == strcmp(init_arg_name, "geis-test-fixture"))100 else if (0 == strcmp(init_arg_name, GEIS_INIT_UTOUCH_MOCK_ENGINE))
74 {101 {
75 geis_debug("initializing GEIS test fixture");102 if (NULL != geis->backend)
76 geis->is_test_fixture = GEIS_TRUE;103 {
104 geis_error("multiple back ends requested, only using %s",\
105 geis_backend_name(geis->backend));
106 }
107 else
108 {
109 geis_debug("initializing GEIS test fixture");
110 geis->backend = geis_backend_new_test_fixture(geis);
111 }
77 }112 }
78113
79 init_arg_name = va_arg(varargs, GeisString);114 init_arg_name = va_arg(varargs, GeisString);
80 }115 }
116
117 if (NULL == geis->backend)
118 {
119 geis_debug("initializing default GEIS back end");
120 }
81}121}
82122
83123
@@ -110,6 +150,11 @@
110 {150 {
111 return GEIS_STATUS_BAD_ARGUMENT;151 return GEIS_STATUS_BAD_ARGUMENT;
112 }152 }
153
154 if (geis->backend)
155 geis_backend_delete(geis->backend);
156 geis_backend_multiplexor_delete(geis->backend_multiplexor);
157 geis_subscription_bag_delete(geis->subscription_bag);
113 free(geis);158 free(geis);
114 return GEIS_STATUS_SUCCESS;159 return GEIS_STATUS_SUCCESS;
115}160}
@@ -127,8 +172,16 @@
127172
128 if (0 == strcmp(configuration_item_name, GEIS_CONFIGURATION_FD))173 if (0 == strcmp(configuration_item_name, GEIS_CONFIGURATION_FD))
129 {174 {
130 /* status = GEIS_STATUS_SUCCESS; */175 *(int*)configuration_item_value
131 };176 = geis_backend_multiplexor_fd(geis->backend_multiplexor);
177 status = GEIS_STATUS_SUCCESS;
178 }
179 else if (0 == strcmp(configuration_item_name, GEIS_CONFIG_UTOUCH_MAX_EVENTS))
180 {
181 *(int*)configuration_item_value
182 = geis_backend_multiplexor_max_events_per_pump(geis->backend_multiplexor);
183 status = GEIS_STATUS_SUCCESS;
184 }
132185
133 return status;186 return status;
134}187}
@@ -142,7 +195,22 @@
142 GeisString configuration_item_name,195 GeisString configuration_item_name,
143 void *configuration_item_value)196 void *configuration_item_value)
144{197{
145 return GEIS_STATUS_UNKNOWN_ERROR;198 GeisStatus status = GEIS_STATUS_NOT_SUPPORTED;
199
200 if (0 == strcmp(configuration_item_name, GEIS_CONFIG_UTOUCH_MAX_EVENTS))
201 {
202 int max_events = *(int *)configuration_item_value;
203 geis_backend_multiplexor_set_max_events_per_pump(geis->backend_multiplexor,
204 max_events);
205 status = GEIS_STATUS_SUCCESS;
206 }
207 return status;
208}
209
210
211GeisErrorStack *geis_error_stack(Geis geis)
212{
213 return &geis->error_stack;
146}214}
147215
148216
149217
=== added file 'libutouch-geis/geis_backend.c'
--- libutouch-geis/geis_backend.c 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend.c 2010-12-02 19:24:57 +0000
@@ -0,0 +1,65 @@
1/**
2 * @file geis_backend.c
3 * @brief internal GEIS back end base class implementation
4 *
5 * Copyright 2010 Canonical Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 3 of the License, or (at your option) any
10 * later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include "geis_backend.h"
22#include "geis_backend_protected.h"
23
24#include "geis_logging.h"
25#include <stdlib.h>
26#include <string.h>
27
28
29/*
30 * Initializes the base portion of the back end.
31 */
32void
33geis_backend_init_base(GeisBackend be_base,
34 GeisBackendVtable be_vtbl,
35 GeisString be_name)
36{
37 be_base->be_name = strdup(be_name);
38 be_base->be_vtbl = be_vtbl;
39}
40
41
42/*
43 * Destroys the back end.
44 */
45void
46geis_backend_delete(GeisBackend be)
47{
48 if (be)
49 {
50 free((char *)be->be_name);
51 be->be_vtbl->finalize(be);
52 }
53 geis_debug("%s back end destroyed", geis_backend_name(be));
54}
55
56
57/*
58 * Gets the name of the back end (RTTI).
59 */
60GeisString
61geis_backend_name(GeisBackend be)
62{
63 return be->be_name;
64}
65
066
=== added file 'libutouch-geis/geis_backend.h'
--- libutouch-geis/geis_backend.h 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend.h 2010-12-02 19:24:57 +0000
@@ -0,0 +1,56 @@
1/**
2 * @file geis_backend.h
3 * @brief internal GEIS back end base class public interface
4 *
5 * Copyright 2010 Canonical Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 3 of the License, or (at your option) any
10 * later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#ifndef GEIS_BACKEND_H_
22#define GEIS_BACKEND_H_
23
24#include "geis/geis.h"
25
26/**
27 * Provides a virtual "base class" for various GEIS back ends.
28 *
29 * The GEIS is an API that implements the facade pattern over some number of
30 * actual "back end" implementations. Most internal operations of teh API are
31 * performed through this "virtual base class" interface rather than through the
32 * concrete back ends (isn;t object-oriented programming great?).
33 */
34typedef struct _GeisBackend *GeisBackend;
35
36
37/**
38 * Destroys the back end.
39 *
40 * @parameter[in] be The back end.
41 *
42 * This function behaves like a virtual destructor and chains through to the
43 * concrete destructor call.
44 */
45void geis_backend_delete(GeisBackend be);
46
47/**
48 * Gets the name of the back end.
49 *
50 * @parameter[in] be The back end.
51 *
52 * This accessor is useful for diagnostics.
53 */
54GeisString geis_backend_name(GeisBackend be);
55
56#endif /* GEIS_BACKEND_H_ */
057
=== added file 'libutouch-geis/geis_backend_multiplexor.c'
--- libutouch-geis/geis_backend_multiplexor.c 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend_multiplexor.c 2010-12-02 19:24:57 +0000
@@ -0,0 +1,203 @@
1/**
2 * @file geis_backend_multiplexor.c
3 * @brief internal GEIS backend multiplexor implementation
4 *
5 * Copyright 2010 Canonical Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 3 of the License, or (at your option) any
10 * later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include "geis_config.h"
22#include "geis_backend_multiplexor.h"
23
24#include <errno.h>
25#include "geis_logging.h"
26#include <stdlib.h>
27#include <string.h>
28#include <sys/epoll.h>
29
30
31struct _GeisBackendMultiplexor
32{
33 int mx_fd;
34 int mx_max_events_per_pump;
35};
36
37typedef struct _CallbackInfo
38{
39 int fd;
40 GeisBackendFdEventCallback callback;
41 void *context;
42} *CallbackInfo;
43
44
45/**
46 * Creates a new backend multiplexor.
47 */
48GeisBackendMultiplexor
49geis_backend_multiplexor_new()
50{
51 GeisBackendMultiplexor mx = calloc(1, sizeof(struct _GeisBackendMultiplexor));
52 if (!mx)
53 {
54 geis_error("failed to allocate backend multiplexor");
55 }
56 else
57 {
58 mx->mx_fd = epoll_create1(EPOLL_CLOEXEC);
59 if (mx->mx_fd < 0)
60 {
61 geis_error("error %d creating backend multiplexor: %s",
62 errno, strerror(errno));
63 free(mx);
64 }
65 mx->mx_max_events_per_pump = GEIS_BE_MX_DEFAULT_EVENTS_PER_PUMP;
66 }
67
68 return mx;
69}
70
71
72/**
73 * Destroys an backend multiplexor.
74 */
75void
76geis_backend_multiplexor_delete(GeisBackendMultiplexor mx)
77{
78 free(mx);
79}
80
81
82/**
83 * Adds a file descriptor to an backend multiplexor.
84 */
85void
86geis_backend_multiplexor_add_fd(GeisBackendMultiplexor mx,
87 int fd,
88 GeisBackendFdEventCallback callback,
89 void *context)
90{
91 int status;
92 struct epoll_event ev;
93
94 CallbackInfo callback_info = calloc(1, sizeof(struct _CallbackInfo));
95 if (!callback_info)
96 {
97 geis_error("failed to allocate callback info structure");
98 return;
99 }
100
101 callback_info->fd = fd;
102 callback_info->callback = callback;
103 callback_info->context = context;
104
105 ev.events = EPOLLIN;
106 ev.data.ptr = callback_info;
107 status = epoll_ctl(mx->mx_fd, EPOLL_CTL_ADD, fd, &ev);
108 if (status < 0)
109 {
110 geis_error("error %d multiplexing fd %d: %s",
111 errno, fd, strerror(errno));
112 }
113}
114
115
116/**
117 * Removes a file descriptor from a backend multiplexor.
118 *
119 * @todo free callback_info
120 */
121void
122geis_backend_multiplexor_remove_fd(GeisBackendMultiplexor mx, int fd)
123{
124 int status = epoll_ctl(mx->mx_fd, EPOLL_CTL_DEL, fd, NULL);
125 if (status < 0)
126 {
127 geis_error("error %d multiplexing fd %d: %s",
128 errno, fd, strerror(errno));
129 }
130}
131
132
133/**
134 * Gets the single file descriptor of the backend multiplexir itself.
135 */
136int
137geis_backend_multiplexor_fd(GeisBackendMultiplexor mx)
138{
139 return mx->mx_fd;
140}
141
142
143/**
144 * gets the maximum number of fd events per pump.
145 */
146int
147geis_backend_multiplexor_max_events_per_pump(GeisBackendMultiplexor mx)
148{
149 return mx->mx_max_events_per_pump;
150}
151
152
153/**
154 * Sets the maximum number of fd events processed per pump.
155 */
156void
157geis_backend_multiplexor_set_max_events_per_pump(GeisBackendMultiplexor mx,
158 int max_events_per_pump)
159{
160 mx->mx_max_events_per_pump = max_events_per_pump;
161}
162
163
164/**
165 * Dispatches events on the multiplexed file descriptors.
166 */
167GeisStatus
168geis_backend_multiplexor_pump(GeisBackendMultiplexor mx)
169{
170 GeisStatus status = GEIS_STATUS_UNKNOWN_ERROR;
171 int i;
172 int processed_event_count = 0;
173 int available_event_count = 1;
174 struct epoll_event events[4];
175
176 while (available_event_count > 0
177 && processed_event_count < mx->mx_max_events_per_pump)
178 {
179 available_event_count = epoll_wait(mx->mx_fd, events, 4, 0);
180 if (available_event_count < 0)
181 {
182 geis_error("error %d in epoll_wait: %s", errno, strerror(errno));
183 goto error_exit;
184 }
185
186 for (i = 0; i < available_event_count; ++i)
187 {
188 CallbackInfo callback_info = (CallbackInfo)events[i].data.ptr;
189 callback_info->callback(callback_info->fd,
190 GEIS_BE_MX_READ_AVAILABLE,
191 callback_info->context);
192 ++processed_event_count;
193 }
194 }
195 if (available_event_count)
196 status = GEIS_STATUS_CONTINUE;
197 else
198 status = GEIS_STATUS_SUCCESS;
199
200error_exit:
201 return status;
202}
203
0204
=== added file 'libutouch-geis/geis_backend_multiplexor.h'
--- libutouch-geis/geis_backend_multiplexor.h 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend_multiplexor.h 2010-12-02 19:24:57 +0000
@@ -0,0 +1,129 @@
1/**
2 * @file geis_backend_multiplexor.h
3 * @brief internal GEIS backend multiplexor interface
4 *
5 * Copyright 2010 Canonical Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 3 of the License, or (at your option) any
10 * later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#ifndef GEIS_BACKEND_MULTIPLEXOR_H_
22#define GEIS_BACKEND_MULTIPLEXOR_H_
23
24#include "geis/geis.h"
25
26
27/**
28 * Multiplexes back end events into a single notification file descriptor.
29 *
30 * The GEIS API presents a single file descriptor to the application to watch
31 * for activity notification. A back end may be monitoring activity on more
32 * than one file descriptor. The multiplexor combines these requirements.
33 */
34typedef struct _GeisBackendMultiplexor *GeisBackendMultiplexor;
35
36/**
37 * Indicates the type of fd event that occurred on a multiplexed descriptor.
38 */
39typedef enum _GeisBackendMultiplexorEvent
40{
41 GEIS_BE_MX_READ_AVAILABLE,
42 GEIS_BE_MX_WRITE_AVAILABLE
43} GeisBackendMultiplexorEvent;
44
45/**
46 * Handles events occurring on multiplexed file descriptors.
47 *
48 * Back ends must provide a callback with this signature to the multiplexor.
49 */
50typedef void (*GeisBackendFdEventCallback)(int fd,
51 GeisBackendMultiplexorEvent event,
52 void *context);
53
54/**
55 * Constructs a new back end multiplexor.
56 */
57GeisBackendMultiplexor geis_backend_multiplexor_new();
58
59/**
60 * A reasonable default value for the max_events_per_pump parameter to
61 * geis_backend_multiplexor_new().
62 */
63#define GEIS_BE_MX_DEFAULT_EVENTS_PER_PUMP 16
64
65/**
66 * Destroys a back end multiplexor.
67 *
68 * @param[in] mx The back end multiplexor to destroy.
69 */
70void geis_backend_multiplexor_delete(GeisBackendMultiplexor mx);
71
72/**
73 * Adds a file descriptor to a back end multiplexor.
74 *
75 * @param[in] mx The back end multiplexor.
76 * @param[in] fd The file descriptor to add.
77 */
78void geis_backend_multiplexor_add_fd(GeisBackendMultiplexor mx,
79 int fd,
80 GeisBackendFdEventCallback callback,
81 void *context);
82
83/**
84 * Removes a file descriptor from a back end multiplexor.
85 *
86 * @param[in] mx The back end multiplexor.
87 * @param[in] fd The file descriptor to remove.
88 */
89void geis_backend_multiplexor_remove_fd(GeisBackendMultiplexor mx,
90 int fd);
91
92/**
93 * Gets the file descriptor of the back end multiplexor.
94 *
95 * @param[in] mx The back end multiplexor.
96 */
97int geis_backend_multiplexor_fd(GeisBackendMultiplexor mx);
98
99/**
100 * Gets the maximum number of fd events per pump.
101 *
102 * @param[in] mx The back end multiplexor.
103 */
104int geis_backend_multiplexor_max_events_per_pump(GeisBackendMultiplexor mx);
105
106/**
107 * Sets the maximum fd events per pump of the multiplexor.
108 *
109 * @param[in] mx The back end multiplexor.
110 * @param[in] max_events_per_pump The maximum number of fd events pumped
111 * per call of geis_backend_multiplexor_pump().
112 *
113 * This value is tunable to accommodate different back ends and
114 * application/toolkit requirements.
115 */
116void geis_backend_multiplexor_set_max_events_per_pump(GeisBackendMultiplexor mx,
117 int max_events_per_pump);
118
119/**
120 * Exercises the back end multiplexor.
121 *
122 * @param[in] mx The back end multiplexor.
123 *
124 * Dispatches any events on multiplexed file descriptors to their assciated
125 * handlers.
126 */
127GeisStatus geis_backend_multiplexor_pump(GeisBackendMultiplexor mx);
128
129#endif /* GEIS_BACKEND_MULTIPLEXOR_H_ */
0130
=== added file 'libutouch-geis/geis_backend_protected.h'
--- libutouch-geis/geis_backend_protected.h 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend_protected.h 2010-12-02 19:24:57 +0000
@@ -0,0 +1,61 @@
1/**
2 * @file geis_backend_protected.h
3 * @brief internal GEIS back end base class "protected" interface
4 *
5 * This file contains the implementation interface for the various GEIS v2 back
6 * ends.
7 */
8
9/*
10 * Copyright 2010 Canonical Ltd.
11 *
12 * This library is free software; you can redistribute it and/or modify it under
13 * the terms of the GNU Lesser General Public License as published by the Free
14 * Software Foundation; either version 3 of the License, or (at your option) any
15 * later version.
16 *
17 * This library is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
20 * details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26#ifndef GEIS_BACKEND_PROTECTED_H_
27#define GEIS_BACKEND_PROTECTED_H_
28
29#include "geis/geis.h"
30#include "geis_backend.h"
31
32
33/**
34 * The custom dispatch table for "derived" GEIS v2 backends.
35 */
36typedef struct _GeisBackendVtable
37{
38 void (* finalize)(GeisBackend);
39} *GeisBackendVtable;
40
41/**
42 * The "base" class of all the GEIS v2 backends.
43 */
44struct _GeisBackend {
45 GeisString be_name;
46 GeisBackendVtable be_vtbl;
47};
48
49
50/**
51 * Initializes the base portion of the GEIS v2 backends.
52 *
53 * @param[in] be_base The GeisBackend portion of the back end object.
54 * @param[in] be_vtbl An initialized GeisBackendVtable.
55 * @param[in] be_name The name of the back end.
56 */
57void geis_backend_init_base(GeisBackend be_base,
58 GeisBackendVtable be_vtbl,
59 GeisString be_name);
60
61#endif /* GEIS_BACKEND_PROTECTED_H_ */
062
=== added file 'libutouch-geis/geis_backend_test_fixture.c'
--- libutouch-geis/geis_backend_test_fixture.c 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend_test_fixture.c 2010-12-02 19:24:57 +0000
@@ -0,0 +1,63 @@
1/**
2 * @file geis_backend_test_fixture.c
3 * @brief GEIS mock back end test fixture implementation
4 *
5 * Copyright 2010 Canonical Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 3 of the License, or (at your option) any
10 * later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include "geis_backend.h"
22#include "geis_backend_protected.h"
23
24#include "geis_logging.h"
25#include <stdlib.h>
26
27
28typedef struct _GeisBackendTestFixture
29{
30 struct _GeisBackend tf_base;
31} *GeisBackendTestFixture;
32
33
34static void
35geis_backend_finalize(GeisBackend be)
36{
37 GeisBackendTestFixture tf __attribute__((unused)) = (GeisBackendTestFixture)be;
38}
39
40
41static struct _GeisBackendVtable tf_vtbl = {
42 geis_backend_finalize
43};
44
45GeisBackend
46geis_backend_new_test_fixture(Geis geis __attribute__((unused)))
47{
48 GeisBackendTestFixture tf = calloc(1, sizeof(struct _GeisBackendTestFixture));
49 if (!tf)
50 {
51 geis_error("failed to allocate GEIS back end test fixture");
52 goto nomem;
53 }
54
55 geis_backend_init_base(&tf->tf_base, &tf_vtbl, "GEIS2 test fixture");
56
57 geis_debug("%s back end created", geis_backend_name(&tf->tf_base));
58
59nomem:
60 return (GeisBackend)tf;
61}
62
63
064
=== added file 'libutouch-geis/geis_backend_test_fixture.h'
--- libutouch-geis/geis_backend_test_fixture.h 1970-01-01 00:00:00 +0000
+++ libutouch-geis/geis_backend_test_fixture.h 2010-12-02 19:24:57 +0000
@@ -0,0 +1,35 @@
1/**
2 * @file geis_backend_test_fixture.h
3 * @brief internal GEIS test fixture back end class
4 *
5 * Copyright 2010 Canonical Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the Free
9 * Software Foundation; either version 3 of the License, or (at your option) any
10 * later version.
11 *
12 * This library is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#ifndef GEIS_BACKEND_TEST_FIXTURE_H_
22#define GEIS_BACKEND_TEST_FIXTURE_H_
23
24#include "geis/geis.h"
25
26/**
27 * Constructs a new GEIS Test Fuixture back end.
28 *
29 * @param[in] geis The API instance the back end will run in.
30 *
31 * The Test Fixture back end is used in unit tests.
32 */
33GeisBackend geis_backend_new_test_fixture(Geis geis);
34
35#endif /* GEIS_BACKEND_TEST_FIXTURE_H_ */
036
=== modified file 'libutouch-geis/geis_error.c'
--- libutouch-geis/geis_error.c 2010-11-28 00:41:24 +0000
+++ libutouch-geis/geis_error.c 2010-12-02 19:24:57 +0000
@@ -74,7 +74,7 @@
74{74{
75 if (geis)75 if (geis)
76 {76 {
77 geis_error_stack_clear(&geis->error_stack);77 geis_error_stack_clear(geis_error_stack(geis));
78 }78 }
79 else79 else
80 {80 {
@@ -88,7 +88,7 @@
88{88{
89 if (geis)89 if (geis)
90 {90 {
91 geis_error_stack_push(&geis->error_stack, code);91 geis_error_stack_push(geis_error_stack(geis), code);
92 }92 }
93 else93 else
94 {94 {
@@ -102,7 +102,7 @@
102{102{
103 if (geis)103 if (geis)
104 {104 {
105 return geis->error_stack.error_count;105 return geis_error_stack(geis)->error_count;
106 }106 }
107 else107 else
108 {108 {
@@ -117,7 +117,7 @@
117 GeisStatus status = GEIS_STATUS_UNKNOWN_ERROR;117 GeisStatus status = GEIS_STATUS_UNKNOWN_ERROR;
118 if (geis)118 if (geis)
119 {119 {
120 status = geis_error_stack_get(&geis->error_stack, index);120 status = geis_error_stack_get(geis_error_stack(geis), index);
121 }121 }
122 else122 else
123 {123 {
124124
=== modified file 'libutouch-geis/geis_private.h'
--- libutouch-geis/geis_private.h 2010-11-29 02:16:02 +0000
+++ libutouch-geis/geis_private.h 2010-12-02 19:24:57 +0000
@@ -27,13 +27,10 @@
27#include "geis_subscription.h"27#include "geis_subscription.h"
2828
2929
30struct _Geis30/**
31{31 * Gets the error stack drom the geis object.
32 GeisBoolean is_test_fixture;32 */
33 GeisErrorStack error_stack;33GeisErrorStack *geis_error_stack(Geis geis);
34 GeisSubBag subscription_bag;
35};
36
3734
38/**35/**
39 * Gets the subscription container from the geis object.36 * Gets the subscription container from the geis object.
4037
=== modified file 'testsuite/geis2/check_config.c'
--- testsuite/geis2/check_config.c 2010-11-25 03:14:17 +0000
+++ testsuite/geis2/check_config.c 2010-12-02 19:24:57 +0000
@@ -12,7 +12,7 @@
12static void12static void
13construct_geis()13construct_geis()
14{14{
15 geis = geis_new("geis-test-fixture", NULL);15 geis = geis_new(GEIS_INIT_UTOUCH_MOCK_ENGINE, NULL);
16}16}
1717
18/* fixture teardown */18/* fixture teardown */
@@ -37,7 +37,7 @@
37START_TEST(get_fail)37START_TEST(get_fail)
38{38{
39 int fd = -1;39 int fd = -1;
40 GeisStatus status = geis_get_configuration(geis, 1234, &fd);40 GeisStatus status = geis_get_configuration(geis, "no such configuration", &fd);
41 fail_unless(status == GEIS_STATUS_NOT_SUPPORTED,41 fail_unless(status == GEIS_STATUS_NOT_SUPPORTED,
42 "unexpected return status from geis_get_configuration()");42 "unexpected return status from geis_get_configuration()");
43}43}
4444
=== modified file 'testsuite/geis2/check_error_codes.c'
--- testsuite/geis2/check_error_codes.c 2010-11-21 17:00:48 +0000
+++ testsuite/geis2/check_error_codes.c 2010-12-02 19:24:57 +0000
@@ -9,6 +9,8 @@
9START_TEST(error_codes)9START_TEST(error_codes)
10{10{
11 GeisStatus error = GEIS_STATUS_SUCCESS ;11 GeisStatus error = GEIS_STATUS_SUCCESS ;
12 error = GEIS_STATUS_CONTINUE;
13 error = GEIS_STATUS_EMPTY;
12 error = GEIS_STATUS_NOT_SUPPORTED;14 error = GEIS_STATUS_NOT_SUPPORTED;
13 error = GEIS_STATUS_BAD_ARGUMENT;15 error = GEIS_STATUS_BAD_ARGUMENT;
14 error = GEIS_STATUS_UNKNOWN_ERROR;16 error = GEIS_STATUS_UNKNOWN_ERROR;
1517
=== modified file 'testsuite/geis2/check_geis_new.c'
--- testsuite/geis2/check_geis_new.c 2010-11-23 03:31:21 +0000
+++ testsuite/geis2/check_geis_new.c 2010-12-02 19:24:57 +0000
@@ -8,7 +8,7 @@
8/* compile-time test to ensure required types are defined */8/* compile-time test to ensure required types are defined */
9START_TEST(geis_new_and_delete)9START_TEST(geis_new_and_delete)
10{10{
11 Geis geis = geis_new("geis-test-fixture", NULL);11 Geis geis = geis_new(GEIS_INIT_UTOUCH_MOCK_ENGINE, NULL);
12 fail_unless(geis != NULL, "failed to create GEIS v2.0 API instance");12 fail_unless(geis != NULL, "failed to create GEIS v2.0 API instance");
1313
14 GeisStatus status = geis_delete(geis);14 GeisStatus status = geis_delete(geis);
1515
=== modified file 'testsuite/geis2/check_subscription.c'
--- testsuite/geis2/check_subscription.c 2010-11-29 02:16:02 +0000
+++ testsuite/geis2/check_subscription.c 2010-12-02 19:24:57 +0000
@@ -14,7 +14,7 @@
14static void14static void
15construct_geis()15construct_geis()
16{16{
17 g_geis = geis_new("geis-test-fixture", NULL);17 g_geis = geis_new(GEIS_INIT_UTOUCH_MOCK_ENGINE, NULL);
18}18}
1919
20/* fixture teardown */20/* fixture teardown */
2121
=== modified file 'testsuite/libutouch-geis/Makefile.am'
--- testsuite/libutouch-geis/Makefile.am 2010-11-29 02:16:02 +0000
+++ testsuite/libutouch-geis/Makefile.am 2010-12-02 19:24:57 +0000
@@ -32,6 +32,7 @@
3232
33check_geis2_internals_SOURCES = \33check_geis2_internals_SOURCES = \
34 check_attr.c \34 check_attr.c \
35 check_backend_multiplexor.c \
35 check_error_reporting.c \36 check_error_reporting.c \
36 check_subscription.c \37 check_subscription.c \
37 check_geis2_internals.c38 check_geis2_internals.c
3839
=== added file 'testsuite/libutouch-geis/check_backend_multiplexor.c'
--- testsuite/libutouch-geis/check_backend_multiplexor.c 1970-01-01 00:00:00 +0000
+++ testsuite/libutouch-geis/check_backend_multiplexor.c 2010-12-02 19:24:57 +0000
@@ -0,0 +1,127 @@
1/**
2 * internal unit tests for the uTouch GEIS v2.0 backend_multiplexor module
3 */
4#include <check.h>
5
6#include "geis/geis.h"
7#include "libutouch-geis/geis_backend_multiplexor.h"
8#include <stdio.h>
9#include <sys/select.h>
10#include <unistd.h>
11
12
13/* fixtures */
14static GeisBackendMultiplexor g_mx;
15
16/* fixture setup */
17static void
18construct_mx()
19{
20 g_mx = geis_backend_multiplexor_new();
21}
22
23/* fixture teardown */
24static void
25destroy_mx()
26{
27 geis_backend_multiplexor_delete(g_mx);
28}
29
30static void
31testcase_event_callback(int fd, GeisBackendMultiplexorEvent event, void *context)
32{
33 char buf[2];
34 (void)read(fd, buf, 1);
35 *(int *)context += 1;
36}
37
38
39/* verify bag construction/destruction */
40START_TEST(construction)
41{
42 construct_mx();
43 fail_unless(g_mx != NULL, "failed to create backend_multiplexor");
44 fail_unless(geis_backend_multiplexor_fd(g_mx) >= 0, "invalid MX fd");
45 fail_unless(geis_backend_multiplexor_max_events_per_pump(g_mx) == GEIS_BE_MX_DEFAULT_EVENTS_PER_PUMP, "unexpected max fd per pump value");
46 destroy_mx();
47}
48END_TEST
49
50
51/* verify multiplexor wait */
52START_TEST(mx_wait)
53{
54 int pfd[2];
55 int mx_fd = geis_backend_multiplexor_fd(g_mx);
56 int called = 0;
57 int status = 0;
58 int first_time = 1;
59
60 (void)pipe(pfd);
61 geis_backend_multiplexor_add_fd(g_mx, pfd[0], testcase_event_callback, &called);
62
63 while (1)
64 {
65 fd_set fds;
66 FD_ZERO(&fds);
67 FD_SET(mx_fd, &fds);
68
69 struct timeval tm;
70 tm.tv_sec = 0;
71 tm.tv_usec = 5000;
72
73 status = select(mx_fd+1, &fds, NULL, NULL, &tm);
74 fail_if(status < 0, "error in select");
75 if (status < 0)
76 {
77 break;
78 }
79 else if (0 == status)
80 {
81 fprintf(stderr, "select timeout\n");
82 fail_unless(first_time, "select timed out before read");
83 if (!first_time)
84 {
85 break;
86 }
87 first_time = 0;
88 (void)write(pfd[1], "1", 1);
89 }
90 else
91 {
92 geis_backend_multiplexor_pump(g_mx);
93 break;
94 }
95 }
96
97 fail_if(called == 0, "MX event callback not called");
98 fail_if(called > 1, "MX event callback called too many times");
99}
100END_TEST
101
102START_TEST(mx_config)
103{
104 geis_backend_multiplexor_set_max_events_per_pump(g_mx, 24);
105 fail_unless(geis_backend_multiplexor_max_events_per_pump(g_mx) == 24,
106 "unexpected max fd per pump value");
107}
108END_TEST
109
110/* boilerplate */
111Suite *
112make_backend_multiplexor_suite()
113{
114 Suite *s = suite_create("utouch-geis2-backend-multiplexor");
115
116 TCase *create = tcase_create("backend-multiplexor-creation");
117 tcase_add_test(create, construction);
118 suite_add_tcase(s, create);
119
120 TCase *usage = tcase_create("backend-multiplexor-usage");
121 tcase_add_checked_fixture(usage, construct_mx, destroy_mx);
122 tcase_add_test(usage, mx_wait);
123 suite_add_tcase(s, usage);
124
125 return s;
126}
127
0128
=== modified file 'testsuite/libutouch-geis/check_geis2_internals.c'
--- testsuite/libutouch-geis/check_geis2_internals.c 2010-11-29 02:16:02 +0000
+++ testsuite/libutouch-geis/check_geis2_internals.c 2010-12-02 19:24:57 +0000
@@ -6,6 +6,7 @@
6extern Suite *make_error_reporting_suite();6extern Suite *make_error_reporting_suite();
7extern Suite *make_attr_suite();7extern Suite *make_attr_suite();
8extern Suite *make_subscription_suite();8extern Suite *make_subscription_suite();
9extern Suite *make_backend_multiplexor_suite();
910
1011
11int12int
@@ -19,6 +20,7 @@
19 srunner_add_suite(sr, make_error_reporting_suite());20 srunner_add_suite(sr, make_error_reporting_suite());
20 srunner_add_suite(sr, make_attr_suite());21 srunner_add_suite(sr, make_attr_suite());
21 srunner_add_suite(sr, make_subscription_suite());22 srunner_add_suite(sr, make_subscription_suite());
23 srunner_add_suite(sr, make_backend_multiplexor_suite());
2224
23 srunner_set_log(sr, "geis2_internals.log");25 srunner_set_log(sr, "geis2_internals.log");
24 srunner_run_all(sr, CK_NORMAL);26 srunner_run_all(sr, CK_NORMAL);
2527
=== modified file 'testsuite/libutouch-geis/check_subscription.c'
--- testsuite/libutouch-geis/check_subscription.c 2010-11-29 02:16:02 +0000
+++ testsuite/libutouch-geis/check_subscription.c 2010-12-02 19:24:57 +0000
@@ -16,7 +16,7 @@
16static void16static void
17construct_bag()17construct_bag()
18{18{
19 g_geis = geis_new("geis-test-fixture", NULL);19 g_geis = geis_new(GEIS_INIT_UTOUCH_MOCK_ENGINE, NULL);
20 g_sub_bag = geis_subscription_bag_new(1);20 g_sub_bag = geis_subscription_bag_new(1);
21}21}
2222

Subscribers

People subscribed via source and target branches

to all changes: