projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update-copyright: generalize comment handling
[gnulib.git]
/
tests
/
test-memchr2.c
diff --git
a/tests/test-memchr2.c
b/tests/test-memchr2.c
index
639ecd3
..
c7ba6b9
100644
(file)
--- a/
tests/test-memchr2.c
+++ b/
tests/test-memchr2.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008
-2009
Free Software Foundation
* Written by Eric Blake
*
* This program is free software: you can redistribute it and/or modify
* Written by Eric Blake
*
* This program is free software: you can redistribute it and/or modify
@@
-23,12
+23,15
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include "zerosize-ptr.h"
+
#define ASSERT(expr) \
do \
{ \
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
#define ASSERT(expr) \
do \
{ \
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+ fflush (stderr); \
abort (); \
} \
} \
abort (); \
} \
} \
@@
-57,7
+60,7
@@
main ()
ASSERT (MEMCHR2 (input, 'b', 'a', n) == input);
ASSERT (MEMCHR2 (input, 'a', 'b', 0) == NULL);
ASSERT (MEMCHR2 (input, 'b', 'a', n) == input);
ASSERT (MEMCHR2 (input, 'a', 'b', 0) == NULL);
- ASSERT (MEMCHR2 (
NULL
, 'a', 'b', 0) == NULL);
+ ASSERT (MEMCHR2 (
zerosize_ptr ()
, 'a', 'b', 0) == NULL);
ASSERT (MEMCHR2 (input, 'b', 'd', n) == input + 1);
ASSERT (MEMCHR2 (input + 2, 'b', 'd', n - 2) == input + 1026);
ASSERT (MEMCHR2 (input, 'b', 'd', n) == input + 1);
ASSERT (MEMCHR2 (input + 2, 'b', 'd', n - 2) == input + 1026);