annotate modules/memmem-tests @ 40214:452ab00796c7

Fix undefined behaviour. * lib/bitrotate.h (rotl16, rotr16, rotl8, rotr8): Case x to 'unsigned int', to avoid shift operations on 'int'. * lib/xmemdup0.c (xmemdup0): Don't invoke memcpy with a zero size. * tests/test-count-leading-zeros.c (main): Use a random number that has as many bits as TYPE, not only 2*15 or 2*31 bits. * tests/test-count-trailing-zeros.c (main): Likewise. * tests/test-count-one-bits.c (main): Likewise. * tests/test-memmem.c: Don't include "null-ptr.h". (main): Use zerosize_ptr() instead of null_ptr(). * modules/memmem-tests (Files): Remove tests/null-ptr.h.
author Bruno Haible <bruno@clisp.org>
date Sat, 09 Mar 2019 20:32:25 +0100
parents ee0db24ce906
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9538
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
1 Files:
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
2 tests/test-memmem.c
18717
ee0db24ce906 tests: Avoid compiler warning about uses of null_ptr.
Bruno Haible <bruno@clisp.org>
parents: 12496
diff changeset
3 tests/signature.h
11570
1e84e9b3384a Make some tests ISO C 99 compliant.
Bruno Haible <bruno@clisp.org>
parents: 9583
diff changeset
4 tests/zerosize-ptr.h
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12489
diff changeset
5 tests/macros.h
11570
1e84e9b3384a Make some tests ISO C 99 compliant.
Bruno Haible <bruno@clisp.org>
parents: 9583
diff changeset
6 m4/mmap-anon.m4
9538
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
7
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
8 Depends-on:
11571
0d26e7ef3771 mmap-anon: avoid out-of-order autoconf expansion
Eric Blake <ebb9@byu.net>
parents: 11570
diff changeset
9 extensions
11570
1e84e9b3384a Make some tests ISO C 99 compliant.
Bruno Haible <bruno@clisp.org>
parents: 9583
diff changeset
10 getpagesize
9538
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
11
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
12 configure.ac:
11570
1e84e9b3384a Make some tests ISO C 99 compliant.
Bruno Haible <bruno@clisp.org>
parents: 9583
diff changeset
13 gl_FUNC_MMAP_ANON
11580
89e9741f299f Make zeroptr.h work on mingw.
Bruno Haible <bruno@clisp.org>
parents: 11571
diff changeset
14 AC_CHECK_HEADERS_ONCE([sys/mman.h])
11570
1e84e9b3384a Make some tests ISO C 99 compliant.
Bruno Haible <bruno@clisp.org>
parents: 9583
diff changeset
15 AC_CHECK_FUNCS_ONCE([mprotect])
9571
72670d754431 Fix memmem test for mingw.
Eric Blake <ebb9@byu.net>
parents: 9538
diff changeset
16 AC_CHECK_DECLS_ONCE([alarm])
9538
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
17
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
18 Makefile.am:
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
19 TESTS += test-memmem
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
20 check_PROGRAMS += test-memmem
43d9769bf4d0 Fix memmem to avoid O(n^2) worst-case complexity.
Eric Blake <ebb9@byu.net>
parents:
diff changeset
21