Merge lp:~bregma/geis/lp-1252447 into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 330
Merged at revision: 325
Proposed branch: lp:~bregma/geis/lp-1252447
Merge into: lp:geis
Diff against target: 457 lines (+201/-20)
9 files modified
include/geis/geis.h (+8/-1)
libgeis/backend/dbus/geis_dbus_backend.c (+3/-1)
libgeis/backend/grail/geis_grail_backend.c (+40/-7)
libgeis/backend/test_fixture/geis_backend_test_fixture.c (+3/-1)
libgeis/geis.c (+3/-1)
libgeis/geis_backend.c (+21/-1)
libgeis/geis_backend.h (+29/-1)
libgeis/geis_backend_protected.h (+3/-1)
testsuite/geis2/gtest_devices.cpp (+91/-6)
To merge this branch: bzr merge lp:~bregma/geis/lp-1252447
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+196458@code.launchpad.net

Commit message

fix a synch problem when a subscription is activated in a callback on receipt of INIT_COMPLETE (lp: #1252447)

Description of the change

Fix a synchronization problem when a subscription is activated in a callback on receipt of the INIT_COMPLETE message before preexisting devices are recognized (lp: #1252447).

To post a comment you must log in.
lp:~bregma/geis/lp-1252447 updated
329. By Stephen M. Webb

fixed return status of new grail back end functions

330. By Stephen M. Webb

updated some copyright dates

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Testing are passing, and LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/geis/geis.h'
--- include/geis/geis.h 2012-12-04 12:39:16 +0000
+++ include/geis/geis.h 2013-11-25 02:22:49 +0000
@@ -2,7 +2,7 @@
2 * @file geis/geis.h2 * @file geis/geis.h
3 * This is the public interface for the GEIS gesture API.3 * This is the public interface for the GEIS gesture API.
4 *4 *
5 * Copyright 2010, 2011 Canonical Ltd.5 * Copyright 2010-2013 Canonical Ltd.
6 *6 *
7 * This library is free software; you can redistribute it and/or modify it under7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of version 3 of the GNU Lesser General Public License as published8 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -803,6 +803,13 @@
803 */803 */
804#define GEIS_CONFIG_TAP_TIMEOUT "com.canonical.oif.tap.timeout"804#define GEIS_CONFIG_TAP_TIMEOUT "com.canonical.oif.tap.timeout"
805805
806/**
807 * @def GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS
808 * The number of subscriptions currently active in the back end.
809 * This config is query-only and intended for unit test validations.
810 */
811#define GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS "com.canonical.oif.debug.active_subs"
812
806/* @} */813/* @} */
807814
808/**815/**
809816
=== modified file 'libgeis/backend/dbus/geis_dbus_backend.c'
--- libgeis/backend/dbus/geis_dbus_backend.c 2012-12-04 12:39:16 +0000
+++ libgeis/backend/dbus/geis_dbus_backend.c 2013-11-25 02:22:49 +0000
@@ -4,7 +4,7 @@
4 */4 */
55
6/*6/*
7 * Copyright 2011 Canonical Ltd.7 * Copyright 2011-2013 Canonical Ltd.
8 *8 *
9 * This library is free software; you can redistribute it and/or modify it under9 * This library is free software; you can redistribute it and/or modify it under
10 * the terms of version 3 of the GNU Lesser General Public License as published10 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -274,6 +274,8 @@
274 _geis_dbus_backend_create_token,274 _geis_dbus_backend_create_token,
275 _geis_dbus_accept_gesture,275 _geis_dbus_accept_gesture,
276 _geis_dbus_reject_gesture,276 _geis_dbus_reject_gesture,
277 NULL,
278 NULL,
277 _geis_dbus_get_configuration,279 _geis_dbus_get_configuration,
278 _geis_dbus_set_configuration,280 _geis_dbus_set_configuration,
279};281};
280282
=== modified file 'libgeis/backend/grail/geis_grail_backend.c'
--- libgeis/backend/grail/geis_grail_backend.c 2013-11-20 15:45:43 +0000
+++ libgeis/backend/grail/geis_grail_backend.c 2013-11-25 02:22:49 +0000
@@ -4,7 +4,7 @@
4 */4 */
55
6/*6/*
7 * Copyright 2011, 2012 Canonical Ltd.7 * Copyright 2011-2013 Canonical Ltd.
8 *8 *
9 * This library is free software: you can redistribute it and/or modify it 9 * This library is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License version 310 * under the terms of the GNU Lesser General Public License version 3
@@ -812,11 +812,14 @@
812 GeisBoolean device_applies = GEIS_TRUE;812 GeisBoolean device_applies = GEIS_TRUE;
813 for (GeisSize tindex = 0; tindex < geis_filter_term_count(*fit); ++tindex)813 for (GeisSize tindex = 0; tindex < geis_filter_term_count(*fit); ++tindex)
814 {814 {
815 if (!geis_filter_term_match_device(geis_filter_term(*fit, tindex),815 GeisFilterTerm term = geis_filter_term(*fit, tindex);
816 device))816 if (geis_filter_term_facility(term) == GEIS_FILTER_DEVICE)
817 {817 {
818 device_applies = GEIS_FALSE;818 if (!geis_filter_term_match_device(term, device))
819 break;819 {
820 device_applies = GEIS_FALSE;
821 break;
822 }
820 }823 }
821 }824 }
822825
@@ -1013,7 +1016,6 @@
1013 / sizeof(struct GeisFilterableAttribute);1016 / sizeof(struct GeisFilterableAttribute);
10141017
1015 geis_register_device(gbe->geis, geis_device, attr_count, attrs);1018 geis_register_device(gbe->geis, geis_device, attr_count, attrs);
1016 _grail_be_subscribe_new_device(gbe, geis_device);
10171019
1018 /* We are not going to hold a pointer to this geis_device ourselves */1020 /* We are not going to hold a pointer to this geis_device ourselves */
1019 geis_device_unref(geis_device);1021 geis_device_unref(geis_device);
@@ -1812,6 +1814,13 @@
1812 return retval;1814 return retval;
1813 }1815 }
18141816
1817 if (0 == strcmp(item_name, GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS))
1818 {
1819 struct GeisGrailSubscriptionData *sub_data = geis_subscription_pdata(subscription);
1820 *((GeisSize*)item_value) = geis_ugsubscription_count(sub_data->ugstore);
1821 retval = GEIS_STATUS_SUCCESS;
1822 }
1823
1815 #define GEIS_GRAIL_CHECK_GESTURE_CONFIG(gesture, Gesture, GESTURE) \1824 #define GEIS_GRAIL_CHECK_GESTURE_CONFIG(gesture, Gesture, GESTURE) \
1816 if (strcmp(item_name, GEIS_CONFIG_##GESTURE##_TIMEOUT) == 0) \1825 if (strcmp(item_name, GEIS_CONFIG_##GESTURE##_TIMEOUT) == 0) \
1817 { \1826 { \
@@ -1830,7 +1839,7 @@
1830 item_value); \1839 item_value); \
1831 }1840 }
18321841
1833 GEIS_GRAIL_CHECK_GESTURE_CONFIG(drag, Drag, DRAG)1842 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(drag, Drag, DRAG)
1834 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(pinch, Pinch, PINCH)1843 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(pinch, Pinch, PINCH)
1835 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(rotate, Rotate, ROTATE)1844 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(rotate, Rotate, ROTATE)
1836 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(tap, Tap, TAP)1845 else GEIS_GRAIL_CHECK_GESTURE_CONFIG(tap, Tap, TAP)
@@ -1921,12 +1930,36 @@
1921 return retval;1930 return retval;
1922}1931}
19231932
1933static GeisStatus
1934_grail_be_activate_device(GeisBackend be, GeisDevice device)
1935{
1936 GeisStatus status = GEIS_STATUS_SUCCESS;
1937 GeisGrailBackend gbe = (GeisGrailBackend)be;
1938 _grail_be_subscribe_new_device(gbe, device);
1939 return status;
1940}
1941
1942
1943static GeisStatus
1944_grail_be_deactivate_device(GeisBackend be, GeisDevice device)
1945{
1946 GeisStatus status = GEIS_STATUS_SUCCESS;
1947 GeisGrailBackend gbe = (GeisGrailBackend)be;
1948 UFDevice ufdevice = _grail_be_ufdevice_from_device_id(gbe,
1949 geis_device_id(device));
1950 _grail_be_unsubscribe_removed_device(gbe, ufdevice);
1951 return status;
1952}
1953
1954
1924static struct GeisBackendVtable gbe_vtbl = {1955static struct GeisBackendVtable gbe_vtbl = {
1925 _geis_grail_backend_construct,1956 _geis_grail_backend_construct,
1926 _geis_grail_backend_finalize,1957 _geis_grail_backend_finalize,
1927 geis_grail_token_new,1958 geis_grail_token_new,
1928 _grail_be_accept_gesture,1959 _grail_be_accept_gesture,
1929 _grail_be_reject_gesture,1960 _grail_be_reject_gesture,
1961 _grail_be_activate_device,
1962 _grail_be_deactivate_device,
1930 _grail_be_get_configuration,1963 _grail_be_get_configuration,
1931 _grail_be_set_configuration1964 _grail_be_set_configuration
1932};1965};
19331966
=== modified file 'libgeis/backend/test_fixture/geis_backend_test_fixture.c'
--- libgeis/backend/test_fixture/geis_backend_test_fixture.c 2012-12-04 12:39:16 +0000
+++ libgeis/backend/test_fixture/geis_backend_test_fixture.c 2013-11-25 02:22:49 +0000
@@ -2,7 +2,7 @@
2 * @file geis_backend_test_fixture.c2 * @file geis_backend_test_fixture.c
3 * @brief GEIS mock back end test fixture implementation3 * @brief GEIS mock back end test fixture implementation
4 *4 *
5 * Copyright 2010 Canonical Ltd.5 * Copyright 2010-2013 Canonical Ltd.
6 *6 *
7 * This library is free software; you can redistribute it and/or modify it under7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of version 3 of the GNU Lesser General Public License as published8 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -274,6 +274,8 @@
274 _create_token,274 _create_token,
275 _gmock_accept_gesture,275 _gmock_accept_gesture,
276 _gmock_reject_gesture,276 _gmock_reject_gesture,
277 NULL,
278 NULL,
277 _gmock_get_configuration,279 _gmock_get_configuration,
278 _gmock_set_configuration280 _gmock_set_configuration
279};281};
280282
=== modified file 'libgeis/geis.c'
--- libgeis/geis.c 2012-12-04 12:39:16 +0000
+++ libgeis/geis.c 2013-11-25 02:22:49 +0000
@@ -9,7 +9,7 @@
9 */9 */
1010
11/*11/*
12 * Copyright 2010, 2011 Canonical Ltd.12 * Copyright 2010-2013 Canonical Ltd.
13 *13 *
14 * This library is free software; you can redistribute it and/or modify it under14 * This library is free software; you can redistribute it and/or modify it under
15 * the terms of version 3 of the GNU Lesser General Public License as published15 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -156,6 +156,7 @@
156 if (event_type == GEIS_EVENT_DEVICE_AVAILABLE)156 if (event_type == GEIS_EVENT_DEVICE_AVAILABLE)
157 {157 {
158 geis_device_bag_insert(geis->devices, device);158 geis_device_bag_insert(geis->devices, device);
159 geis_backend_activate_device(geis->backend, device);
159 }160 }
160161
161 if (geis->device_event_callback != GEIS_DEFAULT_EVENT_CALLBACK)162 if (geis->device_event_callback != GEIS_DEFAULT_EVENT_CALLBACK)
@@ -166,6 +167,7 @@
166167
167 if (event_type == GEIS_EVENT_DEVICE_UNAVAILABLE)168 if (event_type == GEIS_EVENT_DEVICE_UNAVAILABLE)
168 {169 {
170 geis_backend_deactivate_device(geis->backend, device);
169 geis_device_bag_remove(geis->devices, device);171 geis_device_bag_remove(geis->devices, device);
170 }172 }
171173
172174
=== modified file 'libgeis/geis_backend.c'
--- libgeis/geis_backend.c 2012-12-04 12:39:16 +0000
+++ libgeis/geis_backend.c 2013-11-25 02:22:49 +0000
@@ -2,7 +2,7 @@
2 * @file geis_backend.c2 * @file geis_backend.c
3 * @brief internal GEIS back end base class implementation3 * @brief internal GEIS back end base class implementation
4 *4 *
5 * Copyright 2010 Canonical Ltd.5 * Copyright 2010-2013 Canonical Ltd.
6 *6 *
7 * This library is free software; you can redistribute it and/or modify it under7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of version 3 of the GNU Lesser General Public License as published8 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -199,6 +199,26 @@
199}199}
200200
201201
202GeisStatus
203geis_backend_activate_device(GeisBackend be,
204 GeisDevice device)
205{
206 if (be->be_class->vtbl->activate_device)
207 return be->be_class->vtbl->activate_device(_data_from_be(be), device);
208 return GEIS_STATUS_SUCCESS;
209}
210
211
212GeisStatus
213geis_backend_deactivate_device(GeisBackend be,
214 GeisDevice device)
215{
216 if (be->be_class->vtbl->deactivate_device)
217 return be->be_class->vtbl->deactivate_device(_data_from_be(be), device);
218 return GEIS_STATUS_SUCCESS;
219}
220
221
202/*222/*
203 * Gets a back end configuration value.223 * Gets a back end configuration value.
204 */224 */
205225
=== modified file 'libgeis/geis_backend.h'
--- libgeis/geis_backend.h 2012-12-04 12:39:16 +0000
+++ libgeis/geis_backend.h 2013-11-25 02:22:49 +0000
@@ -2,7 +2,7 @@
2 * @file geis_backend.h2 * @file geis_backend.h
3 * @brief internal GEIS back end base class public interface3 * @brief internal GEIS back end base class public interface
4 *4 *
5 * Copyright 2010, 2012 Canonical Ltd.5 * Copyright 2010-2013 Canonical Ltd.
6 *6 *
7 * This library is free software; you can redistribute it and/or modify it under7 * This library is free software; you can redistribute it and/or modify it under
8 * the terms of version 3 of the GNU Lesser General Public License as published8 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -90,6 +90,34 @@
90 GeisGestureId gesture_id);90 GeisGestureId gesture_id);
9191
92/**92/**
93 * Tells the back end to activate a device after it's been set up.
94 *
95 * @param[in] be The GEIS back end.
96 * @param[in] device The GEIS device for which subscription wll activate.
97 *
98 * The back end sends and event to the middle end when a new device has been
99 * detected. The middle end sets up some structures etc., then tells the back
100 * end to activate the device (which may actually cause some subscriptions to be
101 * activated), then forwards the new-device event to the front end where the
102 * application can be made aware of it.
103 */
104GeisStatus
105geis_backend_activate_device(GeisBackend be,
106 GeisDevice device);
107
108/**
109 * Tells the back end to activate a device after it's been set up.
110 *
111 * @param[in] be The GEIS back end.
112 * @param[in] device The GEIS device for which subscription wll deactivate.
113 *
114 * See geis_backend_activate_device for more information.
115 */
116GeisStatus
117geis_backend_deactivate_device(GeisBackend be,
118 GeisDevice device);
119
120/**
93 * Gets a back end configuration value.121 * Gets a back end configuration value.
94 *122 *
95 * @param[in] be The back end.123 * @param[in] be The back end.
96124
=== modified file 'libgeis/geis_backend_protected.h'
--- libgeis/geis_backend_protected.h 2012-12-04 12:39:16 +0000
+++ libgeis/geis_backend_protected.h 2013-11-25 02:22:49 +0000
@@ -7,7 +7,7 @@
7 */7 */
88
9/*9/*
10 * Copyright 2010, 2012 Canonical Ltd.10 * Copyright 2010-2013 Canonical Ltd.
11 *11 *
12 * This library is free software; you can redistribute it and/or modify it under12 * This library is free software; you can redistribute it and/or modify it under
13 * the terms of version 3 of the GNU Lesser General Public License as published13 * the terms of version 3 of the GNU Lesser General Public License as published
@@ -39,6 +39,8 @@
39 GeisBackendToken (* create_token)(GeisBackend, GeisBackendTokenInitState);39 GeisBackendToken (* create_token)(GeisBackend, GeisBackendTokenInitState);
40 GeisStatus (* accept_gesture)(GeisBackend, GeisGroup, GeisGestureId);40 GeisStatus (* accept_gesture)(GeisBackend, GeisGroup, GeisGestureId);
41 GeisStatus (* reject_gesture)(GeisBackend, GeisGroup, GeisGestureId);41 GeisStatus (* reject_gesture)(GeisBackend, GeisGroup, GeisGestureId);
42 GeisStatus (* activate_device)(GeisBackend, GeisDevice);
43 GeisStatus (* deactivate_device)(GeisBackend, GeisDevice);
42 GeisStatus (* get_configuration)(GeisBackend, GeisSubscription, GeisString, GeisPointer);44 GeisStatus (* get_configuration)(GeisBackend, GeisSubscription, GeisString, GeisPointer);
43 GeisStatus (* set_configuration)(GeisBackend, GeisSubscription, GeisString, GeisPointer);45 GeisStatus (* set_configuration)(GeisBackend, GeisSubscription, GeisString, GeisPointer);
44} *GeisBackendVtable;46} *GeisBackendVtable;
4547
=== modified file 'testsuite/geis2/gtest_devices.cpp'
--- testsuite/geis2/gtest_devices.cpp 2013-11-20 19:38:11 +0000
+++ testsuite/geis2/gtest_devices.cpp 2013-11-25 02:22:49 +0000
@@ -1,7 +1,7 @@
1/**1/**
2 * GTEst test suite for GEIS v2 device handling.2 * GTEst test suite for GEIS v2 device handling.
3 *3 *
4 * Copyright 2012 Canonical Ltd.4 * Copyright 2012-2013 Canonical Ltd.
5 */5 */
6#include "geis/geis.h"6#include "geis/geis.h"
7#include "gtest_evemu_device.h"7#include "gtest_evemu_device.h"
@@ -22,7 +22,7 @@
22 * Fixture for testing device handling.22 * Fixture for testing device handling.
23 * This is a separate class because gtest uses Java reflection.23 * This is a separate class because gtest uses Java reflection.
24 */24 */
25class GeisDeviceTests25class GeisBasicDeviceTests
26: public GTestGeisFixture26: public GTestGeisFixture
27{27{
28 void28 void
@@ -36,7 +36,33 @@
36};36};
3737
3838
39TEST_F(GeisDeviceTests, filterWithNoDevices)39/**
40 * Fixture for testing device handling.
41 * This is a separate class because gtest uses Java reflection.
42 */
43class GeisAdvancedDeviceTests
44: public GTestGeisFixture
45{
46
47 void
48 setup_geis()
49 {
50 new_device_.reset(new Testsuite::EvemuDevice(TEST_DEVICE_PROP_FILE));
51 geis_ = geis_new(GEIS_INIT_TRACK_DEVICES,
52 NULL);
53 geis_initialized_in_callback_ = false;
54 device_count_ = 0;
55 }
56
57public:
58 std::unique_ptr<Testsuite::EvemuDevice> new_device_;
59 bool geis_initialized_in_callback_;
60 int device_count_;
61 GeisSubscription subscription_;
62};
63
64
65TEST_F(GeisBasicDeviceTests, filterWithNoDevices)
40{66{
41 GeisSubscription sub = geis_subscription_new(geis_,67 GeisSubscription sub = geis_subscription_new(geis_,
42 "no devices",68 "no devices",
@@ -65,7 +91,7 @@
65 * device-added event is received, a recording is run through the device.91 * device-added event is received, a recording is run through the device.
66 * Gesture events should be detected.92 * Gesture events should be detected.
67 */93 */
68TEST_F(GeisDeviceTests, addDeviceSubscription)94TEST_F(GeisBasicDeviceTests, addDeviceSubscription)
69{95{
70 std::unique_ptr<Testsuite::EvemuDevice> new_device;96 std::unique_ptr<Testsuite::EvemuDevice> new_device;
71 GeisBoolean device_has_been_created = GEIS_FALSE;97 GeisBoolean device_has_been_created = GEIS_FALSE;
@@ -132,7 +158,7 @@
132 *158 *
133 * This test really just makes sure nothing segfaults on device removal.159 * This test really just makes sure nothing segfaults on device removal.
134 */160 */
135TEST_F(GeisDeviceTests, removeDeviceSubscription)161TEST_F(GeisBasicDeviceTests, removeDeviceSubscription)
136{162{
137 std::unique_ptr<Testsuite::EvemuDevice> new_device;163 std::unique_ptr<Testsuite::EvemuDevice> new_device;
138164
@@ -183,7 +209,7 @@
183 * This test creates a devicve with known X and Y extents and verifies the209 * This test creates a devicve with known X and Y extents and verifies the
184 * extent attributes are reported with the expected values.210 * extent attributes are reported with the expected values.
185 */211 */
186TEST_F(GeisDeviceTests, deviceAttrs)212TEST_F(GeisBasicDeviceTests, deviceAttrs)
187{213{
188 GeisBoolean off = GEIS_FALSE;214 GeisBoolean off = GEIS_FALSE;
189 geis_set_configuration(geis_, GEIS_CONFIG_DISCARD_DEVICE_MESSAGES, &off);215 geis_set_configuration(geis_, GEIS_CONFIG_DISCARD_DEVICE_MESSAGES, &off);
@@ -222,4 +248,63 @@
222}248}
223249
224250
251/**
252 * GEIS event callback to verify lp:1252447.
253 *
254 * This bug reveals that subscriptions created in an event callback when the
255 * INIT_COMPLETE event is received never get activated for devices that are
256 * present at GEIS start time.
257 */
258static void
259lp_1252447_event_callback(::Geis geis, GeisEvent event, void* context)
260{
261 GeisAdvancedDeviceTests* fixture = (GeisAdvancedDeviceTests*)context;
262 switch (geis_event_type(event))
263 {
264 case GEIS_EVENT_INIT_COMPLETE:
265 {
266 fixture->geis_initialized_in_callback_ = true;
267 fixture->subscription_ = geis_subscription_new(geis,
268 "any device",
269 GEIS_SUBSCRIPTION_NONE);
270 GeisFilter filter = geis_filter_new(geis, "filter");
271 geis_filter_add_term(filter,
272 GEIS_FILTER_CLASS,
273 GEIS_GESTURE_ATTRIBUTE_TOUCHES, GEIS_FILTER_OP_EQ, 2,
274 NULL);
275 EXPECT_EQ(geis_subscription_add_filter(fixture->subscription_, filter),
276 GEIS_STATUS_SUCCESS);
277 EXPECT_EQ(geis_subscription_activate(fixture->subscription_),
278 GEIS_STATUS_SUCCESS);
279 break;
280 }
281
282 case GEIS_EVENT_DEVICE_AVAILABLE:
283 {
284 ++fixture->device_count_;
285 GeisSize active_sub_count = 0;
286 geis_subscription_get_configuration(fixture->subscription_,
287 GEIS_CONFIG_NUM_ACTIVE_SUBSCRIPTIONS,
288 &active_sub_count);
289 EXPECT_GT(active_sub_count, 0);
290 break;
291 }
292
293 default:
294 break;
295 }
296}
297
298TEST_F(GeisAdvancedDeviceTests, initialDeviceRegistrationWithCallbacks)
299{
300 geis_register_event_callback(geis_, lp_1252447_event_callback, this);
301 geis_register_device_callback(geis_, lp_1252447_event_callback, this);
302
303 set_geis_event_handler([&](Geis, GeisEvent event) { });
304 geis_dispatch_loop();
305 ASSERT_TRUE(geis_initialized_in_callback_);
306 ASSERT_GT(device_count_, 0);
307}
308
309
225} // anonymous namespace310} // anonymous namespace

Subscribers

People subscribed via source and target branches