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"};
26 for(i = 0; i < 4; i++) {
27 input2 = strdup(input1[i]);
28 input3 = strdup(input1[i]);
29 output1 = (char *)asma_ref((unsigned char *)(input2));
30 output2 = (char *)asma((unsigned char *)(input3));
36 if(memcmp(output1,output2, 16)) {
38 printf("Testfall falsch; Input war: \"%s\"\n", input1[i]);
39 printf("erwartet:\n\t\"%s\"\ntatsaechliches Ergebnis:\n\t\"%s\"\n", output1, output2);
42 for(j = 0; j < 16; j++)
43 printf("%02X", output2[j]);
47 printf("Testfall \"%s\" passt.\n", output1);