summaryrefslogtreecommitdiff
path: root/strings/str_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'strings/str_test.c')
-rw-r--r--strings/str_test.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/strings/str_test.c b/strings/str_test.c
index 3ddfca39419..3ad1392f185 100644
--- a/strings/str_test.c
+++ b/strings/str_test.c
@@ -15,9 +15,8 @@
/* Test of all stringfunktions that is coded in assembler */
-#include <my_global.h>
+#include "strings_def.h"
#include <stdarg.h>
-#include "m_string.h"
#define F_LEN 8
#define F_CHAR 'A'
@@ -50,10 +49,10 @@ int main(void)
errors=tests=0;
init_strings();
- test_arg("bcmp(from,to,5)",(long) my_test(bcmp(from,to,5)),1L);
- test_arg("bcmp(from,from,5)",(long) bcmp(from,from,5),0L);
+ test_arg("bcmp(from,to,5)",(long) my_test(bcmp((uchar*) from, (uchar*) to,5)),1L);
+ test_arg("bcmp(from,from,5)",(long) bcmp((uchar*) from, (uchar*) from,5),0L);
- test_arg("bcmp(from,to,0)",(long) bcmp(from,to,0),0L);
+ test_arg("bcmp(from,to,0)",(long) bcmp((uchar*) from, (uchar*) to,0),0L);
test_arg("strend(from)",(long) strend(from),(long) from+F_LEN);
test_arg("strchr(v1,'M')",(long) strchr(v1,'M'),(long) v1);
test_arg("strchr(v1,'y')",(long) strchr(v1,'y'),(long) v1+4);
@@ -90,10 +89,10 @@ int main(void)
test_strarg("bmove(to,from,4)",(bmove(to,from,4),0L),INT_MAX32,4,F_CHAR,
0,0);
test_strarg("bmove(to,from,0)",(bmove(to,from,0),0L),INT_MAX32,0,0);
- test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp(to+6,from+6,3),0L),INT_MAX32,
+ test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp((uchar*) to+6, (uchar*) from+6,3),0L),INT_MAX32,
3,T_CHAR,3,F_CHAR,0,0);
- test_strarg("bmove_upp(to,from,0)",(bmove_upp(to,from,0),0L),INT_MAX32,0,0);
- test_strarg("bmove_align(to,from,8)",(bmove_align(to,from,8),0L),INT_MAX32,
+ test_strarg("bmove_upp(to,from,0)",(bmove_upp((uchar*) to, (uchar*) from,0),0L),INT_MAX32,0,0);
+ test_strarg("bmove_align(to,from,8)",(bmove_align((uchar*) to, (uchar*) from,8),0L),INT_MAX32,
8,F_CHAR,0,0);
test_strarg("strappend(to,3,' ')",(strappend(to,3,' '),0L),INT_MAX32,
3,T_CHAR,1,0,T_LEN-4,T_CHAR,1,0,0,0);
@@ -124,7 +123,7 @@ int main(void)
test_strarg("strxnmov(to,2,\"!!\",NullS)",strxnmov(to,2,"!!","xx",NullS),to+2,2,'!',0,0,0);
test_strarg("strxnmov(to,2,\"!\",\"x\",\"y\",NullS)",strxnmov(to,2,"!","x","y",NullS),to+2,1,'!',1,'x',0,0,0);
- test_strarg("bchange(to,2,from,4,6)",(bchange(to,2,from,4,6),0L),INT_MAX32,
+ test_strarg("bchange(to,2,from,4,6)",(bchange((uchar*) to,2,(uchar*) from,4,6),0L),INT_MAX32,
4,F_CHAR,2,T_CHAR,0,0);
printf("tests: %d errors: %d\n",tests,errors);
@@ -233,7 +232,7 @@ int compare_buff(const char *message, char * b1, char * b2, int length,
{
int i,error=0;
- if (bcmp(b1,b2,length))
+ if (bcmp((uchar*) b1, (uchar*) b2, length))
{
errors++;
printf("func: '%s' Buffers differ\nIs: ",message);
@@ -259,19 +258,19 @@ int compare_buff(const char *message, char * b1, char * b2, int length,
return error;
} /* compare_buff */
- /* These are here to be loaded and examined */
+ /* These are here to be loaded and examined in debugger */
extern void dummy_functions(void);
void dummy_functions(void)
{
- VOID(memchr(from,'a',5));
- VOID(memcmp(from,to,5));
- VOID(memcpy(from,to,5));
- VOID(memset(from,' ',5));
- VOID(strcmp(from,to));
- VOID(strcpy(from,to));
- VOID(strstr(from,to));
- VOID(strrchr(from,'a'));
+ (void) memchr(from,'a',5);
+ (void) memcmp(from,to,5);
+ (void) memcpy(from,to,5);
+ (void) memset(from,' ',5);
+ (void) strcmp(from,to);
+ (void) strcpy(from,to);
+ (void) strstr(from,to);
+ (void) strrchr(from,'a');
return;
}