Changeset 2076 for trunk/src/libctests/glibc/string
- Timestamp:
- Jun 26, 2005, 12:42:04 AM (20 years ago)
- Location:
- trunk/src/libctests/glibc/string
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libctests/glibc/string/test-string.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r2075 r2076 25 25 long test; 26 26 } impl_t; 27 28 #ifdef __EMX__ /* aout based */ 29 #include <stdint.h> 30 extern uintptr_t __impls__; 31 asm (".stabs \"___impls__\", 21, 0, 0, 0xffffffff"); 32 33 #define IMPL(name, test) \ 34 impl_t tst_ ## name = { #name, (void (*) (void))name, test }; \ 35 asm (".stabs \"___impls__\", 25, 0, 0, _tst_" #name); 36 #else 27 37 extern impl_t __start_impls[], __stop_impls[]; 28 29 38 #define IMPL(name, test) \ 30 39 impl_t tst_ ## name \ 31 40 __attribute__ ((section ("impls"), aligned (sizeof (void *)))) \ 32 41 = { #name, (void (*) (void))name, test }; 42 #endif 33 43 34 44 #ifdef TEST_MAIN … … 70 80 return psz - psz2; 71 81 } 72 #endif 82 #endif 73 83 74 84 … … 124 134 (* (proto_t) (impl)->fn) (__VA_ARGS__) 125 135 136 #ifdef __EMX__ 137 #define FOR_EACH_IMPL(impl, notall) \ 138 for (uintptr_t *_ptrfirst = __impls__ == -1 ? &__impls__ - 1 : &__impls__; \ 139 _ptrfirst; \ 140 _ptrfirst = NULL) \ 141 for (uintptr_t *_ptr = *_ptrfirst == -2 ? _ptrfirst + 1 : _ptrfirst + 2; \ 142 _ptr && *_ptr != NULL; \ 143 _ptr = *_ptrfirst == -2 /* emxomf */ || (_ptr - _ptrfirst < *_ptrfirst /* a.out */ ) ? _ptr + 1 : NULL) \ 144 for (impl_t *impl = *(impl_t **)_ptr; impl; impl = NULL) \ 145 if (!notall || impl->test) 146 #else 126 147 #define FOR_EACH_IMPL(impl, notall) \ 127 148 for (impl_t *impl = __start_impls; impl < __stop_impls; ++impl) \ 128 149 if (!notall || impl->test) 150 #endif 129 151 130 152 #define HP_TIMING_BEST(best_time, start, end) \ … … 146 168 page_size = MIN_PAGE_SIZE; 147 169 #endif 170 #ifdef HAVE_MMAP 148 171 buf1 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE, 149 172 MAP_PRIVATE | MAP_ANON, -1, 0); 150 173 if (buf1 == MAP_FAILED) 151 174 error (EXIT_FAILURE, errno, "mmap failed"); 175 #else 176 buf1 = memalign (getpagesize (), 2 * page_size); 177 if (!buf1) 178 error (EXIT_FAILURE, errno, "memalign failed"); 179 #endif 152 180 if (mprotect (buf1 + page_size, page_size, PROT_NONE)) 153 181 error (EXIT_FAILURE, errno, "mprotect failed"); 182 #ifdef HAVE_MMAP 154 183 buf2 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE, 155 184 MAP_PRIVATE | MAP_ANON, -1, 0); 156 185 if (buf2 == MAP_FAILED) 157 186 error (EXIT_FAILURE, errno, "mmap failed"); 187 #else 188 buf2 = memalign (getpagesize (), 2 * page_size); 189 if (!buf2) 190 error (EXIT_FAILURE, errno, "memalign failed"); 191 #endif 158 192 if (mprotect (buf2 + page_size, page_size, PROT_NONE)) 159 193 error (EXIT_FAILURE, errno, "mprotect failed"); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/tst-strxfrm.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r2075 r2076 6 6 7 7 8 char const string[] = "";9 10 11 8 static int 12 test (const char *locale )9 test (const char *locale, const char *string) 13 10 { 14 11 size_t bufsize; … … 18 15 #ifdef HAVE_NEWLOCALE 19 16 locale_t loc; 20 #endif 17 #endif 21 18 int result = 0; 22 19 … … 55 52 56 53 freelocale (loc); 57 #endif 54 #endif 58 55 59 56 free (buf); … … 68 65 int result = 0; 69 66 70 result |= test ("C"); 71 #ifdef __BSD__ /* bsd is missing the aliases. loosers. */ 72 result |= test ("en_US.ISO8859-1"); 67 result |= test ("C", ""); 68 result |= test ("C", "abcABCxyzXYZ|+-/*(%$"); 69 #ifdef __BSD__ /* BSD is missing the aliases. loosers. */ 70 result |= test ("en_US.ISO8859-1", ""); 71 result |= test ("en_US.ISO8859-1", "abcABCxyzXYZ|+-/*(%$"); 73 72 #else 74 result |= test ("en_US.ISO-8859-1"); 75 #endif 76 result |= test ("de_DE.UTF-8"); 73 result |= test ("en_US.ISO-8859-1", ""); 74 result |= test ("en_US.ISO-8859-1", "abcABCxyzXYZ|+-/*(%$"); 75 #endif 76 result |= test ("de_DE.UTF-8", ""); 77 result |= test ("de_DE.UTF-8", "abcABCxyzXYZ|+-/*(%$"); 77 78 78 79 return result; -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.