Changeset 2044 for trunk/src/libctests/glibc/string
- Timestamp:
- Jun 17, 2005, 6:32:39 AM (20 years ago)
- Location:
- trunk/src/libctests/glibc/string
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libctests/glibc/string/test-memccpy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2043 r2044 48 48 49 49 if (p != NULL) 50 #if 0 50 51 return mempcpy (dst, src, p - src + 1); 52 #else 53 { 54 memcpy (dst, src, p - src + 1); 55 return (char *)dst + ((char *)p - (char *)src + 1); 56 } 57 #endif 51 58 52 59 memcpy (dst, src, n); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/test-string.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2043 r2044 52 52 #define GLRO(x) _##x 53 53 #include <hp-timing.h> 54 55 /* bird added for bsd */ 56 #ifndef TEMP_FAILURE_RETRY /* special GNU idea */ 57 # define TEMP_FAILURE_RETRY(expression) \ 58 (__extension__ \ 59 ({ long int __result; \ 60 do __result = (long int) (expression); \ 61 while (__result == -1L && errno == EINTR); \ 62 __result; })) 63 #endif 64 #ifndef HAVE_STRNLEN 65 static inline size_t strnlen(const char *psz, size_t cch) 66 { 67 const char *psz2 = psz; 68 while (cch > 0 && *psz) 69 cch--, psz++; 70 return psz - psz2; 71 } 72 #endif 54 73 55 74 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/testcopy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2043 r2044 21 21 #include <stdio.h> 22 22 #include <string.h> 23 #include <malloc.h> 23 /* #include <malloc.h> - <malloc.h> has been replaced by <stdlib.h>" */ 24 24 25 25 int -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/tester.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2043 r2044 267 267 test_stpncpy (void) 268 268 { 269 #ifdef HAVE_STPNCPY 269 270 it = "stpncpy"; 270 271 memset (one, 'x', sizeof (one)); … … 277 278 check (stpncpy (one, "abcd", 6) == one + 4, 7); 278 279 check (one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8); 280 #endif 279 281 } 280 282 … … 466 468 test_strchrnul (void) 467 469 { 470 #ifdef HAVE_STRCHRNUL 468 471 const char *os; 469 472 it = "strchrnul"; … … 495 498 } 496 499 } 500 #endif 497 501 } 498 502 … … 500 504 test_rawmemchr (void) 501 505 { 506 #ifdef HAVE_RAWMEMCHR 502 507 it = "rawmemchr"; 503 508 (void) strcpy (one, "abcd"); … … 522 527 } 523 528 } 529 #endif 524 530 } 525 531 … … 573 579 test_memrchr (void) 574 580 { 581 #ifdef HAVE_MEMRCHR 575 582 size_t l; 576 583 it = "memrchr"; … … 614 621 } 615 622 } 623 #endif 616 624 } 617 625 … … 825 833 test_strsep (void) 826 834 { 835 #ifdef HAVE_STRSEP 827 836 char *ptr; 828 837 it = "strsep"; … … 953 962 check(ptr == one , 87); 954 963 check(cp == NULL, 88); 964 #endif 955 965 } 956 966 … … 1052 1062 test_mempcpy (void) 1053 1063 { 1064 #ifdef HAVE_MEMPCPY 1054 1065 int i; 1055 1066 it = "mempcpy"; … … 1084 1095 equal (two, "hi there", 12 + (i * 6)); 1085 1096 } 1097 #endif 1086 1098 } 1087 1099 … … 1263 1275 } 1264 1276 1277 1265 1278 static void 1266 1279 test_strndup (void) 1267 1280 { 1281 #ifdef HAVE_STRNDUP 1268 1282 char *p, *q; 1269 1283 it = "strndup"; … … 1285 1299 equal(p, "abc", 6); 1286 1300 free (p); 1301 #endif 1287 1302 } 1288 1303 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/tst-strlen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2043 r2044 5 5 #include <stdio.h> 6 6 #include <string.h> 7 8 #ifndef HAVE_STRNLEN 9 static inline size_t strnlen(const char *psz, size_t cch) 10 { 11 const char *psz2 = psz; 12 while (cch > 0 && *psz) 13 cch--, psz++; 14 return psz - psz2; 15 } 16 #endif 7 17 8 18 int -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/tst-strxfrm.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2043 r2044 16 16 size_t l; 17 17 char *buf; 18 #ifdef HAVE_NEWLOCALE 18 19 locale_t loc; 20 #endif 19 21 int result = 0; 20 22 … … 40 42 } 41 43 44 #ifdef HAVE_NEWLOCALE 42 45 loc = newlocale (1 << LC_ALL, locale, NULL); 43 46 … … 52 55 53 56 freelocale (loc); 57 #endif 54 58 55 59 free (buf); … … 65 69 66 70 result |= test ("C"); 71 #ifdef __BSD__ /* bsd is missing the aliases. loosers. */ 72 result |= test ("en_US.ISO8859-1"); 73 #else 67 74 result |= test ("en_US.ISO-8859-1"); 75 #endif 68 76 result |= test ("de_DE.UTF-8"); 69 77 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.