summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* * Wait for the mock memcached to shutdown the socketRuediger Pluem2023-05-031-0/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909590 13f79535-47bb-0310-9956-ffa450edef68
* Check sockets from connection pool before using them and try to reconnectRuediger Pluem2023-05-037-0/+441
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | them if they are not usable any longer. * memcache/apr_memcache.c::ms_find_conn: Check if the socket returned from the connection pool is still readable. If not then invalidate the connection in the pool and request a new one from the connection pool. Repeat this until a valid socket is returned or this was done the maximum number of connections in the pool plus one. This ensures that at least one new socket was created. If a new socket does not work this indicates a broken backend and not just a restart in the past. In this case return an error like previously. * test/testmemcache.c: Add new test for connection validation. * test/memcachedmock.c: For the new test we need a memcached mock server that we control and can restart. * test/testmemcache.h: Shared defines between test/testmemcache.c and test/memcachedmock.c. * test/Makefile.in: * test/Makefile.win: * test/NWGNUmakefile: * test/NWGNUmemcachedmock: Needed changes to build test/memcachedmock.c on different platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909585 13f79535-47bb-0310-9956-ffa450edef68
* testatomic: Fix apr_uint64_t format to APR_UINT64_T_FMT.Yann Ylavic2023-04-211-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909310 13f79535-47bb-0310-9956-ffa450edef68
* Add a regression test for the issue where appending to a buffered fileEvgeny Kotkov2023-04-121-0/+45
| | | | | | | | | | | | was causing the content to be written at offset 0, rather than appended (see r1909088). * test/testfile.c (test_append_buffered): New test. (testfile): Run the new test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909089 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1808456 (Win32: Don't seek to the end when opening files withEvgeny Kotkov2023-04-121-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | | APR_FOPEN_APPEND). While this change fixed an issue where Windows and Unix reported different offsets after opening files for append, it also caused a regression: for files opened with APR_FOPEN_APPEND | APR_FOPEN_BUFFERED, flushing their contents would cause the contents to be written at offset 0, rather than appended. This happens because flushes and regular writes use different code paths. And while regular writes guarantee that an append will happen to the end of the file, a buffer flush uses a regular WriteFile(), assuming the file pointer has been properly set before. To fix both issues, we'd probably need to rework this part and make all writes use the same approach. But for now let's revert this change to fix the regression, that was also reported in [1]. I'll add a regression test for this problem separately. [1] https://lists.apache.org/thread/56gnyc3tc0orjh5mfsqo9gpq1br59b01 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909088 13f79535-47bb-0310-9956-ffa450edef68
* tests: check whether epoll_wait() timeout is reliable and adjust justsleep().Yann Ylavic2023-03-211-7/+23
| | | | | | | | | | | | | * configure.in: Small epoll_wait() loop to check timeout reliability and set HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT. * test/testpoll.c(justsleep): Allow some jiffy is !HAVE_EPOLL_WAIT_RELIABLE_TIMEOUT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1908616 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto_openssl: Compatibility with OpenSSL 3+Yann Ylavic2023-03-161-0/+46
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1908433 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1907986.Yann Ylavic2023-03-021-4/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907987 13f79535-47bb-0310-9956-ffa450edef68
* configure: atomic builtins might be implemented for i586 and i686.Yann Ylavic2023-03-021-1/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907986 13f79535-47bb-0310-9956-ffa450edef68
* atomic: test 4-bytes aligned and/or cross-cacheline atomics (on 32bit systems).Yann Ylavic2023-03-021-19/+33
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907985 13f79535-47bb-0310-9956-ffa450edef68
* testatomic: initialize in the test the globals used by it.Yann Ylavic2023-02-151-0/+3
| | | | | | | | | Just in case the test is later reordered (e.g. test_atomics_threaded64 and test_atomics_threaded_setread64 use the same atomic_ops64 variable). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907677 13f79535-47bb-0310-9956-ffa450edef68
* Merge thread-name branch (PR 60587) [1]:Ivan Zhakov2023-01-211-0/+31
|\ | | | | | | | | | | | | | | | | * Introduce apr_thread_name_set() and apr_thread_name_get(). [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60587 [2] https://lists.apache.org/thread/z24logzc6v8tc0p2q3375cc10qo9y5yw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906889 13f79535-47bb-0310-9956-ffa450edef68
| * On 'thread-name' branch: Add apr_thread_name_get() and apr_thread_name_set()Ivan Zhakov2022-06-271-0/+31
| | | | | | | | | | | | API to get/set thread name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/thread-name@1902297 13f79535-47bb-0310-9956-ffa450edef68
* | Remove trailing whitespaces in *.c.Ivan Zhakov2022-11-2060-455/+455
| | | | | | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
* | Remove trailing whitespaces.Ivan Zhakov2022-11-192-4/+4
| | | | | | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905407 13f79535-47bb-0310-9956-ffa450edef68
* | Replace tabs to spaces.Ivan Zhakov2022-07-081-15/+15
|/ | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902583 13f79535-47bb-0310-9956-ffa450edef68
* testencode: Follow up to r1902281: Inline, no calling convention assumptions.Yann Ylavic2022-06-271-54/+64
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902286 13f79535-47bb-0310-9956-ffa450edef68
* testencode: Follow up to r1902281: Correct call convention for encdec_fn ↵Yann Ylavic2022-06-271-1/+5
| | | | | | (try 2). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902285 13f79535-47bb-0310-9956-ffa450edef68
* testencode: Follow up to r1902281: Correct call convention for encdec_fn.Yann Ylavic2022-06-271-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902284 13f79535-47bb-0310-9956-ffa450edef68
* tests: Configure VC runtime to write errors to stderr instead of displayingIvan Zhakov2022-06-271-0/+17
| | | | | | popup message box on Windows. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902283 13f79535-47bb-0310-9956-ffa450edef68
* testencode: Follow up to r1902281: error tests for apr_decode_base16_binary.Yann Ylavic2022-06-271-2/+28
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902282 13f79535-47bb-0310-9956-ffa450edef68
* encoding: Better check inputs of apr_{encode,decode}_* functions.Yann Ylavic2022-06-271-0/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check that the given sources can be encoded without overflowing. Return APR_EINVAL if the given "slen" is negative, APR_NOTFOUND if "dest" is not NULL and "src" is NULL, or APR_ENOSPC if "dest" is NULL and the source length (based on "slen" or APR_ENCODE_STRING) is too big to encode. * include/private/apr_encode_private.h(): Rename ENCODE_TO_ASCII() and ENCODE_TO_NATIVE() to respectively TO_ASCII() and TO_ENCODE(), and make them return an unsigned char. * encoding/apr_escape.c(): Use the new TO_ASCII() and TO_NATIVE(). * encoding/apr_encode.c(apr_encode_*, apr_decode_*): Forbid negative "slen" but APR_ENCODE_STRING, and use apr_size_t arithmetics to check for overflows when encoding. When "dest" is NULL, "src" can be NULL too. Better check for trailing '='s or base16's APR_ENCODE_COLON ':' separators. Rename ENCODE_TO_ASCII and ENCODE_TO_NATIVE to their new names, and remove casts to (unsigned char) now unnecessary. * include/apr_encode.h(): Update dox about acceptable inputs and returned errors. * test/testencode.c(): Tests for error conditions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902281 13f79535-47bb-0310-9956-ffa450edef68
* test/testshm: Fix synchronization of msgput/msgwait IPC functions.Yann Ylavic2022-06-264-62/+65
| | | | | | | | | | | | | | | | * test/testshm.h(): Move (APR_INLINE) common msgput/msgwait() functions there. * test/testshm.h(msgput, msgwait): Use atomics (cas) to prevent producer and consumer from writing to the same box. * testshm.c, testshmconsumer.c, testshmproducer.c: Use common helpers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902267 13f79535-47bb-0310-9956-ffa450edef68
* poll: Follow up to r1902236: Fix poll() sleeps cases.Yann Ylavic2022-06-261-3/+3
| | | | | | | | | | Don't convert timeout to milliseconds before potentially callig apr_sleep(). Tests for "poll() didn't sleep" now use the real timeout as lower limit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902258 13f79535-47bb-0310-9956-ffa450edef68
* tests: Fix numeric types warnings.Yann Ylavic2022-06-235-9/+12
| | | | | | | | By using the right numeric comparison assertions and some explicit casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902205 13f79535-47bb-0310-9956-ffa450edef68
* testatomic: Follow up to r1902199: More numeric types assertions.Yann Ylavic2022-06-231-2/+2
| | | | | | | | | | | | * test/testatomic.c(busyloop_dec32): Use ABTS_UINT_EQUAL(). * test/testatomic.c(busyloop_dec64): Use ABTS_ULLONG_EQUAL(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902204 13f79535-47bb-0310-9956-ffa450edef68
* testatomic: Use new numeric types assertions from r1902191 to avoid warnings.Yann Ylavic2022-06-231-46/+46
| | | | | | | | | | * test/testatomic.c(): Use ABTS_UINT_EQUAL() to compare apr_uint32_t atomics, and ABTS_ULLONG_EQUAL() for apr_uint64_t ones. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902199 13f79535-47bb-0310-9956-ffa450edef68
* test/abts: Follow up to r1902191: Fix IMPL_abts_T_nequal.Yann Ylavic2022-06-231-1/+1
| | | | | | | | | * test/abts.c(IMPL_abts_T_nequal): Invert logic from IMPL_abts_T_equal (bad copypasta) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902192 13f79535-47bb-0310-9956-ffa450edef68
* test/abts: More numeric types to compare/assert.Yann Ylavic2022-06-232-45/+78
| | | | | | | | | | | | | * test/abts.h(): Declare abts_{uint,long,ulong,llong,ullong}_{n,}equal() and the corresponding ABTS_{UINT,LONG,ULONG,LLONG,ULLONG}_{N,}EQUAL() wrappers. * test/abts.c(): Implement abts_{uint,long,ulong,llong,ullong}_{n,}equal() using a common macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902191 13f79535-47bb-0310-9956-ffa450edef68
* debug for CIEric Covener2022-06-231-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902184 13f79535-47bb-0310-9956-ffa450edef68
* test/testmutexscope: Fix -Wvoid-pointer-to-enum-castYann Ylavic2022-06-231-2/+2
| | | | | | | | | * test/testmutexscope.c(test_mech_mode, eachThread): Cast to apr_uintptr_t first before converting pointer to/from enum. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902182 13f79535-47bb-0310-9956-ffa450edef68
* test/testlock: Fix -Werror=return-typeYann Ylavic2022-06-231-0/+2
| | | | | | | | | | * test/testlock.c(thread_mutex_function, thread_mutex_sleep_function): Thread (APR_THREAD_FUNC) functions should return a pointer (NULL). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902181 13f79535-47bb-0310-9956-ffa450edef68
* test/testfile.c: apr_file_datasync() fails with ENOTSUP for streams on macos.Yann Ylavic2022-06-231-0/+4
| | | | | | | | | * test/testfile.c(test_datasync_on_stream): Handle ENOTSUP on macos. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902180 13f79535-47bb-0310-9956-ffa450edef68
* testfile: try to determine how apr_file_datasync() fails for streams on macos.Yann Ylavic2022-06-221-1/+3
| | | | | | | | | * test/testfile.c(test_datasync_on_stream): Let ABTS_INT_EQUAL show the actual errno. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902175 13f79535-47bb-0310-9956-ffa450edef68
* Fix compiler warning.Ivan Zhakov2022-06-211-2/+2
| | | | | | | * test/sockperf.c: Use apr_size_t instead of int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902157 13f79535-47bb-0310-9956-ffa450edef68
* Fix compiler warning.Ivan Zhakov2022-06-211-1/+1
| | | | | | | | * test/testmd4.c (test_md4sum): Use size_t instead of int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902156 13f79535-47bb-0310-9956-ffa450edef68
* * test/testskiplist.c: Use ABTS_SIZE_EQUAL() where it makes sense.Ivan Zhakov2022-06-211-24/+24
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902155 13f79535-47bb-0310-9956-ffa450edef68
* Fix compiler warning.Ivan Zhakov2022-06-211-1/+1
| | | | | | | | * test/testskiplist.c (skiplist_get_size): Return size_t instead of int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902154 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1902107.Ivan Zhakov2022-06-201-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902108 13f79535-47bb-0310-9956-ffa450edef68
* * test/testmmap.c: Create test files in data directory instead of drive root.Ivan Zhakov2022-06-201-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902107 13f79535-47bb-0310-9956-ffa450edef68
* * test/internal/testutf.c:Ivan Zhakov2022-06-191-1/+1
| | | | | | | (displaynw): Use apr_size_t instead of int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902074 13f79535-47bb-0310-9956-ffa450edef68
* Use ABTS_SIZE_EQUAL in test suite.Ivan Zhakov2022-06-192-37/+37
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902073 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1902070: Use TESTBINPATH in code.Ivan Zhakov2022-06-191-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902071 13f79535-47bb-0310-9956-ffa450edef68
* * test/test/testproc.c: Use BINPATH in path for child process.Ivan Zhakov2022-06-191-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902070 13f79535-47bb-0310-9956-ffa450edef68
* tests: Follow up to r1902015: Fix warnings.Yann Ylavic2022-06-172-4/+2
| | | | | | | | | testmemcache.c:193:12: error: function declaration isn’t a prototype [-Werror=strict-prototypes] testmemcache.c:667:18: error: unused variable ‘rv’ [-Werror=unused-variable] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902024 13f79535-47bb-0310-9956-ffa450edef68
* tests: Check for memcache/redis servers only if memcache/redis tests configuredIvan Zhakov2022-06-172-163/+258
| | | | | | to run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902015 13f79535-47bb-0310-9956-ffa450edef68
* Normalize ucs-4 to utf-32 (documentation change)William A. Rowe Jr2022-05-242-13/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1901212 13f79535-47bb-0310-9956-ffa450edef68
* Fix various harmless cases of undefined behaviour, and add a TravisJoe Orton2022-02-141-1/+2
| | | | | | | | | | | | | | | | | | | job testing under UBSan. * poll/unix/poll.c (apr_poll): For the on-stack array allocation use num+1 since allocating a 0-length array is undefined behaviour. * tables/apr_skiplist.c (get_b_rand): Use unsigned integers to avoid signed integer overflow in the left shift. (skiplist_qpush): Avoid calling memcpy(,NULL,0). * random/unix/apr_random.c (apr_random_add_entropy): Avoid calling memcpy(,NULL,0). * test/teststr.c (overflow_strfsize): Avoid signed integer overflow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1898076 13f79535-47bb-0310-9956-ffa450edef68
* * test/testbuckets.c (flatten_match): Avoid GCC 12 -Wformat-overflowJoe Orton2022-02-011-4/+4
| | | | | | | warnings with sprintf. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897646 13f79535-47bb-0310-9956-ffa450edef68
* testcrypto: Fix warnings about unused functions (depending on the libs avail).Yann Ylavic2022-01-071-11/+55
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896805 13f79535-47bb-0310-9956-ffa450edef68