[babl] tests: add test that creates the base fishes expected by GIMP
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] tests: add test that creates the base fishes expected by GIMP
- Date: Wed, 27 May 2020 02:47:26 +0000 (UTC)
commit 1a4b549b2bebbc1da20c640075898afe1d40a67d
Author: Øyvind Kolås <pippin gimp org>
Date: Thu May 14 17:55:05 2020 +0200
tests: add test that creates the base fishes expected by GIMP
tests/conversions.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/meson.build | 1 +
2 files changed, 73 insertions(+)
---
diff --git a/tests/conversions.c b/tests/conversions.c
new file mode 100644
index 000000000..3074c4fd7
--- /dev/null
+++ b/tests/conversions.c
@@ -0,0 +1,72 @@
+/* babl - dynamically extendable universal pixel conversion library.
+ * Copyright (C) 2005, Øyvind Kolås.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see
+ * <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#include "babl-internal.h"
+
+ static const struct
+ {
+ const char *from_format;
+ const char *to_format;
+ }
+ fishes[] =
+ {
+ { "Y' u8", "RaGaBaA float" },
+ { "Y u8", "RaGaBaA float" },
+ { "R'G'B'A u8", "RaGaBaA float" },
+ { "R'G'B'A float", "R'G'B'A u8" },
+ { "R'G'B'A float", "R'G'B' u8" },
+ { "R'G'B'A u8", "RGBA float" },
+ { "RGBA float", "R'G'B'A u8" },
+ { "RGBA float", "R'G'B'A u8" },
+ { "RGBA float", "R'G'B'A float" },
+ { "Y' u8", "R'G'B' u8" },
+ { "Y u8", "Y float" },
+ { "R'G'B' u8", "cairo-RGB24" },
+ { "R'G'B' u8", "R'G'B'A float" },
+ { "R'G'B' u8", "R'G'B'A u8" },
+ { "R'G'B'A u8", "R'G'B'A float" },
+ { "R'G'B'A u8", "cairo-ARGB32" },
+ { "R'G'B'A double", "RGBA float" },
+ { "R'G'B'A float", "RGBA double" },
+ { "R'G'B' u8", "RGB float" },
+ { "RGB float", "R'G'B'A float" },
+ { "R'G'B' u8", "RGBA float" },
+ { "RaGaBaA float", "R'G'B'A float" },
+ { "RaGaBaA float", "RGBA float" },
+ { "RGBA float", "RaGaBaA float" },
+ { "R'G'B' u8", "RaGaBaA float" },
+ { "cairo-ARGB32", "R'G'B'A u8" }
+ };
+
+int
+main (int argc,
+ char **argv)
+{
+ setenv ("BABL_DEBUG_MISSING", "1", 1);
+ babl_init ();
+
+ for (int i = 0; i < sizeof (fishes)/sizeof(fishes[0]);i ++)
+ {
+ babl_fish (babl_format (fishes[i].from_format),
+ babl_format (fishes[i].to_format));
+ }
+
+ babl_exit ();
+ return 0;
+}
diff --git a/tests/meson.build b/tests/meson.build
index a656618d5..4431ed81e 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -5,6 +5,7 @@ test_names = [
'cairo-RGB24',
'cmyk',
'chromaticities',
+ 'conversions',
'extract',
'floatclamp',
'float-to-8bit',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]