}
-#define NUM_TESTCASES 18
+#define NUM_TESTCASES 19
int main()
{
char *input[NUM_TESTCASES]={
"ASas\0ASas",
"asdfABCDEFGHKL54",
"asdffvdfgerrggre\0",
+ "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ1234567890allyourbasearebelongtousALLYOURBASEAREBELONGTOUS1337423133711111!!!!elfeinscos(0)sin(M_PI/2)MASTEROFDESTRUCTIONlordoftheuniverseFA!LblogICANhascheezburgericanHASCHEEZBURGERRickROLLrollRICK O RLY? you got 288 IMiss Teen South Carolina"
};
- int len[NUM_TESTCASES] = {
+ int len[NUM_TESTCASES+1] = {
16,
8,
8,
9,
16,
17,
+ 296,
+ 31337
};
- int off[NUM_TESTCASES] = {
+ int off[NUM_TESTCASES+1] = {
0,
0,
0,
0,
0,
0,
+ 5,
+ 10,
};
char *output_our, *output_ref;
char *input_our, *input_ref;
int right=0, wrong=0, neither=0, i;
- for(i = 0; i < NUM_TESTCASES; i++) {
- input_our = (char *) malloc (len[i]);
- input_ref = (char *) malloc (len[i]);
+ for(i = 0; i < NUM_TESTCASES+1; i++) {
+ input_our = (char *) calloc (len[i], 16);
+ input_ref = (char *) calloc (len[i], 16);
- (void) memcpy(input_our, input[i], len[i]+1);
- (void) memcpy(input_ref, input[i], len[i]+1);
+ if(i == NUM_TESTCASES) {
+ long u;
+ for(u=0; u < len[i]; u++) {
+ input_our[u] = input_ref[u] = 'S';
+ }
+ input_our[len[i]] = input_ref[len[i]] = '\0';
+ } else {
+ (void) memcpy(input_our, input[i], len[i]+1);
+ (void) memcpy(input_ref, input[i], len[i]+1);
+ }
fillregisters();
output_our = (char *) asmb((unsigned char *) input_our+off[i]);
printf("Testfall%02i falsch!\n", i);
}
- printf("Input(\"%s\"):\n", input[i]);
- hexdump(input[i], len[i]);
+ if (i < NUM_TESTCASES) {
+ /* beim "spezialfall" wuerde das boese enden */
+ printf("Input(\"%s\"):\n", input[i]);
+ hexdump(input[i], len[i]);
+ }
printf("\nerwartet:\n");
hexdump(output_ref, len[i]);