[gegl] tests: don't use GeglConfig::tile-{width,height}



commit 64e1cf2f57a22b348e86a01d44d877f3c5a6e8bc
Author: Ell <ell_se yahoo com>
Date:   Fri Sep 21 03:29:11 2018 -0400

    tests: don't use GeglConfig::tile-{width,height}
    
    ... which were removed in commit
    628887b53b6811eaf3e47b122e1b69424fe174ad.

 tests/simple/test-buffer-hot-tile.c          | 15 ++++----
 tests/simple/test-buffer-iterator-aliasing.c | 51 ++++++++++++++++++----------
 tests/simple/test-buffer-unaligned-access.c  | 20 ++++++-----
 3 files changed, 53 insertions(+), 33 deletions(-)
---
diff --git a/tests/simple/test-buffer-hot-tile.c b/tests/simple/test-buffer-hot-tile.c
index 3ccb0d13f..aa8cbee69 100644
--- a/tests/simple/test-buffer-hot-tile.c
+++ b/tests/simple/test-buffer-hot-tile.c
@@ -33,19 +33,22 @@ static gint
 test_set_clear_get (void)
 {
   gint                 result = SUCCESS;
-  gint                 width, height;
+  gint                 tile_width, tile_height;
   const Babl          *format;
   GeglBuffer          *buffer;
   guchar               pixel;
   const GeglRectangle  pixel_rect = {0, 0, 1, 1};
 
-  g_object_get (gegl_config(),
-                "tile-width",  &width,
-                "tile-height", &height,
+  format = babl_format ("Y u8");
+  buffer = gegl_buffer_new (NULL, format);
+
+  g_object_get (buffer,
+                "tile-width",  &tile_width,
+                "tile-height", &tile_height,
                 NULL);
 
-  format = babl_format ("Y u8");
-  buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height), format);
+  gegl_buffer_set_extent (buffer,
+                          GEGL_RECTANGLE (0, 0, tile_width, tile_height));
 
   /* Write 1 to the top-left pixel of the buffer. */
   pixel = 1;
diff --git a/tests/simple/test-buffer-iterator-aliasing.c b/tests/simple/test-buffer-iterator-aliasing.c
index 85f66dac6..4d3cea04a 100644
--- a/tests/simple/test-buffer-iterator-aliasing.c
+++ b/tests/simple/test-buffer-iterator-aliasing.c
@@ -42,14 +42,18 @@ test_aligned_read_write (void)
   GeglBuffer         *buffer2;
   GeglColor          *color;
   GeglBufferIterator *iter;
-  GeglRectangle       rect = {};
+  gint                tile_width;
+  gint                tile_height;
 
-  g_object_get (gegl_config (),
-                "tile-width",  &rect.width,
-                "tile-height", &rect.height,
+  buffer1 = gegl_buffer_new (NULL, babl_format ("RGBA float"));
+
+  g_object_get (buffer1,
+                "tile-width",  &tile_width,
+                "tile-height", &tile_height,
                 NULL);
 
-  buffer1 = gegl_buffer_new (&rect, babl_format ("RGBA float"));
+  gegl_buffer_set_extent (buffer1,
+                          GEGL_RECTANGLE (0, 0, tile_width, tile_height));
 
   color = gegl_color_new ("white");
 
@@ -80,16 +84,21 @@ test_unaligned_read_write_read (void)
   GeglBuffer         *buffer2;
   GeglColor          *color;
   GeglBufferIterator *iter;
-  gint                width;
-  gint                height;
+  gint                tile_width;
+  gint                tile_height;
+
+  buffer1 = gegl_buffer_new (NULL, babl_format ("RGBA float"));
 
-  g_object_get (gegl_config (),
-                "tile-width",  &width,
-                "tile-height", &height,
+  g_object_get (buffer1,
+                "tile-width",  &tile_width,
+                "tile-height", &tile_height,
                 NULL);
 
-  buffer1 = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width + 1, height + 1),
-                             babl_format ("RGBA float"));
+  gegl_buffer_set_extent (buffer1,
+                          GEGL_RECTANGLE (0,
+                                          0,
+                                          tile_width  + 1,
+                                          tile_height + 1));
 
   color = gegl_color_new ("white");
 
@@ -100,19 +109,25 @@ test_unaligned_read_write_read (void)
   buffer2 = gegl_buffer_dup (buffer1);
 
   iter = gegl_buffer_iterator_new (buffer2,
-                                   GEGL_RECTANGLE (0,         0,
-                                                   width / 2, height / 2),
+                                   GEGL_RECTANGLE (0,
+                                                   0,
+                                                   tile_width  / 2,
+                                                   tile_height / 2),
                                    0, NULL, GEGL_ACCESS_READ, GEGL_ABYSS_NONE,
                                    3);
   gegl_buffer_iterator_add        (iter,
                                    buffer2,
-                                   GEGL_RECTANGLE (width / 2, height / 2,
-                                                   width / 2, height / 2),
+                                   GEGL_RECTANGLE (tile_width  / 2,
+                                                   tile_height / 2,
+                                                   tile_width  / 2,
+                                                   tile_height / 2),
                                    0, NULL, GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
   gegl_buffer_iterator_add        (iter,
                                    buffer2,
-                                   GEGL_RECTANGLE (0,         0,
-                                                   width / 2, height / 2),
+                                   GEGL_RECTANGLE (0,
+                                                   0,
+                                                   tile_width  / 2,
+                                                   tile_height / 2),
                                    0, NULL, GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
 
   while (gegl_buffer_iterator_next (iter));
diff --git a/tests/simple/test-buffer-unaligned-access.c b/tests/simple/test-buffer-unaligned-access.c
index ebdf0c232..f005120a9 100644
--- a/tests/simple/test-buffer-unaligned-access.c
+++ b/tests/simple/test-buffer-unaligned-access.c
@@ -102,7 +102,7 @@ test_unaligned_fill (FillFunc fill_func)
   gint                result = SUCCESS;
   const Babl         *format = babl_format ("RGBA float");
   gint                bpp    = babl_format_get_bytes_per_pixel (format);
-  gint                width, height;
+  gint                tile_width, tile_height;
   GeglRectangle       rect;
   GeglBuffer         *buffer;
   GeglBufferIterator *iter;
@@ -110,17 +110,19 @@ test_unaligned_fill (FillFunc fill_func)
   guchar              pixel1[bpp];
   guchar              pixel2[bpp];
 
-  g_object_get (gegl_config(),
-                "tile-width",  &width,
-                "tile-height", &height,
+  buffer = gegl_buffer_new (NULL, format);
+
+  g_object_get (buffer,
+                "tile-width",  &tile_width,
+                "tile-height", &tile_height,
                 NULL);
 
-  rect.x      = width  / 4;
-  rect.y      = height / 4;
-  rect.width  = width  / 2;
-  rect.height = height / 2;
+  rect.x      = tile_width  / 4;
+  rect.y      = tile_height / 4;
+  rect.width  = tile_width  / 2;
+  rect.height = tile_height / 2;
 
-  buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height), format);
+  gegl_buffer_set_extent (buffer, &rect);
 
   color = gegl_color_new ("white");
   gegl_buffer_set_color (buffer, NULL, color);


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