[libgda] Don't fail test if the SalesTest DSN does not exist, for bug #606018



commit f1b99decba5b933988fdb7911246de563b810f65
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue Jan 5 18:40:35 2010 +0100

    Don't fail test if the SalesTest DSN does not exist, for bug #606018

 tests/multi-threading/check_threaded_cnc.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/tests/multi-threading/check_threaded_cnc.c b/tests/multi-threading/check_threaded_cnc.c
index a2ede16..dacf061 100644
--- a/tests/multi-threading/check_threaded_cnc.c
+++ b/tests/multi-threading/check_threaded_cnc.c
@@ -650,15 +650,17 @@ test_signals (GdaConnection *cnc, GdaConnection *tcnc)
 	/* test the "dsn_changed" signal */
 	called = FALSE;
 	gda_connection_close (tcnc);
-	g_signal_connect (G_OBJECT (tcnc), "dsn-changed",
-			  G_CALLBACK (test_sig_bool_cb), &called);
-	g_object_set (G_OBJECT (tcnc), "dsn", "SalesTest", NULL);
-	if (!called) {
-		g_print ("ERROR: the threaded connection does not emit the \"dsn-changed\" signal\n");
-		return 1;
+	if (gda_config_get_dsn_info ("SalesTest")) {
+		g_signal_connect (G_OBJECT (tcnc), "dsn-changed",
+				  G_CALLBACK (test_sig_bool_cb), &called);
+		g_object_set (G_OBJECT (tcnc), "dsn", "SalesTest", NULL);
+		if (!called) {
+			g_print ("ERROR: the threaded connection does not emit the \"dsn-changed\" signal\n");
+			return 1;
+		}
+		g_signal_handlers_disconnect_by_func (G_OBJECT (tcnc),
+						      G_CALLBACK (test_sig_bool_cb), &called);
 	}
-	g_signal_handlers_disconnect_by_func (G_OBJECT (tcnc),
-					      G_CALLBACK (test_sig_bool_cb), &called);
 
 	return failures;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]