Merge lp:~bregma/geis/fix-integration-tests into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 242
Proposed branch: lp:~bregma/geis/fix-integration-tests
Merge into: lp:geis
Diff against target: 99 lines (+16/-19)
4 files modified
configure.ac (+1/-1)
libutouch-geis/geis.c (+15/-9)
libutouch-geis/geis_private.h (+0/-8)
libutouch-geis/geis_subscription.c (+0/-1)
To merge this branch: bzr merge lp:~bregma/geis/fix-integration-tests
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+100266@code.launchpad.net

Description of the change

These changes bring utouch-geis to the point where the entire test suite runs green on my local machine, at least under the following conditions.

(1) No other X server grabs the input devices. Running from a text console (VT) prevents this. Failures due to this are not failures in the uTouch stack.

(2) The captive X server will not shut down and start rapidly. All tests pass if run separately or when built and run in the same pass, but some tests will not start if run too rapidly together. This is effectively a failure of the test harness and not indicative of problems in the uTouch stack.

The changes include here include (1) setting the appropriate libraries so the testsuite will build, and (2) changing the order of teardown of some contained objects to avoid both a circular dependency in refcounted objects that sometimes caused a resource loss (no X connection teardown, memory leaks) and also a double-delete or reference of as deleted object.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

It all looks reasonable to me.

I think we may need some work on xorg-gtest to make it a bit more robust. There are circumstances where the X server doesn't always shut down, and perhaps it should be starting server on a random port that is unused.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2012-03-29 16:31:42 +0000
3+++ configure.ac 2012-03-31 01:59:21 +0000
4@@ -100,7 +100,7 @@
5 have_xorg_gtest=no
6 AS_IF([test "x$enable_integration_tests" != xno],
7 [CHECK_XORG_GTEST(
8- [],
9+ [AC_SUBST(XORG_GTEST_LIBS, [-pthread])],
10 [AS_IF([test "x$enable_integration_tests" = xyes],
11 [AC_MSG_ERROR(
12 [xorg-gtest is not available])],
13
14=== modified file 'libutouch-geis/geis.c'
15--- libutouch-geis/geis.c 2012-03-25 21:12:43 +0000
16+++ libutouch-geis/geis.c 2012-03-31 01:59:21 +0000
17@@ -762,7 +762,7 @@
18 if (geis->backend)
19 geis_backend_delete(geis->backend);
20 if (geis->server)
21- geis_dbus_server_delete(geis->server);
22+ geis_dbus_server_delete(geis->server);
23 geis_filterable_attribute_bag_delete(geis->special_filterable_attributes);
24 geis_filterable_attribute_bag_delete(geis->region_filterable_attributes);
25 geis_device_bag_delete(geis->devices);
26@@ -774,7 +774,8 @@
27 close(geis->input_event_signal_pipe[1]);
28 geis_event_queue_delete(geis->input_event_queue);
29 geis_backend_multiplexor_delete(geis->backend_multiplexor);
30- geis_subscription_bag_delete(geis->subscription_bag);
31+ if (geis->subscription_bag)
32+ geis_subscription_bag_delete(geis->subscription_bag);
33 free(geis);
34 }
35
36@@ -789,7 +790,18 @@
37 return GEIS_STATUS_BAD_ARGUMENT;
38 }
39
40- geis_subscription_bag_invalidate(geis->subscription_bag);
41+ /* break circular dependencies */
42+ if (geis->subscription_bag)
43+ {
44+ geis_subscription_bag_delete(geis->subscription_bag);
45+ geis->subscription_bag = NULL;
46+ }
47+ if (geis->backend)
48+ {
49+ geis_backend_delete(geis->backend);
50+ geis->backend = NULL;
51+ }
52+
53 geis_unref(geis);
54 return GEIS_STATUS_SUCCESS;
55 }
56@@ -1103,12 +1115,6 @@
57 return geis_subscription_bag_insert(geis->subscription_bag, subscription);
58 }
59
60-void
61-geis_remove_subscription(Geis geis, GeisSubscription subscription)
62-{
63- geis_subscription_bag_remove(geis->subscription_bag, subscription);
64-}
65-
66
67 /*
68 * Creates a new backend token.
69
70=== modified file 'libutouch-geis/geis_private.h'
71--- libutouch-geis/geis_private.h 2012-03-13 16:44:03 +0000
72+++ libutouch-geis/geis_private.h 2012-03-31 01:59:21 +0000
73@@ -75,14 +75,6 @@
74 GeisSize geis_add_subscription(Geis geis, GeisSubscription subscription);
75
76 /**
77- * Removes a subscription from the API instance.
78- *
79- * @param[in] geis The API instance.
80- * @param[in] subscription A GEIS subscirption.
81- */
82-void geis_remove_subscription(Geis geis, GeisSubscription subscription);
83-
84-/**
85 * Adds a back end file descriptor to multiplex.
86 *
87 * @param[in] geis The API instance.
88
89=== modified file 'libutouch-geis/geis_subscription.c'
90--- libutouch-geis/geis_subscription.c 2011-10-17 21:17:25 +0000
91+++ libutouch-geis/geis_subscription.c 2012-03-31 01:59:21 +0000
92@@ -428,7 +428,6 @@
93 geis_subscription_deactivate(sub);
94 if (sub->sub_geis != NULL)
95 {
96- geis_remove_subscription(sub->sub_geis, sub);
97 geis_unref(sub->sub_geis);
98 }
99 if (sub->sub_filters != NULL)

Subscribers

People subscribed via source and target branches