1 /* babl - dynamically extendable universal pixel conversion library.
2 * Copyright (C) 2005, Øyvind Kolås.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, see
16 * <https://www.gnu.org/licenses/>.
17 */
18
19 #include "config.h"
20 #include <string.h>
21 #include <stdio.h>
22 #include "babl-internal.h"
23
24 struct
25 {
26 long klass; const char *name;
27 } reference[] = {
28 { BABL_INSTANCE, "BablInstance" },
29 { BABL_TYPE, "BablType" },
30 { BABL_TYPE_INTEGER, "BablTypeInteger" },
31 { BABL_TYPE_FLOAT, "BablTypeFloat" },
32 { BABL_SAMPLING, "BablSampling" },
33 { BABL_COMPONENT, "BablComponent" },
34 { BABL_MODEL, "BablModel" },
35 { BABL_FORMAT, "BablFormat" },
36 { BABL_CONVERSION, "BablConversion" },
37 { BABL_CONVERSION_LINEAR, "BablConversionLinear" },
38 { BABL_CONVERSION_PLANE, "BablConversionPlane" },
39 { BABL_CONVERSION_PLANAR, "BablConversionPlanar" },
40 { BABL_FISH, "BablFish" },
41 { BABL_FISH_REFERENCE, "BablFishReference" },
42 { BABL_IMAGE, "BablImage" },
43 { BABL_SKY, "BablSky" },
44 { 0, NULL }
45 };
46
47 static int
test(void)48 test (void)
49 {
50 int i = 0;
51 int OK = 1;
52
53 while (reference[i].klass)
54 {
55 if (strcmp (reference[i].name, babl_class_name (reference[i].klass)))
56 {
57 OK = 0;
58 babl_log ("'%s'!='%s'\n", reference[i].name, babl_class_name (reference[i].klass));
59 }
60 i++;
61 }
62 return !OK;
63 }
64
65 int
main(int argc,char ** argv)66 main (int argc,
67 char **argv)
68 {
69 babl_init ();
70 if (test ())
71 return -1;
72 babl_exit ();
73 return 0;
74 }
75