Ejemplo n.º 1
0
void readFcc()
{
   std::cout << "-- Mockup" << std::endl;
   case1("fccMockup.root");
   case2("fccMockup.root");
   case3("fccMockup.root");
   std::cout << "-- Skim" << std::endl;
   case1("fccSkim.root");
   case2("fccSkim.root");
   case3("fccSkim.root");
}
Ejemplo n.º 2
0
int main()
{
	adam_init();
	
	sexpression_t* svoid;
	assert(NULL != sexp_parse("void", &svoid));
	tvoid = dalvik_type_from_sexp(svoid);
	sexp_free(svoid);
	assert(NULL != tvoid);
	/* load package */
	dalvik_loader_from_directory("test/cases/block_analyzer");
	
	
	/* run test cases */
	case1();

	case2();

	case3();

	dalvik_type_free(tvoid);
	/* finalize */
	adam_finalize();
	return 0;
}
Ejemplo n.º 3
0
 void
 coverQuantisationCornerCases()
   {
     // origin at lower end of the time range
     FixedFrameQuantiser case1 (1, Time::MIN);
     CHECK (secs(0)            == case1.gridAlign(Time::MIN  ));
     CHECK (secs(0)            == case1.gridAlign(Time::MIN +TimeValue(1) ));
     CHECK (secs(1)            == case1.gridAlign(Time::MIN +secs(1) ));
     CHECK (Time::MAX -secs(1) >  case1.gridAlign( secs(-1)  ));
     CHECK (Time::MAX -secs(1) <= case1.gridAlign( secs (0)  ));
     CHECK (Time::MAX          >  case1.gridAlign( secs (0)  ));
     CHECK (Time::MAX          == case1.gridAlign( secs(+1)  ));
     CHECK (Time::MAX          == case1.gridAlign( secs(+2)  ));
     
     // origin at upper end of the time range
     FixedFrameQuantiser case2 (1, Time::MAX);
     CHECK (secs( 0)           == case2.gridAlign(Time::MAX  ));
     CHECK (secs(-1)           == case2.gridAlign(Time::MAX -TimeValue(1) ));  // note: next lower frame
     CHECK (secs(-1)           == case2.gridAlign(Time::MAX -secs(1) ));      //        i.e. the same as a whole frame down
     CHECK (Time::MIN +secs(1) <  case2.gridAlign( secs(+2)  ));
     CHECK (Time::MIN +secs(1) >= case2.gridAlign( secs(+1)  ));
     CHECK (Time::MIN          <  case2.gridAlign( secs(+1)  ));
     CHECK (Time::MIN          == case2.gridAlign( secs( 0)  ));          //      note: because of downward truncating,
     CHECK (Time::MIN          == case2.gridAlign( secs(-1)  ));         //             resulting values will already exceed
     CHECK (Time::MIN          == case2.gridAlign( secs(-2)  ));        //              allowed range and thus will be clipped
     
     // maximum frame size is half the time range
     Duration hugeFrame(Time::MAX);
     FixedFrameQuantiser case3 (hugeFrame);
     CHECK (Time::MIN          == case3.gridAlign(Time::MIN  ));
     CHECK (Time::MIN          == case3.gridAlign(Time::MIN +TimeValue(1) ));
     CHECK (Time::MIN          == case3.gridAlign( secs(-1)  ));
     CHECK (TimeValue(0)       == case3.gridAlign( secs( 0)  ));
     CHECK (TimeValue(0)       == case3.gridAlign( secs(+1)  ));
     CHECK (TimeValue(0)       == case3.gridAlign(Time::MAX -TimeValue(1) ));
     CHECK (Time::MAX          == case3.gridAlign(Time::MAX  ));
     
     // now displacing this grid by +1sec....
     FixedFrameQuantiser case4 (hugeFrame, secs(1));
     CHECK (Time::MIN          == case4.gridAlign(Time::MIN  ));
     CHECK (Time::MIN          == case4.gridAlign(Time::MIN +TimeValue(1) ));  // clipped...
     CHECK (Time::MIN          == case4.gridAlign(Time::MIN +secs(1) ));      //  but now exact (unclipped)
     CHECK (Time::MIN          == case4.gridAlign( secs(-1)  ));
     CHECK (Time::MIN          == case4.gridAlign( secs( 0)  ));
     CHECK (TimeValue(0)       == case4.gridAlign( secs(+1)  ));           //.....now exactly the frame number zero
     CHECK (TimeValue(0)       == case4.gridAlign(Time::MAX -TimeValue(1) ));
     CHECK (TimeValue(0)       == case4.gridAlign(Time::MAX  ));         //.......still truncated down to frame #0
     
     // larger frames aren't possible
     Duration not_really_larger(secs(10000) + hugeFrame);
     CHECK (hugeFrame == not_really_larger);
     
     // frame sizes below the time micro grid get trapped
     long subAtomic = 2*GAVL_TIME_SCALE;                           // too small for this universe...
     VERIFY_ERROR (BOTTOM_VALUE, FixedFrameQuantiser quark(subAtomic) );
     VERIFY_ERROR (BOTTOM_VALUE, FixedFrameQuantiser quark(Duration (FSecs (1,subAtomic))) );
   }
int _tmain(int argc, _TCHAR* argv[])
{
	int command = 1;
	while(command){
		scanf_s("%d", &command);
		switch (command)
		{
		case 0: {
					command = 0;

				}
		case 1: {
					printf("%s", "Case 1\n");
					case1();
					break;
				}
		case 2: {
					printf("%s", "Case 2\n");
					case2();
					break;
				}
		case 3: {
					printf("%s", "Case 3\n");
					case3();
					break;
				}
		case 4: {
					printf("%s", "Case 4\n");
					case4();
					break;
				}
		case 5:{
					printf("%s", "Case 5\n");
					case5();
					break;
			   }
		default:
			break;
		}
	}
	/*VirtualAddress a = (VirtualAddress) malloc(sizeof(char));
	VirtualAddress b = (VirtualAddress) malloc(sizeof(char));
	VirtualAddress c = (VirtualAddress) malloc(sizeof(char));
	VirtualAddress d = (VirtualAddress) malloc(sizeof(char));
	_init(2, 1024);

	_malloc(&a, 512);
	_malloc(&b, 256);
	_malloc(&c, 128);
	_malloc(&d, 64);
	_free(c);
	_free(b);
	printf("%d\n", 11);*/
	_getch();
	return 0;
}
Ejemplo n.º 5
0
int main() {
  int choix;
  char *nf=(char*)malloc(sizeof(char)*128);
 
  printf("Bienvenu\n");
  printf("Veuillez saisir le nom du fichier .cha à lire\n");
  scanf("%s",nf);

  while(1) {
    printf("1 : Pour créer une figure avec une liste\n");
    printf("2 : Pour créer un réseau simple\n");
    printf("3 : Pour créer un réseau avec table de hachage\n");
    printf("4 : Pour créer un réseau avec ABRe\n");
    printf("5 : Pour créer un fichier des temps cpu de l'instance\n");
    printf("6 : Pour créer le fichier des temps cpu de l'ensemble\n");
    printf("7 : Quitter\n");

    scanf("%d",&choix);


    switch(choix) {
    case 1 :
      case1(nf);
      break;

    case 2 :
      case2(nf);
      break;

    case 3 :
      case3(nf);
      break;

    case 4 :
      case4(nf);
      break;

    case 5 :
      case5(nf);
      break;

    case 6 :
      case6(nf);
      break;


    default :
      return 0;
    }
  }
}
Ejemplo n.º 6
0
static void restoreBalance(TLDNode *node, TLDList *tld)
{
    TLDNode *x = findImbalanced(node->parent);
    if (x != NULL)
    {
        if (case1(x))
            LLRodation(x, tld);
        else if (case2(x))
            LRRotation(x, tld);
        else if (case3(x))
            RLRotation(x, tld);
        else if (case4(x))
            RRRotation(x, tld);
    }
}
int main()
{
	float a,b,c,m;
	printf("请输入三个数(用逗号连接):");
	scanf("%f,%f,%f",&a,&b,&c);
	printf("等式为:%f*x*x+%f*x+%f=0\n",a,b,c);
	m=b*b-4*a*c;
	if(m>0)
		case1(a,b,c);
	else if(m==0)
		case2(a,b,c);
	else
		case3(a,b,c);
	return 0;
}
Ejemplo n.º 8
0
int
foo (enum CASE_VALUES *index)
{
    switch (*index)
    {
    case CASE0:
        return case0 ();
    case CASE1:
        return case1 ();
    case CASE2:
        return case2 ();
    case CASE3:
        return case3 ();
    case CASE4:
        return case4 ();
    }

    return 0;
}
Ejemplo n.º 9
0
void testBug(void)
{
  ASSERT(case1());
  ASSERT(case2());
  ASSERT(case3());
}
Ejemplo n.º 10
0
structCarros() {

    do {
        for (i = 0; i < 5; i++) {

            
            cadastraCarros();
           printf("\nDIGITE 1 PARA CADASTRAR UM CARRO.. ");
           printf("\nDIGITE -1 PARA ACESSAR O MENU");
            scanf("%d", &flag2);
           if(flag2 == -1)
               break;
             
        }
        
    } while(flag2 != -1 && i < 5);

    do {
        menuCarros();
        switch (opc2) {

            case 1:
                flag2 = 1;
                do {
                    case1(diesel);
                    printf("\n\nDIGITE -1 PARA VOLTAR AO MENU.. ");
                    scanf("%d", &flag2);
                } while (flag2 != -1);
                break;
            case 2:
                flag2 = 1;
                do {
                    case2();
                    printf("\n\nDIGITE -1 PARA VOLTAR AO MENU.. ");
                    scanf("%d", &flag2);
                }while (flag2 != -1);
                break;
            case 3:
                flag2 = 1;
                do {
                    case3();
                    printf("\n\nDIGITE -1 PARA VOLTAR AO MENU.. ");
                    scanf("%d", &flag2);
                }while (flag2 != -1);
                break;
            case 4:
                flag2 = 1;
                do {
                    case4(chasi);
                    printf("\n\nDIGITE -1 PARA VOLTAR AO MENU.. ");
                    scanf("%d", &flag2);
                }while (flag2 != -1);
                break;
            case 0:
                flag2 = 0;
                exit(0);
                break;
        }
    } while (flag2 != 0);

}