X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fnfatest1.c;h=9ca0cb91a25cd2686640c9511b915d9142405a20;hb=67471e87c134f2503546cdd250cd169b7d43d566;hp=2d4c8ab092c80b9e49acf65bfc0c7d4dfb70c72b;hpb=548d17fb92d2efaa1ef637b56fcec09a7261e842;p=yaz-moved-to-github.git diff --git a/test/nfatest1.c b/test/nfatest1.c index 2d4c8ab..9ca0cb9 100644 --- a/test/nfatest1.c +++ b/test/nfatest1.c @@ -1,7 +1,7 @@ /* Copyright (C) 2006, Index Data ApS * See the file LICENSE for details. * - * $Id: nfatest1.c,v 1.6 2006-05-10 13:58:47 heikki Exp $ + * $Id: nfatest1.c,v 1.8 2006-10-09 14:22:44 heikki Exp $ * */ @@ -35,8 +35,8 @@ void test_match(yaz_nfa *n, size_t buflen2 = buflen; i = yaz_nfa_match(n,&c, &buflen2,&resptr); if (yaz_test_get_verbosity()>3) - printf("\n'%s' returned %d. Moved c by %d, and resulted in '%s'\n", - expstr, i, (c-buf),(char*)resptr); + printf("\n'%s' returned %d. Moved c by %ld, and resulted in '%s'\n", + expstr, i, (long)(c-buf),(char*)resptr); YAZ_CHECK_EQ(buflen-buflen2, c-buf); YAZ_CHECK_EQ(i, expcode); if (i==0) @@ -46,8 +46,8 @@ void test_match(yaz_nfa *n, while((bi!=2) && (yaz_test_get_verbosity()>3)){ bi = yaz_nfa_get_backref(n, i,&cp1,&cp2); if (bi==0 && ( cp1 || cp2 ) ) { - printf(" got backref %d of %d chars (%p to %p): '", - i, cp2-cp1+1, cp1, cp2); + printf(" got backref %d of %ld chars (%p to %p): '", + i, (long)(cp2-cp1+1), cp1, cp2); while (cp2-cp1 >= 0 ) printf("%c", *cp1++); printf("'\n"); @@ -56,7 +56,7 @@ void test_match(yaz_nfa *n, } } -void construction_test() { +void construction_test(void) { yaz_nfa* n= yaz_nfa_init(); yaz_nfa_char *cp, *cp1, *cp2; yaz_nfa_state *s, *s0, *s1, *s2, *s3, *s4, *s5; @@ -185,13 +185,13 @@ void construction_test() { YAZ_CHECK_EQ(*cp1, 'z' ); YAZ_CHECK_EQ(*cp2, 'k' ); if (yaz_test_get_verbosity()>3) - printf("backref from %p '%c' to %p '%c' is %d long. sz is now %d\n", - cp1, *cp1, cp2, *cp2, cp2-cp1+1, sz ); + printf("backref from %p '%c' to %p '%c' is %ld long. sz is now %ld\n", + cp1, *cp1, cp2, *cp2, (long)(cp2-cp1+1), (long)sz ); yaz_nfa_destroy(n); } -void converter_test() { +void converter_test(void) { yaz_nfa* n= yaz_nfa_init(); yaz_nfa_converter *c1, *c2, *c3; yaz_nfa_char str1[]={'a','b','c'}; @@ -277,10 +277,11 @@ void converter_test() { YAZ_CHECK_EQ(i,YAZ_NFA_SUCCESS); i=yaz_nfa_get_backref(n, 2, &cp1, &cp2 ); if (yaz_test_get_verbosity()>3) - printf("backref from %p '%c' to %p '%c' is %d long. sz is now %d\n", - cp1, *cp1, cp2, *cp2, cp2-cp1+1, sz ); + printf("backref from %p '%c' to %p '%c' is %ld long. sz is now %ld\n", + cp1, *cp1, cp2, *cp2, (long)(cp2-cp1+1), (long)sz ); YAZ_CHECK_EQ(i,0); - YAZ_CHECK_EQ((int)c1,(int)c2); /* got our pointer back from nfa */ + /*YAZ_CHECK_EQ((int)c1,(int)c2);*/ /* got our pointer back from nfa */ + YAZ_CHECK(c1==c2); /* got our pointer back from nfa */ for(i=0;i<1024;i++) outbuf[i]=10000+i; outp=outbuf; @@ -346,7 +347,7 @@ void chkbuff( yaz_nfa_char *start, yaz_nfa_char *end, char *exp) { } -void high_level_test() { +void high_level_test(void) { NMEM nmem=nmem_create(); yaz_nfa_char from1[] = {'f','o','o','b','a','r'}; yaz_nfa_char to1[] = {'f','u','b','a','r'};