xref: /third_party/libexif/test/test-integers.c (revision b8bc0d8a)
1b8bc0d8aSopenharmony_ci/** \file test-integers.c
2b8bc0d8aSopenharmony_ci * \brief Check assumptions about integer types (sizes, ranges).
3b8bc0d8aSopenharmony_ci *
4b8bc0d8aSopenharmony_ci * Copyright (C) 2007 Hans Ulrich Niedermann <gp@n-dimensional.de>
5b8bc0d8aSopenharmony_ci *
6b8bc0d8aSopenharmony_ci * This library is free software; you can redistribute it and/or
7b8bc0d8aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
8b8bc0d8aSopenharmony_ci * License as published by the Free Software Foundation; either
9b8bc0d8aSopenharmony_ci * version 2 of the License, or (at your option) any later version.
10b8bc0d8aSopenharmony_ci *
11b8bc0d8aSopenharmony_ci * This library is distributed in the hope that it will be useful,
12b8bc0d8aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
13b8bc0d8aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14b8bc0d8aSopenharmony_ci * Lesser General Public License for more details.
15b8bc0d8aSopenharmony_ci *
16b8bc0d8aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
17b8bc0d8aSopenharmony_ci * License along with this library; if not, write to the
18b8bc0d8aSopenharmony_ci * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19b8bc0d8aSopenharmony_ci * Boston, MA  02110-1301  USA.
20b8bc0d8aSopenharmony_ci */
21b8bc0d8aSopenharmony_ci
22b8bc0d8aSopenharmony_ci
23b8bc0d8aSopenharmony_ci#include "libexif/_stdint.h"
24b8bc0d8aSopenharmony_ci#include <assert.h>
25b8bc0d8aSopenharmony_ci
26b8bc0d8aSopenharmony_citypedef enum {
27b8bc0d8aSopenharmony_ci   EN_A,
28b8bc0d8aSopenharmony_ci   EN_B,
29b8bc0d8aSopenharmony_ci   EN_C,
30b8bc0d8aSopenharmony_ci   EN_D,
31b8bc0d8aSopenharmony_ci   EN_E,
32b8bc0d8aSopenharmony_ci   EN_F
33b8bc0d8aSopenharmony_ci} enum_t;
34b8bc0d8aSopenharmony_ci
35b8bc0d8aSopenharmony_ciint main()
36b8bc0d8aSopenharmony_ci{
37b8bc0d8aSopenharmony_ci  /* libexif assumes unsigned ints are not smaller than 32bit in many places */
38b8bc0d8aSopenharmony_ci  assert(sizeof(unsigned int) >= sizeof(uint32_t));
39b8bc0d8aSopenharmony_ci
40b8bc0d8aSopenharmony_ci  /* libexif assumes that enums fit into ints */
41b8bc0d8aSopenharmony_ci  assert(sizeof(enum_t) <= sizeof(int));
42b8bc0d8aSopenharmony_ci
43b8bc0d8aSopenharmony_ci  return 0;
44b8bc0d8aSopenharmony_ci}
45