int main(int argc, char * const argv[]) { parseopts(argc, argv); printdesc("Regression testsuite mode handling\n\n"); testcase1("Check that ggiCheckMode() doesn't return GGI_AUTO"); testcase2("Check that ggiSetMode() can actually set the mode that has been suggested by ggiCheckMode"); testcase3("Check setting a mode with a given number of frames"); testcase4("Check setting a mode by its physical size"); testcase5("Set up the mode in the ggiterm way"); testcase6("Check that re-setting of a different mode works [async mode]"); testcase7("Check that re-setting of a different mode works [sync mode]"); testcase8("Check checking then setting a mode with braindamaged visual size"); testcase9("Check modelist"); printsummary(); return 0; }
int main(int argc, char **argv) { FILE *fid; int choice; // gsl_matrix_complex *A, *B; gsl_matrix *A = NULL, *B = NULL; gsl_matrix_uint *Assignment; float score; unsigned int testcount, steps; struct timeval start, stop, elapsed; //if((argc != 2 && atoi(argv[1]) != 8) || (argc != 3 && atoi(argv[1]) == 8)) if(argc != 2) { printf("Enter test case #.\n"); return 0; } fid = fopen("perfd.log", "w"); if(fid == NULL) return 0; for(steps = 50; steps <= 1000; steps += 50) { for(testcount = 0; testcount < 10; testcount++) { if((gettimeofday(&start, NULL)) == -1) { perror("gettimeofday"); exit(1); } choice = atoi(argv[1]); switch(choice) { case 1: //testcase1(&A, &B); break; case 2: testcase2(&A, &B); break; case 3: testcase3(&A, &B); break; case 4: testcase4(&A, &B); break; case 5: testcase5(&A, &B); break; case 6: testcase6(&A, &B); break; case 7: testcase7(&A, &B); break; case 8: testcase8(&A, &B, steps); break; default: printf("Invalid choice.\n"); return 0; } if(A != NULL && B != NULL) { //PrintGSLMatrixComplex(A, "Input A"); //PrintGSLMatrixComplex(B, "Input B"); Assignment = gsl_matrix_uint_alloc(A->size1, A->size2); //EigenDecomp(A, B, P); score = 0; Umeyama(A, B, Assignment, &score); //PrintGSLMatrixUint(Assignment, "Assignment"); //printf("SCORE: %f\n", score); if((gettimeofday(&stop, NULL)) == -1) { perror("gettimeofday"); exit(1); } // Compute elapsed time timeval_subtract(&elapsed, &stop, &start); fprintf(stderr, "%d\t%d\t%ld\n", steps, testcount, elapsed.tv_sec*1000000 + elapsed.tv_usec); fprintf(fid, "%d\t%d\t%ld\n", steps, testcount, elapsed.tv_sec*1000000 + elapsed.tv_usec); fflush(stderr); fflush(fid); gsl_matrix_uint_free(Assignment); //gsl_matrix_complex_free(A); //gsl_matrix_complex_free(B); gsl_matrix_free(A); gsl_matrix_free(B); } } } fclose(fid); return 0; }