[gnome-photos/wip/rishi/unit-tests-gegl: 2/3] tests: Test the GEGL utilities



commit bc4164fed0960e3886126811f15d2c5d7e07b278
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 16 08:51:09 2018 +0100

    tests: Test the GEGL utilities

 tests/unit/Makefile.am        | 18 ++++++++++
 tests/unit/meson.build        |  3 ++
 tests/unit/photos-test-gegl.c | 78 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+)
---
diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am
index f4278c31..c180591e 100644
--- a/tests/unit/Makefile.am
+++ b/tests/unit/Makefile.am
@@ -10,9 +10,27 @@ dist_test_data = \
        $(NULL)
 
 test_programs = \
+       photos-test-gegl \
        photos-test-pipeline \
        $(NULL)
 
+photos_test_gegl_CPPFLAGS = \
+       $(GDK_PIXBUF_CFLAGS) \
+       $(GEGL_CFLAGS) \
+       $(GIO_CFLAGS) \
+       $(GLIB_CFLAGS) \
+       -I$(top_builddir)/src \
+       -I$(top_srcdir)/src \
+       $(NULL)
+
+photos_test_gegl_LDADD = \
+       $(GDK_PIXBUF_LIBS) \
+       $(GEGL_LIBS) \
+       $(GIO_LIBS) \
+       $(GLIB_LIBS) \
+       $(top_builddir)/src/libgnome-photos.la \
+       $(NULL)
+
 photos_test_pipeline_CPPFLAGS = \
        $(GDK_PIXBUF_CFLAGS) \
        $(GEGL_CFLAGS) \
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index b1b3f4f4..623fbe55 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -12,6 +12,9 @@ test_env.set('MALLOC_CHECK_', '2')
 test_env.set('MALLOC_PERTURB_', '@0@'.format(random_number % 256))
 
 tests = {
+  'photos-test-gegl': {
+    'dependencies': [gdk_pixbuf_dep, gegl_dep, gio_dep, gio_unix_dep, glib_dep, libgnome_photos_dep]
+  },
   'photos-test-pipeline': {
     'dependencies': [gdk_pixbuf_dep, gegl_dep, gio_dep, gio_unix_dep, glib_dep, libgnome_photos_dep]
   },
diff --git a/tests/unit/photos-test-gegl.c b/tests/unit/photos-test-gegl.c
new file mode 100644
index 00000000..7033c20d
--- /dev/null
+++ b/tests/unit/photos-test-gegl.c
@@ -0,0 +1,78 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2018 Red Hat, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "config.h"
+
+#include <locale.h>
+
+#include <gegl.h>
+#include <glib.h>
+
+#include "photos-debug.h"
+#include "photos-gegl.h"
+
+
+typedef struct _PhotosTestGeglFixture PhotosTestGeglFixture;
+
+struct _PhotosTestGeglFixture
+{
+};
+
+
+static void
+photos_test_gegl_setup (PhotosTestGeglFixture *fixture, gconstpointer user_data)
+{
+}
+
+
+static void
+photos_test_gegl_teardown (PhotosTestGeglFixture *fixture, gconstpointer user_data)
+{
+}
+
+
+static void
+photos_test_gegl_buffer_apply_orientation_bottom_0 (PhotosTestGeglFixture *fixture, gconstpointer user_data)
+{
+}
+
+
+gint
+main (gint argc, gchar *argv[])
+{
+  gint exit_status;
+
+  setlocale (LC_ALL, "");
+  g_test_init (&argc, &argv, NULL);
+  photos_debug_init ();
+  photos_gegl_init ();
+  photos_gegl_ensure_builtins ();
+
+  g_test_add ("/gegl/buffer/apply_orientation/bottom-0",
+              PhotosTestGeglFixture,
+              NULL,
+              photos_test_gegl_setup,
+              photos_test_gegl_buffer_apply_orientation_bottom_0,
+              photos_test_gegl_teardown);
+
+  exit_status = g_test_run ();
+
+  gegl_exit ();
+  return exit_status;
+}


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