Skip to content

Commit 3796453

Browse files
committed
Always include testutil.h (or config.h) where appropriate
testutil.h includes config.h for us, but we should include it first to ensure it affects standard headers too given config.h may set feature test macros and so on. Where testutil.h is not already used, add config.h instead. (Same as done earlier for addrxlat-priv.h.) Signed-off-by: Sam James <[email protected]>
1 parent c59ccc0 commit 3796453

31 files changed

+66
-62
lines changed

tests/addrmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <stdio.h>
3032
#include <stdlib.h>
3133
#include <libkdumpfile/addrxlat.h>
3234

33-
#include "testutil.h"
34-
3535
static void
3636
printmap(const addrxlat_map_t *map)
3737
{

tests/addrxlat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <ctype.h>
3032
#include <stdio.h>
3133
#include <stdlib.h>
3234
#include <string.h>
3335
#include <getopt.h>
3436
#include <libkdumpfile/addrxlat.h>
3537

36-
#include "testutil.h"
37-
3838
#define ALLOC_INC 32
3939

4040
static size_t nentries;

tests/attriter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <string.h>
3032
#include <stdio.h>
3133
#include <libkdumpfile/kdumpfile.h>
3234

33-
#include "testutil.h"
34-
3535
struct attrdef {
3636
const char *name;
3737
const char *value;

tests/checkattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
#define _GNU_SOURCE
3030

31+
#include "testutil.h"
32+
3133
#include <string.h>
3234
#include <ctype.h>
3335
#include <stdio.h>
@@ -37,8 +39,6 @@
3739
#include <unistd.h>
3840
#include <libkdumpfile/kdumpfile.h>
3941

40-
#include "testutil.h"
41-
4242
static int
4343
check_noattr(kdump_ctx_t *ctx, char *key)
4444
{

tests/clearattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <stdio.h>
3032
#include <string.h>
3133
#include <libkdumpfile/kdumpfile.h>
3234

33-
#include "testutil.h"
34-
3535
#define ATTRPATH "linux.uts.sysname"
3636
#define ATTRVALUE "Linux"
3737

tests/custom-meth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828

2929
#define _GNU_SOURCE
3030

31+
#include "testutil.h"
32+
3133
#include <stdio.h>
3234

3335
#include <libkdumpfile/addrxlat.h>
3436

35-
#include "testutil.h"
36-
3737
#define STEPS 2
3838
#define XOR_VALUE 0xabcd
3939
#define OFFSET 0x1111

tests/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <string.h>
3032
#include <ctype.h>
3133
#include <stdio.h>
3234
#include <stdlib.h>
3335

34-
#include "testutil.h"
35-
3636
#define ALLOC_INC 4096
3737

3838
static int

tests/dumpdata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <stdlib.h>
3032
#include <stdio.h>
3133
#include <string.h>
@@ -34,8 +36,6 @@
3436
#include <unistd.h>
3537
#include <libkdumpfile/kdumpfile.h>
3638

37-
#include "testutil.h"
38-
3939
#define CHUNKSZ 256
4040
#define BYTES_PER_LINE 16
4141

tests/elf-prstatus-mod-x86_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <stdint.h>
3032
#include <stdio.h>
3133
#include <sys/stat.h>
@@ -35,8 +37,6 @@
3537
#include <endian.h>
3638
#include <libkdumpfile/kdumpfile.h>
3739

38-
#include "testutil.h"
39-
4040
struct timeval_64 {
4141
int64_t tv_sec;
4242
int64_t tv_usec;

tests/err-addrxlat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "testutil.h"
30+
2931
#include <stdio.h>
3032
#include <string.h>
3133
#include <stdlib.h>
@@ -35,8 +37,6 @@
3537

3638
#include <libkdumpfile/addrxlat.h>
3739

38-
#include "testutil.h"
39-
4040
/* To test all corner cases, this string should be bigger than
4141
* the internal fallback buffer (ERRBUF in addrxlat-priv.h)
4242
*/

0 commit comments

Comments
 (0)