Add g_output_stream_write_all_async()
[platform/upstream/glib.git] / gio / tests / gdbus-threading.c
index ceb20c1..c62b223 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Author: David Zeuthen <davidz@redhat.com>
  */
@@ -26,8 +24,6 @@
 
 #include "gdbus-tests.h"
 
-static const gchar *binpath;
-
 /* all tests rely on a global connection */
 static GDBusConnection *c = NULL;
 
@@ -299,7 +295,8 @@ test_sleep_in_thread_func (gpointer _data)
                              (GAsyncReadyCallback) sleep_cb,
                              data);
           g_main_loop_run (data->thread_loop);
-          g_print ("A");
+          if (!g_test_quiet ())
+            g_print ("A");
           //g_debug ("done invoking async (%p)", g_thread_self ());
         }
       else
@@ -316,7 +313,8 @@ test_sleep_in_thread_func (gpointer _data)
                                            -1,
                                            NULL,
                                            &error);
-          g_print ("S");
+          if (!g_test_quiet ())
+            g_print ("S");
           //g_debug ("done invoking sync (%p)", g_thread_self ());
           g_assert_no_error (error);
           g_assert (result != NULL);
@@ -410,7 +408,8 @@ test_method_calls_on_proxy (GDBusProxy *proxy)
       g_assert_cmpint (elapsed_msec, >=, 3950);
       g_assert_cmpint (elapsed_msec,  <, 8000);
 
-      g_print (" ");
+      if (!g_test_quiet ())
+        g_print (" ");
     }
 }
 
@@ -446,6 +445,9 @@ test_method_calls_in_thread (void)
 
   g_object_unref (proxy);
   g_object_unref (connection);
+
+  if (!g_test_quiet ())
+    g_print ("\n");
 }
 
 #define SLEEP_MIN_USEC 1
@@ -467,7 +469,7 @@ ensure_connection_works (GDBusConnection *conn)
   g_variant_unref (v);
 }
 
-/*
+/**
  * get_sync_in_thread:
  * @data: (type guint): delay in microseconds
  *
@@ -585,17 +587,12 @@ main (int   argc,
   gint ret;
   gchar *path;
 
-  if (g_getenv ("G_TEST_DATA"))
-    binpath = g_getenv ("G_TEST_DATA");
-  else
-    binpath = BUILDDIR;
-
   g_test_init (&argc, &argv, NULL);
 
   session_bus_up ();
 
   /* this is safe; testserver will exit once the bus goes away */
-  path = g_build_filename (binpath, "gdbus-testserver", NULL);
+  path = g_test_build_filename (G_TEST_BUILT, "gdbus-testserver", NULL);
   g_assert (g_spawn_command_line_async (path, NULL));
   g_free (path);