/string/ |
A D | test-stpncpy.c | 19 #define STRNCPY_RESULT(dst, len, n) ((dst) + ((len) > (n) ? (n) : (len))) argument 50 SIMPLE_STPNCPY (CHAR *dst, const CHAR *src, size_t n) in SIMPLE_STPNCPY() argument 53 if ((*dst++ = *src++) == '\0') in SIMPLE_STPNCPY() 58 dst[i] = '\0'; in SIMPLE_STPNCPY() 59 return dst - 1; in SIMPLE_STPNCPY() 61 return dst; in SIMPLE_STPNCPY() 65 STUPID_STPNCPY (CHAR *dst, const CHAR *src, size_t n) in STUPID_STPNCPY() argument 71 dst[i] = src[i]; in STUPID_STPNCPY() 73 dst[i] = '\0'; in STUPID_STPNCPY() 74 return dst + nc; in STUPID_STPNCPY()
|
A D | test-mempcpy.c | 19 #define MEMCPY_RESULT(dst, len) (dst) + (len) argument 31 simple_mempcpy (char *dst, const char *src, size_t n) in simple_mempcpy() argument 34 *dst++ = *src++; in simple_mempcpy() 35 return dst; in simple_mempcpy()
|
A D | test-memcpy-support.h | 25 #define MEMCPY_RESULT(dst, len) dst argument 39 simple_memcpy (char *dst, const char *src, size_t n) in simple_memcpy() argument 41 char *ret = dst; in simple_memcpy() 43 *dst++ = *src++; in simple_memcpy() 48 builtin_memcpy (char *dst, const char *src, size_t n) in builtin_memcpy() argument 50 return __builtin_memcpy (dst, src, n); in builtin_memcpy() 63 dst[i] = 0; in do_one_test() 65 if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len)) in do_one_test() 68 CALL (impl, dst, src, len), MEMCPY_RESULT (dst, len)); in do_one_test() 73 if (memcmp (dst, src, len) != 0) in do_one_test() [all …]
|
A D | test-stpcpy.c | 19 #define STRCPY_RESULT(dst, len) ((dst) + (len)) argument 44 SIMPLE_STPCPY (CHAR *dst, const CHAR *src) in SIMPLE_STPCPY() argument 46 while ((*dst++ = *src++) != '\0'); in SIMPLE_STPCPY() 47 return dst - 1; in SIMPLE_STPCPY()
|
A D | test-memmove.c | 53 char *ret = dst; in simple_memmove() 54 if (src < dst) in simple_memmove() 56 dst += n; in simple_memmove() 59 *--dst = *--src; in simple_memmove() 63 *dst++ = *src++; in simple_memmove() 79 if (res != dst) in do_one_test() 82 res, dst); in do_one_test() 91 impl->name, dst, src); in do_one_test() 307 src = dst; in do_test2() 308 dst = large_buf; in do_test2() [all …]
|
A D | test-strcpy.c | 41 # define STRCPY_RESULT(dst, len) dst argument 63 SIMPLE_STRCPY (CHAR *dst, const CHAR *src) in SIMPLE_STRCPY() argument 65 CHAR *ret = dst; in SIMPLE_STRCPY() 66 while ((*dst++ = *src++) != '\0'); in SIMPLE_STRCPY() 74 do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, in do_one_test() argument 77 if (CALL (impl, dst, src) != STRCPY_RESULT (dst, len)) in do_one_test() 80 CALL (impl, dst, src), STRCPY_RESULT (dst, len)); in do_one_test() 85 if (STRCMP (dst, src) != 0) in do_one_test() 89 impl->name, dst, src); in do_one_test()
|
A D | test-strncpy.c | 40 # define STRNCPY_RESULT(dst, len, n) dst argument 66 SIMPLE_STRNCPY (CHAR *dst, const CHAR *src, size_t n) in SIMPLE_STRNCPY() argument 68 CHAR *ret = dst; in SIMPLE_STRNCPY() 70 if ((*dst++ = *src++) == '\0') in SIMPLE_STRNCPY() 73 *dst++ = '\0'; in SIMPLE_STRNCPY() 86 dst[i] = src[i]; in STUPID_STRNCPY() 88 dst[i] = '\0'; in STUPID_STRNCPY() 89 return dst; in STUPID_STRNCPY() 98 if (CALL (impl, dst, src, n) != STRNCPY_RESULT (dst, len, n)) in do_one_test() 101 CALL (impl, dst, src, n), dst); in do_one_test() [all …]
|
A D | argz-replace.c | 59 char *dst = 0; in __argz_replace() local 100 err = __argz_append (&dst, &dst_len, src, (arg - src)); in __argz_replace() 104 err = __argz_add (&dst, &dst_len, to); in __argz_replace() 114 err = __argz_add (&dst, &dst_len, arg); in __argz_replace() 123 *argz = dst; in __argz_replace() 128 free (dst); in __argz_replace()
|
A D | test-strcat.c | 63 SIMPLE_STRCAT (CHAR *dst, const CHAR *src) in SIMPLE_STRCAT() argument 65 CHAR *ret = dst; in SIMPLE_STRCAT() 66 while (*dst++ != '\0'); in SIMPLE_STRCAT() 67 --dst; in SIMPLE_STRCAT() 68 while ((*dst++ = *src++) != '\0'); in SIMPLE_STRCAT() 73 do_one_test (impl_t *impl, CHAR *dst, const CHAR *src) in do_one_test() argument 75 size_t k = STRLEN (dst); in do_one_test() 76 if (CALL (impl, dst, src) != dst) in do_one_test() 79 CALL (impl, dst, src), dst); in do_one_test() 84 if (STRCMP (dst + k, src) != 0) in do_one_test() [all …]
|
A D | test-memccpy.c | 31 simple_memccpy (void *dst, const void *src, int c, size_t n) in simple_memccpy() argument 34 char *d = dst; in simple_memccpy() 44 stupid_memccpy (void *dst, const void *src, int c, size_t n) in stupid_memccpy() argument 49 return mempcpy (dst, src, p - src + 1); in stupid_memccpy() 51 memcpy (dst, src, n); in stupid_memccpy() 58 do_one_test (impl_t *impl, void *dst, const void *src, int c, size_t len, in do_one_test() argument 61 void *expect = len > n ? NULL : (char *) dst + len; in do_one_test() 62 if (CALL (impl, dst, src, c, n) != expect) in do_one_test() 65 CALL (impl, dst, src, c, n), expect); in do_one_test() 70 if (memcmp (dst, src, len > n ? n : len) != 0) in do_one_test()
|
A D | test-strncat.c | 61 STUPID_STRNCAT (CHAR *dst, const CHAR *src, size_t n) in STUPID_STRNCAT() argument 63 CHAR *ret = dst; in STUPID_STRNCAT() 64 while (*dst++ != '\0'); in STUPID_STRNCAT() 65 --dst; in STUPID_STRNCAT() 67 if ((*dst++ = *src++) == '\0') in STUPID_STRNCAT() 69 *dst = '\0'; in STUPID_STRNCAT() 76 size_t k = STRLEN (dst); in do_one_test() 77 if (CALL (impl, dst, src, n) != dst) in do_one_test() 80 CALL (impl, dst, src, n), dst); in do_one_test() 86 if (MEMCMP (dst + k, src, len + 1 > n ? n : len + 1) != 0) in do_one_test() [all …]
|
A D | tester.c | 192 void *dst = one; in test_strcpy() local 193 check (strcpy (dst, src) == dst, 1); in test_strcpy() 194 equal (dst, "frobozz", 2); in test_strcpy()
|