linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes
@ 2013-08-19 14:48 Luiz Augusto von Dentz
  2013-08-19 14:48 ` [PATCH BlueZ 2/2] unit: Add gdbus/client_check_order Luiz Augusto von Dentz
  2013-08-20  0:01 ` [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes Lucas De Marchi
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2013-08-19 14:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

src_bluetoothd_DEPENDENCIES should list all local libraries including gdbus
otherwise it does not get recompiled whenever gdbus changes.
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index b8890ec..bf66c2b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -157,7 +157,7 @@ src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \
 				-Wl,--version-script=$(srcdir)/src/bluetooth.ver
 
 src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \
-						src/bluetooth.service
+				gdbus/libgdbus-internal.la src/bluetooth.service
 
 src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \
 					-DPLUGINDIR=\""$(build_plugindir)"\"
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH BlueZ 2/2] unit: Add gdbus/client_check_order
  2013-08-19 14:48 [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes Luiz Augusto von Dentz
@ 2013-08-19 14:48 ` Luiz Augusto von Dentz
  2013-08-20  0:01 ` [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes Lucas De Marchi
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2013-08-19 14:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 unit/test-gdbus-client.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index a594384..488d4ec 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -35,6 +35,7 @@ struct context {
 	GMainLoop *main_loop;
 	DBusConnection *dbus_conn;
 	GDBusClient *dbus_client;
+	GDBusProxy *proxy;
 	void *data;
 	guint timeout_source;
 };
@@ -779,6 +780,74 @@ static void client_string_changed(void)
 	destroy_context(context);
 }
 
+static void property_check_order(const DBusError *err, void *user_data)
+{
+	struct context *context = user_data;
+	GDBusProxy *proxy = context->proxy;
+	DBusMessageIter iter;
+	const char *string;
+
+	g_assert(!dbus_error_is_set(err));
+
+	g_assert(g_dbus_proxy_get_property(proxy, "String", &iter));
+
+	dbus_message_iter_get_basic(&iter, &string);
+	g_assert(g_strcmp0(string, "value1") == 0);
+
+	g_dbus_client_unref(context->dbus_client);
+}
+
+static void proxy_check_order(GDBusProxy *proxy, void *user_data)
+{
+	struct context *context = user_data;
+	const char *string;
+
+	if (g_test_verbose())
+		g_print("proxy %s found\n",
+					g_dbus_proxy_get_interface(proxy));
+
+	context->proxy = proxy;
+	string = "value1";
+	g_assert(g_dbus_proxy_set_property_basic(proxy, "String",
+					DBUS_TYPE_STRING, &string,
+					property_check_order, context,
+					NULL));
+}
+
+static void client_check_order(void)
+{
+	struct context *context = create_context();
+	static const GDBusPropertyTable string_properties[] = {
+		{ "String", "s", get_string, set_string, string_exists },
+		{ },
+	};
+
+	if (context == NULL)
+		return;
+
+	context->data = g_strdup("value");
+	g_dbus_register_interface(context->dbus_conn,
+				SERVICE_PATH, SERVICE_NAME,
+				methods, signals, string_properties,
+				context, NULL);
+
+	context->dbus_client = g_dbus_client_new(context->dbus_conn,
+						SERVICE_NAME, SERVICE_PATH);
+
+	g_dbus_client_set_disconnect_watch(context->dbus_client,
+						disconnect_handler, context);
+	g_dbus_client_set_proxy_handlers(context->dbus_client,
+						proxy_check_order, NULL, NULL,
+						context);
+
+	g_main_loop_run(context->main_loop);
+
+	g_dbus_unregister_interface(context->dbus_conn,
+					SERVICE_PATH, SERVICE_NAME);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -809,5 +878,7 @@ int main(int argc, char *argv[])
 	g_test_add_func("/gdbus/client_string_changed",
 						client_string_changed);
 
+	g_test_add_func("/gdbus/client_check_order", client_check_order);
+
 	return g_test_run();
 }
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes
  2013-08-19 14:48 [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes Luiz Augusto von Dentz
  2013-08-19 14:48 ` [PATCH BlueZ 2/2] unit: Add gdbus/client_check_order Luiz Augusto von Dentz
@ 2013-08-20  0:01 ` Lucas De Marchi
  1 sibling, 0 replies; 3+ messages in thread
From: Lucas De Marchi @ 2013-08-20  0:01 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: BlueZ development

On Mon, Aug 19, 2013 at 11:48 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> src_bluetoothd_DEPENDENCIES should list all local libraries including gdbus
> otherwise it does not get recompiled whenever gdbus changes.

relinked, not recompiled

Lucas De Marchi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-20  0:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19 14:48 [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes Luiz Augusto von Dentz
2013-08-19 14:48 ` [PATCH BlueZ 2/2] unit: Add gdbus/client_check_order Luiz Augusto von Dentz
2013-08-20  0:01 ` [PATCH BlueZ 1/2] build: Fix not rebuilding bluetoothd if gdbus changes Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).