[dia] No more GLIB_CHECK_VERSION(2,16,0)



commit 04c3d1c20477bc35e10f3a6faaeb0c53daa025e8
Author: Hans Breuer <hans breuer org>
Date:   Sun Mar 27 18:11:16 2011 +0200

    No more GLIB_CHECK_VERSION(2,16,0)
    
    Lowest supported GLib version is 2.20 atm.

 app/confirm.c            |    4 ----
 tests/test-boundingbox.c |   13 +++++--------
 tests/test-objects.c     |    9 +--------
 3 files changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/app/confirm.c b/app/confirm.c
index 19f2ea3..b6467f3 100644
--- a/app/confirm.c
+++ b/app/confirm.c
@@ -60,11 +60,7 @@ confirm_export_size (Diagram *dia, GtkWindow *parent, guint flags)
     return TRUE;
   
   /* message and limits depend on the flags give */
-#if GLIB_CHECK_VERSION(2,16,0)
   size = g_format_size_for_display (bytes);
-#else
-  size = g_strdup_printf ("%d MB", (guint)(bytes >> 20));
-#endif
   if (flags & CONFIRM_PRINT)
     msg = g_strdup_printf (_("You are about to print a diagram with %d pages."), pages);
   else if ((flags & ~CONFIRM_PAGES) == 0)
diff --git a/tests/test-boundingbox.c b/tests/test-boundingbox.c
index c0f6241..d9bbdba 100644
--- a/tests/test-boundingbox.c
+++ b/tests/test-boundingbox.c
@@ -28,9 +28,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#if GLIB_CHECK_VERSION(2,16,0)
 #include <glib/gtestutils.h>
-#endif
+
 #include "dialib.h"
 
 /*
@@ -118,9 +117,9 @@ _add_bezier_tests (void)
   for (i = 0; i < num; ++i)
     {
       gchar *testpath = g_strdup_printf ("/Dia/BoundingBox/Bezier%d", i+1);
-#if GLIB_CHECK_VERSION(2,16,0)
+
       g_test_add_data_func (testpath, &_test_beziers[i], _check_one_bezier);
-#endif
+
       g_free (testpath);
     }
 }
@@ -130,7 +129,6 @@ main (int argc, char** argv)
 {
   int ret;
   
-#if GLIB_CHECK_VERSION(2,16,0)
   g_test_init (&argc, &argv, NULL);
   /* not really needed - or are there message_warnings in the bbox code? */
   libdia_init (DIA_MESSAGE_STDERR);
@@ -138,8 +136,7 @@ main (int argc, char** argv)
   _add_bezier_tests ();
 
   ret = g_test_run ();
-#else
-  g_print ("GLib version does not support g_test_*()");
-#endif
+
   return ret;
 }
+
diff --git a/tests/test-objects.c b/tests/test-objects.c
index 33b07a8..957fa0f 100644
--- a/tests/test-objects.c
+++ b/tests/test-objects.c
@@ -28,9 +28,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#if GLIB_CHECK_VERSION(2,16,0)
 #include <glib/gtestutils.h>
-#endif
 
 #include "object.h"
 #include "plug-ins.h"
@@ -401,7 +399,6 @@ _ot_item (gpointer key,
   const gchar *base = (const gchar *)user_data;
   gchar *testpath;
 
-#if GLIB_CHECK_VERSION(2,16,0)
   testpath = g_strdup_printf ("%s/%s/%s", base, name, "Creation");
   g_test_add_data_func (testpath, type, _test_creation);
   g_free (testpath);
@@ -426,7 +423,6 @@ _ot_item (gpointer key,
   testpath = g_strdup_printf ("%s/%s/%s", base, name, "ConnectionPoints");
   g_test_add_data_func (testpath, type, _test_connectionpoint_consistency);
   g_free (testpath);
-#endif
 
   ++num_objects;
 }
@@ -437,7 +433,6 @@ main (int argc, char** argv)
   GList *plugins = NULL;
   int ret = 0;
   
-#if GLIB_CHECK_VERSION(2,16,0)
   /* not using gtk_test_init() means we can only test non-gtk facilities of objects */
   g_type_init ();
   g_test_init (&argc, &argv, NULL);
@@ -467,8 +462,6 @@ main (int argc, char** argv)
 
   ret = g_test_run ();
   g_print ("%d objects.\n", num_objects);
-#else
-  g_print ("GLib version does not support g_test_*()");
-#endif
+
   return ret;
 }



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