gegl r2391 - in trunk: . tests/buffer tests/buffer/reference
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2391 - in trunk: . tests/buffer tests/buffer/reference
- Date: Fri, 6 Jun 2008 01:18:24 +0000 (UTC)
Author: ok
Date: Fri Jun 6 01:18:23 2008
New Revision: 2391
URL: http://svn.gnome.org/viewvc/gegl?rev=2391&view=rev
Log:
Added four new gegl_buffer_copy (buffer iteration) tests with
reference outputs. (Some of these tests as well as two other tests
currently fail after the refactoring the iteration api into place.
* tests/buffer/buffer-test.c:
(test_gegl_buffer_copy_upper_left),
(test_gegl_buffer_copy_upper_right),
(test_gegl_buffer_copy_lower_right),
(test_gegl_buffer_copy_lower_left):
* tests/buffer/reference/test_gegl_buffer_copy_lower_left:
* tests/buffer/reference/test_gegl_buffer_copy_lower_right:
* tests/buffer/reference/test_gegl_buffer_copy_upper_left:
* tests/buffer/reference/test_gegl_buffer_copy_upper_right:
Added:
trunk/tests/buffer/reference/test_gegl_buffer_copy_lower_left
trunk/tests/buffer/reference/test_gegl_buffer_copy_lower_right
trunk/tests/buffer/reference/test_gegl_buffer_copy_upper_left
trunk/tests/buffer/reference/test_gegl_buffer_copy_upper_right
Modified:
trunk/ChangeLog
trunk/tests/buffer/buffer-test.c
Modified: trunk/tests/buffer/buffer-test.c
==============================================================================
--- trunk/tests/buffer/buffer-test.c (original)
+++ trunk/tests/buffer/buffer-test.c Fri Jun 6 01:18:23 2008
@@ -498,26 +498,117 @@
GeglBuffer *buffer, *buffer2;
GeglRectangle bound = {0, 0, 20, 20};
GeglRectangle source = {2, 2, 5, 5};
- GeglRectangle dest = {10, 10, 0, 0};
+ GeglRectangle dest = {10, 10, 5, 5};
test_start ();
buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
buffer2 = gegl_buffer_new (&bound, babl_format ("Y float"));
vgrad (buffer);
- gegl_buffer_copy (buffer, &source, buffer2, &dest); /* copying to self */
+ gegl_buffer_copy (buffer, &source, buffer2, &dest);
print_buffer (buffer2);
gegl_buffer_destroy (buffer);
gegl_buffer_destroy (buffer2);
test_end ();
}
-static gchar * test_gegl_buffer_duplicate ()
+static gchar * test_gegl_buffer_copy_upper_left ()
+{
+ GeglBuffer *buffer, *buffer2;
+ GeglRectangle bound = {0, 0, 20, 20};
+ test_start ();
+ buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
+ vgrad (buffer);
+ {
+ GeglRectangle rect = *gegl_buffer_get_extent(buffer);
+
+ rect.width-=10;
+ rect.height-=10;
+ buffer2 = gegl_buffer_new (gegl_buffer_get_extent (buffer), gegl_buffer_get_format (buffer));
+ gegl_buffer_copy (buffer, &rect, buffer2, &rect);
+ }
+ print_buffer (buffer2);
+ gegl_buffer_destroy (buffer);
+ gegl_buffer_destroy (buffer2);
+ test_end ();
+}
+
+
+static gchar * test_gegl_buffer_copy_upper_right ()
+{
+ GeglBuffer *buffer, *buffer2;
+ GeglRectangle bound = {0, 0, 20, 20};
+ test_start ();
+ buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
+ vgrad (buffer);
+ {
+ GeglRectangle rect = *gegl_buffer_get_extent(buffer);
+
+ rect.x=10;
+ rect.width-=10;
+ rect.height-=10;
+ buffer2 = gegl_buffer_new (gegl_buffer_get_extent (buffer), gegl_buffer_get_format (buffer));
+ gegl_buffer_copy (buffer, &rect, buffer2, &rect);
+ }
+ print_buffer (buffer2);
+ gegl_buffer_destroy (buffer);
+ gegl_buffer_destroy (buffer2);
+ test_end ();
+}
+
+
+static gchar * test_gegl_buffer_copy_lower_right ()
{
GeglBuffer *buffer, *buffer2;
GeglRectangle bound = {0, 0, 20, 20};
test_start ();
buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
+ vgrad (buffer);
+ {
+ GeglRectangle rect = *gegl_buffer_get_extent(buffer);
+
+ rect.x=10;
+ rect.y=10;
+ rect.width-=10;
+ rect.height-=10;
+ buffer2 = gegl_buffer_new (gegl_buffer_get_extent (buffer), gegl_buffer_get_format (buffer));
+ gegl_buffer_copy (buffer, &rect, buffer2, &rect);
+ }
+ print_buffer (buffer2);
+ gegl_buffer_destroy (buffer);
+ gegl_buffer_destroy (buffer2);
+ test_end ();
+}
+static gchar * test_gegl_buffer_copy_lower_left ()
+{
+ GeglBuffer *buffer, *buffer2;
+ GeglRectangle bound = {0, 0, 20, 20};
+ test_start ();
+ buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
+ vgrad (buffer);
+ {
+ GeglRectangle rect = *gegl_buffer_get_extent(buffer);
+
+ rect.x=0;
+ rect.y=10;
+ rect.width-=10;
+ rect.height-=10;
+ buffer2 = gegl_buffer_new (gegl_buffer_get_extent (buffer), gegl_buffer_get_format (buffer));
+ gegl_buffer_copy (buffer, &rect, buffer2, &rect);
+ }
+ print_buffer (buffer2);
+ gegl_buffer_destroy (buffer);
+ gegl_buffer_destroy (buffer2);
+ test_end ();
+}
+
+
+static gchar * test_gegl_buffer_duplicate ()
+{
+ GeglBuffer *buffer, *buffer2;
+ GeglRectangle bound = {0, 0, 20, 20};
+ test_start ();
+ buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
vgrad (buffer);
buffer2 = gegl_buffer_dup (buffer);
print_buffer (buffer2);
@@ -744,8 +835,8 @@
else
{
gchar output_file[1024];
- ret=tests[i]();
printf ("%s ", test_names[i]);
+ ret=tests[i]();
sprintf (output_file, "output/%s", test_names[i]);
g_file_set_contents (output_file, ret, -1, NULL);
}
Added: trunk/tests/buffer/reference/test_gegl_buffer_copy_lower_left
==============================================================================
--- (empty file)
+++ trunk/tests/buffer/reference/test_gegl_buffer_copy_lower_left Fri Jun 6 01:18:23 2008
@@ -0,0 +1,23 @@
+Test: test_gegl_buffer_copy_lower_left
+ââââââââââââââââââââââ
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+ââââââââââââââââââââââ
Added: trunk/tests/buffer/reference/test_gegl_buffer_copy_lower_right
==============================================================================
--- (empty file)
+++ trunk/tests/buffer/reference/test_gegl_buffer_copy_lower_right Fri Jun 6 01:18:23 2008
@@ -0,0 +1,23 @@
+Test: test_gegl_buffer_copy_lower_right
+ââââââââââââââââââââââ
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+ââââââââââââââââââââââ
Added: trunk/tests/buffer/reference/test_gegl_buffer_copy_upper_left
==============================================================================
--- (empty file)
+++ trunk/tests/buffer/reference/test_gegl_buffer_copy_upper_left Fri Jun 6 01:18:23 2008
@@ -0,0 +1,23 @@
+Test: test_gegl_buffer_copy_upper_left
+ââââââââââââââââââââââ
+â â
+â â
+â â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+âââââââââââ â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+ââââââââââââââââââââââ
Added: trunk/tests/buffer/reference/test_gegl_buffer_copy_upper_right
==============================================================================
--- (empty file)
+++ trunk/tests/buffer/reference/test_gegl_buffer_copy_upper_right Fri Jun 6 01:18:23 2008
@@ -0,0 +1,23 @@
+Test: test_gegl_buffer_copy_upper_right
+ââââââââââââââââââââââ
+â â
+â â
+â â
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â âââââââââââ
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+â â
+ââââââââââââââââââââââ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]