int main () { Shape * circle = new Circle; Shape * rectangle = new Rectangle; Simple simple; Fancy fancy; assert ( testDraw ( &simple.drawer, circle ) == SimpleCircleDrawer ); assert ( testDraw ( &fancy.drawer, rectangle ) == FancyiRactangleDrawer ); assert ( testCalculate( &fancy.calculate, circle ) == FancyCircleCalculate ); assert ( testCalculate( &simple.calculate, rectangle ) == SimpleRectangleCalculate ); }
int main(int argc, char *agr[]) { int command; do { printMenu(); printf("command = "); scanf("%d", &command); switch(command) { case 0: break; case 1: break; case 2: testDerivative(); break; case 3: //jniJLexerGetSpace(); testGetSpaces(); break; case 4: testCalculate(); break; } //testReduce(f); //testDerivative(f); // fflush(stdin); // printf("Filename: "); // fgets(str, 128, stdin); //testCalculate(f); //testReuseFunction(f); //testCriteria2(f); }while(command != 0); return 0; }