[kdbus] Fix problem with receiving messages without body
[platform/upstream/glib.git] / tests / mapping-test.c
index b3e9778..9128e35 100644 (file)
@@ -120,6 +120,8 @@ child_main (int argc, char *argv[])
   g_idle_add (signal_parent, NULL);
   g_main_loop_run (loop);
 
+ g_message ("test_child_private: received parent signal");
+
   write_or_die (childname, 
                g_mapped_file_get_contents (map),
                g_mapped_file_get_length (map));
@@ -143,6 +145,7 @@ test_mapping (void)
   map = map_or_die (filename, TRUE);
   g_assert (g_mapped_file_get_length (map) == 3);
   g_mapped_file_free (map);
+  g_message ("test_mapping: ok");
 }
 
 static void 
@@ -173,6 +176,7 @@ test_private (void)
   g_assert (strcmp (buffer, "ABC") == 0);
   g_free (buffer);
 
+  g_message ("test_private: ok");
 }
 
 static void
@@ -211,6 +215,7 @@ test_child_private (gchar *argv0)
               error->message);
       exit (1);            
     }
+ g_message ("test_child_private: child spawned");
 
 #ifndef G_OS_WIN32
   loop = g_main_loop_new (NULL, FALSE);
@@ -221,6 +226,8 @@ test_child_private (gchar *argv0)
   g_usleep (2000000);
 #endif
 
+ g_message ("test_child_private: received first child signal");
+
   buffer = (gchar *)g_mapped_file_get_contents (map);
   buffer[0] = '1';
   buffer[1] = '2';
@@ -240,6 +247,8 @@ test_child_private (gchar *argv0)
   g_usleep (2000000);
 #endif
 
+ g_message ("test_child_private: received second child signal");
+
   if (!g_file_get_contents (childname, &buffer, &len, &error))
     {
       gchar *name;
@@ -251,6 +260,8 @@ test_child_private (gchar *argv0)
   g_assert (len == 3);
   g_assert (strcmp (buffer, "ABC") == 0);
   g_free (buffer);
+
+  g_message ("test_child_private: ok");
 }
 
 static int 
@@ -274,6 +285,17 @@ main (int argc,
       char *argv[])
 {
   int ret;
+#ifndef G_OS_WIN32
+  sigset_t sig_mask, old_mask;
+
+  sigemptyset (&sig_mask);
+  sigaddset (&sig_mask, SIGUSR1);
+  if (sigprocmask (SIG_UNBLOCK, &sig_mask, &old_mask) == 0)
+    {
+      if (sigismember (&old_mask, SIGUSR1))
+        g_message ("SIGUSR1 was blocked, unblocking it");
+    }
+#endif
 
   dir = g_get_current_dir ();
   filename = g_build_filename (dir, "maptest", NULL);