| 1 |
/* |
| 2 |
* Copyright (c) 2019, Thomas Bernard <[email protected]> |
| 3 |
* |
| 4 |
* Permission to use, copy, modify, distribute, and sell this software and |
| 5 |
* its documentation for any purpose is hereby granted without fee, provided |
| 6 |
* that (i) the above copyright notices and this permission notice appear in |
| 7 |
* all copies of the software and related documentation, and (ii) the names of |
| 8 |
* Sam Leffler and Silicon Graphics may not be used in any advertising or |
| 9 |
* publicity relating to the software without the specific, prior written |
| 10 |
* permission of Sam Leffler and Silicon Graphics. |
| 11 |
* |
| 12 |
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, |
| 13 |
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY |
| 14 |
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. |
| 15 |
* |
| 16 |
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR |
| 17 |
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, |
| 18 |
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
| 19 |
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF |
| 20 |
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
| 21 |
* OF THIS SOFTWARE. |
| 22 |
*/ |
| 23 |
|
| 24 |
/* |
| 25 |
* TIFF Library |
| 26 |
* |
| 27 |
* Module to test ASCII tags read/write functions. |
| 28 |
*/ |
| 29 |
|
| 30 |
#include "tif_config.h" |
| 31 |
|
| 32 |
#include <stdio.h> |
| 33 |
|
| 34 |
#include "tiffio.h" |
| 35 |
|
| 36 |
#define CHECK_TYPE(t, s) \ |
| 37 |
if (sizeof(t) != s) \ |
| 38 |
{ \ |
| 39 |
fprintf(stderr, "sizeof(" #t ")=%d, it should be %d\n", \ |
| 40 |
(int)sizeof(t), (int)s); \ |
| 41 |
return 1; \ |
| 42 |
} |
| 43 |
|
| 44 |
int main() |
| 45 |
{ |
| 46 |
CHECK_TYPE(int8_t, 1) |
| 47 |
CHECK_TYPE(int16_t, 2) |
| 48 |
CHECK_TYPE(int32_t, 4) |
| 49 |
CHECK_TYPE(int64_t, 8) |
| 50 |
CHECK_TYPE(uint8_t, 1) |
| 51 |
CHECK_TYPE(uint16_t, 2) |
| 52 |
CHECK_TYPE(uint32_t, 4) |
| 53 |
CHECK_TYPE(uint64_t, 8) |
| 54 |
CHECK_TYPE(tmsize_t, sizeof(size_t)) |
| 55 |
return 0; |
| 56 |
} |