[gegl] tests: Add buffer test for abyss of a 0x0 buffer
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] tests: Add buffer test for abyss of a 0x0 buffer
- Date: Tue, 19 Nov 2013 17:52:20 +0000 (UTC)
commit eee9f71641f4f3e1f53db555e1364a0a2036eb8a
Author: Daniel Sabo <DanielSabo gmail com>
Date: Mon Nov 18 20:47:35 2013 -0800
tests: Add buffer test for abyss of a 0x0 buffer
tests/buffer/reference/get_abyss_empty_buffer.buf | 116 +++++++++++++++++++++
tests/buffer/tests/get_abyss_empty_buffer.c | 38 +++++++
2 files changed, 154 insertions(+), 0 deletions(-)
---
diff --git a/tests/buffer/reference/get_abyss_empty_buffer.buf
b/tests/buffer/reference/get_abyss_empty_buffer.buf
new file mode 100644
index 0000000..6279a08
--- /dev/null
+++ b/tests/buffer/reference/get_abyss_empty_buffer.buf
@@ -0,0 +1,116 @@
+Test: get_abyss_empty_buffer
+NONE
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+CLAMP
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+LOOP
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+BLACK
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▌ ▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+WHITE
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▌████████████████████▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
diff --git a/tests/buffer/tests/get_abyss_empty_buffer.c b/tests/buffer/tests/get_abyss_empty_buffer.c
new file mode 100644
index 0000000..b7128a3
--- /dev/null
+++ b/tests/buffer/tests/get_abyss_empty_buffer.c
@@ -0,0 +1,38 @@
+TEST ()
+{
+ GeglAbyssPolicy abyss_types[] = { GEGL_ABYSS_NONE,
+ GEGL_ABYSS_CLAMP,
+ GEGL_ABYSS_LOOP,
+ GEGL_ABYSS_BLACK,
+ GEGL_ABYSS_WHITE };
+ const gchar *abyss_names[] = { "NONE",
+ "CLAMP",
+ "LOOP",
+ "BLACK",
+ "WHITE" };
+ gint i;
+ GeglBuffer *buffer, *buffer2;
+ const Babl *format = babl_format ("Y float");
+ GeglRectangle query_rect = {-10, -10, 20, 20};
+ GeglRectangle buffer_rect = {0, 0, 0, 0};
+ gfloat buf[query_rect.width * query_rect.height * sizeof(gfloat)];
+
+ test_start ();
+ buffer = gegl_buffer_new (&buffer_rect, format);
+ buffer2 = gegl_buffer_new (&query_rect, format);
+
+ for (i = 0; i < G_N_ELEMENTS(abyss_types); ++i)
+ {
+ print (("%s\n", abyss_names[i]));
+
+ gegl_buffer_get (buffer, &query_rect, 1.0, format, buf, GEGL_AUTO_ROWSTRIDE, abyss_types[i]);
+ gegl_buffer_set (buffer2, &query_rect, 1.0, format, buf, GEGL_AUTO_ROWSTRIDE);
+
+ print_buffer (buffer2);
+ }
+
+ g_object_unref (buffer);
+ g_object_unref (buffer2);
+
+ test_end ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]