comparison tests/uniconv/test-u8-strconv-to-enc.c @ 12496:a48d3d749ca5

Refactor common macros used in tests.
author Bruno Haible <bruno@clisp.org>
date Thu, 24 Dec 2009 21:01:42 +0100
parents e8d2c6fc33ad
children c2cbabec01dd
comparison
equal deleted inserted replaced
12495:16a0ada3a101 12496:a48d3d749ca5
1 /* Test of conversion from UTF-8 to legacy encodings. 1 /* Test of conversion from UTF-8 to legacy encodings.
2 Copyright (C) 2007-2008 Free Software Foundation, Inc. 2 Copyright (C) 2007-2009 Free Software Foundation, Inc.
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
19 #include <config.h> 19 #include <config.h>
20 20
21 #include "uniconv.h" 21 #include "uniconv.h"
22 22
23 #include <errno.h> 23 #include <errno.h>
24 #include <stdio.h>
25 #include <stdlib.h> 24 #include <stdlib.h>
26 #include <string.h> 25 #include <string.h>
27 26
28 #define SIZEOF(array) (sizeof (array) / sizeof (array[0])) 27 #include "macros.h"
29 #define ASSERT(expr) \
30 do \
31 { \
32 if (!(expr)) \
33 { \
34 fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
35 fflush (stderr); \
36 abort (); \
37 } \
38 } \
39 while (0)
40 28
41 int 29 int
42 main () 30 main ()
43 { 31 {
44 static enum iconv_ilseq_handler handlers[] = 32 static enum iconv_ilseq_handler handlers[] =