[Bug 41455] Installing unit tests

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 1 16:47:40 CET 2011


https://bugs.freedesktop.org/show_bug.cgi?id=41455

Marco Barisione <marco.barisione at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|review+                     |

--- Comment #4 from Marco Barisione <marco.barisione at collabora.co.uk> 2011-11-01 08:47:40 PDT ---
Actually:


+  gchar *command_installed[] = {
+      g_strdup_printf ("%s/%s",
+          libexec,

libexec is potentially NULL. I think printf-style functions on some platforms
are not NULL-safe.

-  if (!g_spawn_async (NULL, command, NULL, 0, NULL, NULL, NULL, &error))
+  if (abs_top_builddir != NULL)
+    {
+      if (!g_spawn_async (NULL, command_uninstalled, NULL, 0, NULL, NULL,
NULL,
+          &error))
+        {
+          g_error ("g_spawn_async: %s", error->message);
+        }
+    }
+  else
     {
-      g_error ("g_spawn_async: %s", error->message);
+      if (!g_spawn_async (NULL, command_installed, NULL, 0, NULL, NULL, NULL,
+          &error))
+        {
+          g_error ("g_spawn_async: %s", error->message);
+        }
     }

This code duplication is a bit ugly. You could rework it to make it more
readable, for instance by having command[0] assigned based on abs_top_builddir.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list