int main(int argc, const char * argv[]) { char test[420]; printf("Enter a smallish number: "); scanf("%[^\n]%*c", test); if (is_valid_int(test)) modtest(to_int(test)); printf("\n%d\t%d\n",is_valid_int(test),to_int(test)); printf("%d\t%g\n",is_valid_number(test),to_double(test)); return 420; }
void test8(memtest_control_t* mc) { unsigned int i; unsigned int err= 0; unsigned iteration = 0; TYPE p1; TYPE p2; if (global_pattern_long){ p1 = (TYPE)global_pattern_long; }else{ p1 = (TYPE)get_random_num_long(); } p2 = ~p1; repeat: PRINTF("test8[mod test]: p1=0x%lx, p2=0x%lx\n", p1,p2); for (i = 0;i < MOD_SZ; i++){ err += modtest(mc, i, p1, p2); } if (err == 0 && iteration == 0){ return; } if (iteration < MAX_ERR_ITERATION){ PRINTF("%dth repeating test8 because there are %d errors found in last run, p1=%lx, p2=%lx\n", iteration, err, p1, p2); iteration++; err = 0; goto repeat; } return; }