2424extern wchar_t * const PTR_000000 ;
2525extern wchar_t * const PTR_FFFFFF ;
2626
27- #if 0
27+ #if 1
2828
2929int T_wmemcmp (const wchar_t * s1 , const wchar_t * s2 , size_t n ) __NOEXCEPT __attribute__((__pure__ ));
3030wchar_t * T_wmemchr (const wchar_t * ptr , int ch , size_t count ) __NOEXCEPT __attribute__((__pure__ ));
@@ -182,6 +182,10 @@ int test_wmemset(void) {
182182 test_printf ("%p != %p\n" , ptr , (void * )0xC0FFEE );
183183 return __LINE__ ;
184184 }
185+ C (wmemset (PTR_000000 , 0x71CE , 0 ) == PTR_000000 );
186+ C (wmemset (PTR_FFFFFF , 0x71CE , 0 ) == PTR_FFFFFF );
187+ C (wmemset ((void * )0x000001 , 0x71CE , 0 ) == (void * )0x000001 );
188+
185189 wchar_t data [192 + 1 ];
186190 memset (data , 0xBC , sizeof (data ));
187191 wmemset (wmemset (& data [ 0 ], 0x0012 , 64 ) + 64 , 0x0012 , 64 );
@@ -194,7 +198,7 @@ int test_wmemset(void) {
194198 test_printf ("%p != %p\n" , res , & data [64 ]);
195199 return __LINE__ ;
196200 }
197-
201+
198202 wchar_t truth [192 + 1 ];
199203 memset (truth , 0xDE , sizeof (truth ));
200204 C (& truth [ 0 ] == wmemset (& truth [ 0 ], 0x0012 , 64 ));
@@ -230,7 +234,7 @@ int test_wmemset(void) {
230234int test_wmemmove (void ) {
231235 wchar_t move_str [] =
232236 {0x000F , 0x111F , 0x222F , 0x333F , 0x444F , 0x555F , 0x666F , 0x777F , 0x888F , 0x999F };
233- const wchar_t truth_str [] =
237+ const wchar_t truth_str [] =
234238 {0x999F , 0x333F , 0x444F , 0x444F , 0x555F , 0x444F , 0x555F , 0x666F , 0x888F , 0x999F };
235239 C (move_str + 5 == wmemmove (move_str + 5 , move_str + 4 , 3 ));
236240 C (move_str + 3 == wmemmove (move_str + 3 , move_str + 3 , 0 ));
0 commit comments