5 extern unsigned char *asma(unsigned char *s);
7 unsigned char *asma_ref(unsigned char *s)
10 for (i=0; i<16; i++) {
11 unsigned char c = s[i];
12 c += (c >= 'A' && c <= 'Z') ? 'a'-'A' : 0;
18 int main(int argc, char **argv) {
19 char *input1[]={"asdfABCDEFGHKL54", "foofuuMUHkk", "AbC", "BLA|MUHMKUH|KA"};
25 int off[] = {2,0,0,0};
27 for(i = 0; i < 4; i++) {
28 input2 = strdup(input1[i]);
29 input3 = strdup(input1[i]);
30 output1 = (char *)asma_ref((unsigned char *)(input2 + off[i]));
31 output2 = (char *)asma((unsigned char *)(input3 + off[i]));
37 if(memcmp(output1,output2, 16)) {
39 printf("Testfall falsch; Input war: \"%s\"\n", input1[i]);
40 printf("erwartet:\n\t\"%s\"\ntatsaechliches Ergebnis:\n\t\"%s\"\n", output1, output2);
43 for(j = 0; j < 16; j++)
44 printf("%02X", output2[j]);
48 printf("Testfall \"%s\" passt.\n", output1);