Beispiel #1
0
int main(int argc, char* argv[]) {
  int failct = 0;
  failct += append_size_test();
  failct += append_apply_test();
  failct += remove_size_test();
  failct += remove_value_test();
  failct += reverse_test();
  failct += sort_test();
  if(failct == 0){
    printf("All tests successful.\n");
  }else{
    printf("Some tests did not pass successfully.\n");
  }
}
int main()
{
    copy_test();
    copy_backward_test();
    transform_test();
    replace_test();
    replace_if_test();
    replace_copy_test();
    replace_copy_if_test();
    fill_test();
    fill_n_test();
    generate_test();
    generate_n_test();
    remove_test();
    remove_if_test();
    remove_copy_test();
    remove_copy_if_test();
    unique_test();
    unique_copy_test();
    reverse_test();
    reverse_copy_test();
    boost::report_errors();
}
Beispiel #3
0
int main(int argc,char **argv)
{
    progname = argv[0];
    int do_bugs = 0;
    int do_sequential = 0;
    int do_reverse    = 0;
    int do_random_write_test = 0;
    int do_random_read_test  = 0;
    int do_large_file = 0;
    int do_maxsize_test = 0;
    int random_repeat = 1;
    int do_sparse_test = 0;
    int do_all=0;
    int do_image_test =1;
    int ch;

    const char *bigdir = getenv(AFFLIB_BIGTMP);	// use by default

    if(bigdir) tempdir = bigdir;

    setvbuf(stdout,0,_IONBF,0);
    //putenv(AFFLIB_CACHE_STATS"=1");

    if(argc==1){
	printf("running all tests with -a option (exception bigfile test)\n");
	do_all = 1;
    }

    while ((ch = getopt(argc, argv, "b123456aBLd:h?f:e:c:TCp:rx:R:z:tn:D:S:")) != -1) {
	switch(ch){
	case 'D': af_trace = fopen(optarg,"w");break;
	case 'R': readfile_test(optarg); break;
	case 'b':
	    do_bugs = 1;
	    break;
	case '1':
	    do_sequential = 1;
	    break;
	case '2':
	    do_reverse = 1;
	    break;
	case '3':
	    do_random_write_test = 1;
	    break;
	case '4':
	    do_random_read_test = 1;
	    break;
	case '5':
	    do_maxsize_test = 1;
	    break;
	case '6': do_sparse_test = 1; break;
	case 'l':
	    random_repeat = atoi(optarg);
	    break;
	case 'B':
	    do_large_file = 1;
	    break;
	case 'n': MAX_FMTS = atoi(optarg); break;
	case 't': time_test(); break;
	case 'L': opt_compression_type = AF_COMPRESSION_ALG_LZMA; break;
	case 'T': lzma_test(); break;
	case 'r': rsatest(); break;
	case 'a':
	    do_all = 1;
	    break;
	case 'z':
	    zap(optarg);break;
	case 'd': tempdir = optarg; break;
	case 'f': figure(optarg); break;
	case 'e': opt_ext = optarg; break;
	case 'c': compress(optarg); break;
	    
	case 'p': opt_protocol = optarg; break;
	case 'x': xmltest(optarg);break;
	case 'C': aestest(); break;
	case 'i': do_image_test=1;break;
	case 'S': split_raw_test(optarg);exit(0);
	case 'h':
	case '?':
	default:
	    usage();
	}
    }
	
    if(do_bugs || do_all) bugs_test();
    if(do_sequential || do_all) sequential_test();
    if(do_reverse || do_all ) reverse_test();
    if(do_maxsize_test || do_all) maxsize_test();
    if(do_sparse_test || do_all) sparse_test();
    if(do_image_test || do_all) image_test();

    for(int i=0;i<random_repeat;i++){
	if(do_random_read_test  || do_all) random_read_test(256*1024,rand() % 65536); 
	if(do_random_write_test || do_all) random_write_test();
    }

    if(do_large_file) large_file_test();

    /* Now erase the files ... */
    unlink("test_random.aff");
    unlink("test_reverse.aff");
    unlink("test_random_contents.aff");
    unlink("test_sequential.aff");
    unlink("bugs.aff");
    unlink("test_random_contents.img");
    unlink("sparse.aff");
    return 0;
}